Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
@@ -112,15 +112,14 @@ with gr.Blocks(title="BLIP3-o") as demo:
|
|
112 |
Add details, link to repo, etc. here
|
113 |
''')
|
114 |
|
115 |
-
# Define shared output components
|
116 |
with gr.Row():
|
117 |
-
with gr.Column(
|
118 |
with gr.Tabs():
|
119 |
with gr.TabItem("Text → Image (Image Generation)"):
|
120 |
prompt_gen_input = gr.Textbox(
|
121 |
label="Prompt",
|
122 |
placeholder="Describe the image you want...",
|
123 |
-
lines=
|
124 |
)
|
125 |
seed_slider = gr.Slider(
|
126 |
label="Seed",
|
@@ -154,11 +153,10 @@ with gr.Blocks(title="BLIP3-o") as demo:
|
|
154 |
prompt_understand_input = gr.Textbox(
|
155 |
label="Question about image",
|
156 |
placeholder="Describe what you want to know about the image (e.g., What is in this image?)",
|
157 |
-
lines=
|
158 |
)
|
159 |
run_image_understand_btn = gr.Button("Understand Image")
|
160 |
|
161 |
-
# Assuming these image files are accessible at the root or specified path
|
162 |
image_understanding_examples_data = [
|
163 |
["animal-compare.png", "Are these two pictures showing the same kind of animal?"],
|
164 |
["funny_image.jpeg", "Why is this image funny?"],
|
@@ -173,7 +171,7 @@ with gr.Blocks(title="BLIP3-o") as demo:
|
|
173 |
|
174 |
clean_btn = gr.Button("Clear All Inputs/Outputs")
|
175 |
|
176 |
-
with gr.Column(
|
177 |
output_gallery = gr.Gallery(label="Generated Images", columns=2, visible=True) # Default to visible, content will control
|
178 |
output_text = gr.Textbox(label="Generated Text", visible=False, lines=5, interactive=False)
|
179 |
|
@@ -254,7 +252,6 @@ with gr.Blocks(title="BLIP3-o") as demo:
|
|
254 |
outputs=[output_gallery, output_text]
|
255 |
)
|
256 |
|
257 |
-
# Clean all inputs/outputs
|
258 |
clean_btn.click(
|
259 |
fn=clean_all_fn,
|
260 |
inputs=[],
|
|
|
112 |
Add details, link to repo, etc. here
|
113 |
''')
|
114 |
|
|
|
115 |
with gr.Row():
|
116 |
+
with gr.Column():
|
117 |
with gr.Tabs():
|
118 |
with gr.TabItem("Text → Image (Image Generation)"):
|
119 |
prompt_gen_input = gr.Textbox(
|
120 |
label="Prompt",
|
121 |
placeholder="Describe the image you want...",
|
122 |
+
lines=1
|
123 |
)
|
124 |
seed_slider = gr.Slider(
|
125 |
label="Seed",
|
|
|
153 |
prompt_understand_input = gr.Textbox(
|
154 |
label="Question about image",
|
155 |
placeholder="Describe what you want to know about the image (e.g., What is in this image?)",
|
156 |
+
lines=1
|
157 |
)
|
158 |
run_image_understand_btn = gr.Button("Understand Image")
|
159 |
|
|
|
160 |
image_understanding_examples_data = [
|
161 |
["animal-compare.png", "Are these two pictures showing the same kind of animal?"],
|
162 |
["funny_image.jpeg", "Why is this image funny?"],
|
|
|
171 |
|
172 |
clean_btn = gr.Button("Clear All Inputs/Outputs")
|
173 |
|
174 |
+
with gr.Column():
|
175 |
output_gallery = gr.Gallery(label="Generated Images", columns=2, visible=True) # Default to visible, content will control
|
176 |
output_text = gr.Textbox(label="Generated Text", visible=False, lines=5, interactive=False)
|
177 |
|
|
|
252 |
outputs=[output_gallery, output_text]
|
253 |
)
|
254 |
|
|
|
255 |
clean_btn.click(
|
256 |
fn=clean_all_fn,
|
257 |
inputs=[],
|