Spaces:
Runtime error
Runtime error
bug fix
Browse files
app.py
CHANGED
|
@@ -354,10 +354,11 @@ def update_is_multiimage(event: gr.SelectData):
|
|
| 354 |
return gr.update("true" if event.index == 1 else "false")
|
| 355 |
|
| 356 |
def toggle_multiimage_visibility(choice: str):
|
| 357 |
-
|
| 358 |
-
|
| 359 |
-
|
| 360 |
-
|
|
|
|
| 361 |
|
| 362 |
|
| 363 |
with gr.Blocks(delete_cache=(600, 600)) as demo:
|
|
@@ -407,10 +408,11 @@ with gr.Blocks(delete_cache=(600, 600)) as demo:
|
|
| 407 |
uploaded_api_images = gr.Files(file_types=["image"], label="Upload Images")
|
| 408 |
multiimage_combined = gr.State()
|
| 409 |
|
| 410 |
-
is_multiimage.change(
|
| 411 |
fn=toggle_multiimage_visibility,
|
| 412 |
inputs=is_multiimage,
|
| 413 |
-
outputs=[uploaded_api_images, multiimage_prompt]
|
|
|
|
| 414 |
)
|
| 415 |
|
| 416 |
with gr.Accordion(label="Generation Settings", open=False):
|
|
|
|
| 354 |
return gr.update("true" if event.index == 1 else "false")
|
| 355 |
|
| 356 |
def toggle_multiimage_visibility(choice: str):
|
| 357 |
+
show = choice.lower() == "true"
|
| 358 |
+
return (
|
| 359 |
+
gr.update(visible=show), # uploaded_api_images
|
| 360 |
+
gr.update(visible=show) # multiimage_prompt (Gallery)
|
| 361 |
+
)
|
| 362 |
|
| 363 |
|
| 364 |
with gr.Blocks(delete_cache=(600, 600)) as demo:
|
|
|
|
| 408 |
uploaded_api_images = gr.Files(file_types=["image"], label="Upload Images")
|
| 409 |
multiimage_combined = gr.State()
|
| 410 |
|
| 411 |
+
is_multiimage.change(
|
| 412 |
fn=toggle_multiimage_visibility,
|
| 413 |
inputs=is_multiimage,
|
| 414 |
+
outputs=[uploaded_api_images, multiimage_prompt],
|
| 415 |
+
trigger_mode="always"
|
| 416 |
)
|
| 417 |
|
| 418 |
with gr.Accordion(label="Generation Settings", open=False):
|