Sean-Laurent commited on
Commit
3c8d8b2
·
1 Parent(s): 806b780

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +14 -10
app.py CHANGED
@@ -14,16 +14,20 @@ def open_ai_txt2img(prompt):
14
  return response["data"][0]["url"]
15
 
16
  # Gradio Interface
17
- def generator(prompt):
18
- return open_ai_txt2img(prompt), open_ai_txt2img(prompt), open_ai_txt2img(prompt)
 
 
 
 
 
 
 
19
 
20
- with gr.Blocks() as demo:
21
- prompt = gr.Textbox(label="Prompt")
22
- submit = gr.Button(label="Generate")
23
- image1 = gr.Image()
24
- image2 = gr.Image()
25
- image3 = gr.Image()
26
-
27
- submit.click(generator, inputs=[prompt], outputs=[image1, image2, image3], api_name="mmd")
28
 
 
29
  demo.launch()
 
14
  return response["data"][0]["url"]
15
 
16
  # Gradio Interface
17
+ # def generator(prompt):
18
+ # return open_ai_txt2img(prompt), open_ai_txt2img(prompt), open_ai_txt2img(prompt)
19
+
20
+ # with gr.Blocks() as demo:
21
+ # prompt = gr.Textbox(label="Prompt")
22
+ # submit = gr.Button(label="Generate")
23
+ # image1 = gr.Image()
24
+ # image2 = gr.Image()
25
+ # image3 = gr.Image()
26
 
27
+ # submit.click(generator, inputs=[prompt], outputs=[image1, image2, image3], api_name="mmd")
28
+
29
+ def generator(prompt):
30
+ return open_ai_txt2img(prompt)
 
 
 
 
31
 
32
+ demo = gr.Interface(fn=generator, inputs="text", outputs="image")
33
  demo.launch()