Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
@@ -49,6 +49,16 @@ def generate_image(prompt, ckpt):
|
|
49 |
return results.images[0]
|
50 |
|
51 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
52 |
|
53 |
# Gradio Interface
|
54 |
|
@@ -60,7 +70,14 @@ with gr.Blocks(css=CSS) as demo:
|
|
60 |
prompt = gr.Textbox(label='Enter your prompt (English)', scale=8)
|
61 |
ckpt = gr.Dropdown(label='Select inference steps',choices=['1-Step', '4-Step'], value='4-Step', interactive=True)
|
62 |
submit = gr.Button(scale=1, variant='primary')
|
63 |
-
img = gr.Image(label='DMD2 Generated Image')
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
64 |
|
65 |
prompt.submit(fn=generate_image,
|
66 |
inputs=[prompt, ckpt],
|
|
|
49 |
return results.images[0]
|
50 |
|
51 |
|
52 |
+
examples = [
|
53 |
+
"a cat eating a piece of cheese",
|
54 |
+
"a ROBOT riding a BLUE horse on Mars, photorealistic",
|
55 |
+
"Ironman VS Hulk, ultrarealistic",
|
56 |
+
"a CUTE robot artist painting on an easel",
|
57 |
+
"Astronaut in a jungle, cold color palette, oil pastel, detailed, 8k",
|
58 |
+
"An alien holding sign board contain word 'Flash', futuristic, neonpunk",
|
59 |
+
"Kids going to school, Anime style"
|
60 |
+
]
|
61 |
+
|
62 |
|
63 |
# Gradio Interface
|
64 |
|
|
|
70 |
prompt = gr.Textbox(label='Enter your prompt (English)', scale=8)
|
71 |
ckpt = gr.Dropdown(label='Select inference steps',choices=['1-Step', '4-Step'], value='4-Step', interactive=True)
|
72 |
submit = gr.Button(scale=1, variant='primary')
|
73 |
+
img = gr.Image(label='DMD2 Generated Image')
|
74 |
+
gr.Examples(
|
75 |
+
examples=examples,
|
76 |
+
inputs=prompt,
|
77 |
+
outputs=img,
|
78 |
+
fn=generate_image,
|
79 |
+
cache_examples=True,
|
80 |
+
)
|
81 |
|
82 |
prompt.submit(fn=generate_image,
|
83 |
inputs=[prompt, ckpt],
|