File size: 916 Bytes
b2649ae
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
from asyncio import constants
import gradio as gr


def generate_image(text):
  dalle = gr.Interface.load("spaces/kuprel/min-dalle")
  
  print("calling interface",text)
  img=dalle(text)


  gfpgan=gr.Interface.load("spaces/akhaliq/GFPGAN")
  img2=dalle(img)


  return img2

demo = gr.Blocks()

with demo:
  gr.Markdown("<h1><center>StyleGan-Human + PIFu </center></h1>")
  gr.Markdown(
        "create an image with min-dalle then fix faces with grpgan"
    )
    
  
  with gr.Row():
    b0 = gr.Button("generate image")
  
  with gr.Row():  
    text=gr.Text(default="three pigs in a trenchcoat", label='Seed')
    #outputImage = gr.Image(label="portrait",type="filepath", shape=(256,256))
    output_image = gr.outputs.Image(type="filepath", label='Output')
    
  
  b0.click(generate_image,inputs=[text],outputs=[output_image])

demo.launch(enable_queue=True, debug=True)