Spaces:
Running
on
Zero
Running
on
Zero
Commit
·
af997b5
1
Parent(s):
600e217
test
Browse files
app.py
CHANGED
|
@@ -82,34 +82,34 @@ def generate_image_with_refinement(prompt):
|
|
| 82 |
|
| 83 |
# Start of the Gradio Blocks interface
|
| 84 |
with gr.Blocks() as demo:
|
| 85 |
-
gr.
|
| 86 |
-
|
| 87 |
-
|
| 88 |
-
|
| 89 |
-
|
| 90 |
-
|
| 91 |
-
|
| 92 |
output_image1 = gr.Image(type="filepath", label="Generated Image")
|
| 93 |
|
| 94 |
-
|
| 95 |
-
|
| 96 |
-
|
| 97 |
-
|
| 98 |
-
|
| 99 |
-
|
| 100 |
-
gr.
|
| 101 |
-
|
| 102 |
-
|
| 103 |
-
|
| 104 |
-
|
|
|
|
| 105 |
output_image2 = gr.Image(type="filepath", label="Generated Refined Image")
|
| 106 |
|
| 107 |
-
|
| 108 |
-
|
| 109 |
-
|
| 110 |
-
|
| 111 |
-
|
| 112 |
|
| 113 |
# Launch the combined Gradio app
|
| 114 |
demo.launch()
|
| 115 |
-
|
|
|
|
| 82 |
|
| 83 |
# Start of the Gradio Blocks interface
|
| 84 |
with gr.Blocks() as demo:
|
| 85 |
+
with gr.Column():
|
| 86 |
+
gr.Markdown("# Image Generation with SSD-1B")
|
| 87 |
+
gr.Markdown("Enter a prompt and (optionally) a negative prompt to generate an image.")
|
| 88 |
+
with gr.Row():
|
| 89 |
+
prompt1 = gr.Textbox(label="Enter prompt")
|
| 90 |
+
negative_prompt = gr.Textbox(label="Enter negative prompt (optional)")
|
| 91 |
+
generate_button1 = gr.Button("Generate Image")
|
| 92 |
output_image1 = gr.Image(type="filepath", label="Generated Image")
|
| 93 |
|
| 94 |
+
generate_button1.click(
|
| 95 |
+
generate_and_save_image,
|
| 96 |
+
inputs=[prompt1, negative_prompt],
|
| 97 |
+
outputs=output_image1
|
| 98 |
+
)
|
| 99 |
+
|
| 100 |
+
with gr.Column():
|
| 101 |
+
gr.Markdown("## Refined Image Generation")
|
| 102 |
+
gr.Markdown("Enter a prompt to generate a refined image.")
|
| 103 |
+
with gr.Row():
|
| 104 |
+
prompt2 = gr.Textbox(label="Enter prompt for refined generation")
|
| 105 |
+
generate_button2 = gr.Button("Generate Refined Image")
|
| 106 |
output_image2 = gr.Image(type="filepath", label="Generated Refined Image")
|
| 107 |
|
| 108 |
+
generate_button2.click(
|
| 109 |
+
generate_image_with_refinement,
|
| 110 |
+
inputs=[prompt2],
|
| 111 |
+
outputs=output_image2
|
| 112 |
+
)
|
| 113 |
|
| 114 |
# Launch the combined Gradio app
|
| 115 |
demo.launch()
|
|
|