fix resize visibility

Signed-off-by: Vladimir Mandic <mandic00@live.com>
This commit is contained in:
Vladimir Mandic
2025-07-06 22:13:42 -04:00
parent a12f8cbc8d
commit 9246f447df
2 changed files with 5 additions and 5 deletions
+4 -4
View File
@@ -344,13 +344,13 @@ def create_resize_inputs(tab, images, accordion=True, latent=False, non_zero=Tru
resize_name = gr.Dropdown(label=f"Method{prefix}" if non_zero else "Resize method", elem_id=f"{tab}_resize_name", choices=available_upscalers, value=available_upscalers[0], visible=True)
resize_context_choices = ["Add with forward", "Remove with forward", "Add with backward", "Remove with backward"]
resize_context = gr.Dropdown(label=f"Context{prefix}", elem_id=f"{tab}_resize_context", choices=resize_context_choices, value=resize_context_choices[0], visible=False)
ui_common.create_refresh_button(resize_name, modelloader.load_upscalers, lambda: {"choices": modelloader.load_upscalers()}, 'refresh_upscalers')
resize_refresh_btn = ui_common.create_refresh_button(resize_name, modelloader.load_upscalers, lambda: {"choices": modelloader.load_upscalers()}, 'refresh_upscalers')
def resize_mode_change(mode):
if mode is None or mode == 0:
return gr.update(visible=False), gr.update(visible=False)
return gr.update(visible=mode != 5), gr.update(visible=mode == 5)
resize_mode.change(fn=resize_mode_change, inputs=[resize_mode], outputs=[resize_name, resize_context])
return gr.update(visible=False), gr.update(visible=False), gr.update(visible=False)
return gr.update(visible=mode != 5), gr.update(visible=mode == 5), gr.update(visible=mode != 5)
resize_mode.change(fn=resize_mode_change, inputs=[resize_mode], outputs=[resize_name, resize_context, resize_refresh_btn])
with gr.Row(visible=True) as _resize_group:
with gr.Column(elem_id=f"{tab}_column_size"):