Spaces:
Sleeping
Sleeping
thomasgauthier
commited on
Commit
•
edb3f33
1
Parent(s):
bd0e8c7
layout
Browse files- gradio_interface.py +12 -8
gradio_interface.py
CHANGED
@@ -25,22 +25,26 @@ Here, by feeding the model an image and then asking it to generate that same ima
|
|
25 |
with gr.Row():
|
26 |
input_image = gr.Image(type="filepath", label="Input Image")
|
27 |
output_images = gr.Gallery(label="Generated Images", columns=2, rows=2)
|
28 |
-
|
29 |
-
gr.
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
|
|
|
|
|
|
|
|
34 |
|
35 |
generate_btn.click(
|
36 |
fn=gradio_process_and_generate,
|
37 |
inputs=[input_image, prompt, num_images, cfg_weight],
|
38 |
outputs=output_images
|
39 |
)
|
|
|
40 |
gr.Examples(
|
41 |
examples=examples,
|
42 |
inputs=[input_image, dummy]
|
43 |
-
|
44 |
-
|
45 |
|
46 |
return demo
|
|
|
25 |
with gr.Row():
|
26 |
input_image = gr.Image(type="filepath", label="Input Image")
|
27 |
output_images = gr.Gallery(label="Generated Images", columns=2, rows=2)
|
28 |
+
|
29 |
+
with gr.Row():
|
30 |
+
# New layout here: Controls on the left, explanation on the right
|
31 |
+
with gr.Column(scale=1):
|
32 |
+
prompt = gr.Textbox(label="Prompt", value="Exactly what is shown in the image.")
|
33 |
+
num_images = gr.Slider(minimum=1, maximum=12, value=12, step=1, label="Number of Images to Generate")
|
34 |
+
cfg_weight = gr.Slider(minimum=1, maximum=10, value=5, step=0.1, label="CFG Weight")
|
35 |
+
generate_btn = gr.Button("Generate", variant="primary", size="lg")
|
36 |
+
with gr.Column(scale=2):
|
37 |
+
gr.Markdown(explanation)
|
38 |
|
39 |
generate_btn.click(
|
40 |
fn=gradio_process_and_generate,
|
41 |
inputs=[input_image, prompt, num_images, cfg_weight],
|
42 |
outputs=output_images
|
43 |
)
|
44 |
+
|
45 |
gr.Examples(
|
46 |
examples=examples,
|
47 |
inputs=[input_image, dummy]
|
48 |
+
)
|
|
|
49 |
|
50 |
return demo
|