Spaces:
Runtime error
Runtime error
Logan Zoellner
commited on
Commit
·
b2649ae
1
Parent(s):
a7dfebd
initial commit
Browse files
app.py
ADDED
@@ -0,0 +1,38 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
from asyncio import constants
|
2 |
+
import gradio as gr
|
3 |
+
|
4 |
+
|
5 |
+
def generate_image(text):
|
6 |
+
dalle = gr.Interface.load("spaces/kuprel/min-dalle")
|
7 |
+
|
8 |
+
print("calling interface",text)
|
9 |
+
img=dalle(text)
|
10 |
+
|
11 |
+
|
12 |
+
gfpgan=gr.Interface.load("spaces/akhaliq/GFPGAN")
|
13 |
+
img2=dalle(img)
|
14 |
+
|
15 |
+
|
16 |
+
return img2
|
17 |
+
|
18 |
+
demo = gr.Blocks()
|
19 |
+
|
20 |
+
with demo:
|
21 |
+
gr.Markdown("<h1><center>StyleGan-Human + PIFu </center></h1>")
|
22 |
+
gr.Markdown(
|
23 |
+
"create an image with min-dalle then fix faces with grpgan"
|
24 |
+
)
|
25 |
+
|
26 |
+
|
27 |
+
with gr.Row():
|
28 |
+
b0 = gr.Button("generate image")
|
29 |
+
|
30 |
+
with gr.Row():
|
31 |
+
text=gr.Text(default="three pigs in a trenchcoat", label='Seed')
|
32 |
+
#outputImage = gr.Image(label="portrait",type="filepath", shape=(256,256))
|
33 |
+
output_image = gr.outputs.Image(type="filepath", label='Output')
|
34 |
+
|
35 |
+
|
36 |
+
b0.click(generate_image,inputs=[text],outputs=[output_image])
|
37 |
+
|
38 |
+
demo.launch(enable_queue=True, debug=True)
|