Commit ·
e81128d
1
Parent(s): 26b235a
Update run handlers to also update Gallery tab after generation
Browse files
ui/events/run_handlers.py
CHANGED
|
@@ -96,8 +96,12 @@ def create_run_event(prefix: str, task_type: str, ui_components: dict):
|
|
| 96 |
run_btn = ui_components.get(f'run_{prefix}') or ui_components.get(f'{prefix}_run_button')
|
| 97 |
res_gal = ui_components.get(f'result_{prefix}') or ui_components.get(f'{prefix}_output_gallery')
|
| 98 |
if run_btn and res_gal:
|
|
|
|
|
|
|
|
|
|
|
|
|
| 99 |
run_btn.click(
|
| 100 |
fn=lambda *args, progress=gr.Progress(track_tqdm=True): generate_image_wrapper(create_ui_inputs_dict(*args), progress),
|
| 101 |
inputs=input_list_flat,
|
| 102 |
-
outputs=
|
| 103 |
)
|
|
|
|
| 96 |
run_btn = ui_components.get(f'run_{prefix}') or ui_components.get(f'{prefix}_run_button')
|
| 97 |
res_gal = ui_components.get(f'result_{prefix}') or ui_components.get(f'{prefix}_output_gallery')
|
| 98 |
if run_btn and res_gal:
|
| 99 |
+
outputs = [res_gal]
|
| 100 |
+
gallery_tab = ui_components.get('gallery')
|
| 101 |
+
if gallery_tab:
|
| 102 |
+
outputs.append(gallery_tab)
|
| 103 |
run_btn.click(
|
| 104 |
fn=lambda *args, progress=gr.Progress(track_tqdm=True): generate_image_wrapper(create_ui_inputs_dict(*args), progress),
|
| 105 |
inputs=input_list_flat,
|
| 106 |
+
outputs=outputs
|
| 107 |
)
|