yue-here
commited on
Commit
•
77e2e9d
1
Parent(s):
d2980e7
update app
Browse files
app.py
CHANGED
@@ -9,16 +9,10 @@ def infer(text, steps):
|
|
9 |
generated_images = pipeline(
|
10 |
text,
|
11 |
batch_size=1, # Generate one image at a time for each step
|
12 |
-
|
13 |
-
num_inference_steps=steps
|
14 |
).images
|
15 |
|
16 |
return generated_images[0]
|
17 |
|
18 |
-
demo = gr.Interface(
|
19 |
-
|
20 |
-
inputs=[gr.inputs.Textbox(label="Input Text"), gr.inputs.Slider(minimum=1, maximum=50, step=1, default=10, label="Inference Steps")],
|
21 |
-
outputs=gr.outputs.Image(type="pil", label="Generated Image")
|
22 |
-
)
|
23 |
-
|
24 |
-
demo.launch()
|
|
|
9 |
generated_images = pipeline(
|
10 |
text,
|
11 |
batch_size=1, # Generate one image at a time for each step
|
12 |
+
num_inference_steps=int(steps)
|
|
|
13 |
).images
|
14 |
|
15 |
return generated_images[0]
|
16 |
|
17 |
+
demo = gr.Interface(fn=infer, inputs=["text", "number"], outputs="image")
|
18 |
+
demo.launch()
|
|
|
|
|
|
|
|
|
|