Sean Laurent commited on
Commit
ede04cf
·
1 Parent(s): ea3e363

Added multiple image outputs

Browse files
Files changed (1) hide show
  1. app.py +14 -3
app.py CHANGED
@@ -15,7 +15,18 @@ def open_ai_txt2img(prompt):
15
 
16
  # Gradio Interface
17
  def generator(prompt):
18
- return open_ai_txt2img(prompt)
19
 
20
- iface = gr.Interface(fn=generator, inputs="text", outputs="image")
21
- iface.launch()
 
 
 
 
 
 
 
 
 
 
 
 
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, prompt, outputs=[image1, image2, image3])
28
+
29
+ demo.launch()
30
+
31
+ # iface = gr.Interface(fn=generator, inputs="text", outputs="image")
32
+ # iface.launch()