File size: 451 Bytes
c05386f
8630717
c4e547f
8630717
3d654b9
 
f2586d6
8630717
4197898
 
3d654b9
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
import gradio as gr
from huggingface_hub import InferenceClient

client = InferenceClient("stabilityai/stable-diffusion-xl-base-1.0")

def greet(prompt):
    print(prompt)
    image = client.text_to_image(prompt)
    print(image)
    return image

demo = gr.Interface(
    fn=greet,
    inputs=[
        gr.Textbox(label="prompt")
    ],
    outputs=[gr.Image()],
    api_name="chat",
    clear_btn=None
)

if __name__ == "__main__":
    demo.launch()