Spaces:
Runtime error
Runtime error
Commit
Β·
36fb421
1
Parent(s):
7713986
Add kids drawing code
Browse files
app.py
CHANGED
@@ -1,7 +1,13 @@
|
|
1 |
-
import gradio
|
2 |
|
3 |
-
def
|
4 |
-
|
|
|
5 |
|
6 |
-
|
7 |
-
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import gradio
|
2 |
|
3 |
+
def image_prompt(thing):
|
4 |
+
prompt = "A children's drawing of a " + thing
|
5 |
+
return pipe(prompt=prompt, height=512, width=664).images[0]
|
6 |
|
7 |
+
with gradio.Blocks() as demo:
|
8 |
+
animal = gradio.Textbox(label="A kid's drawing of a...")
|
9 |
+
output = gradio.Image(label="Behold...")
|
10 |
+
go_button = gradio.Button("Draw it!")
|
11 |
+
go_button.click(fn=image_prompt, inputs=animal, outputs=output)
|
12 |
+
|
13 |
+
demo.launch()
|