From b051835f09e506b3f2c93cecbc286690ff01e634 Mon Sep 17 00:00:00 2001 From: AlUlkesh <99896447+AlUlkesh@users.noreply.github.com> Date: Mon, 5 Jun 2023 01:33:13 +0200 Subject: [PATCH] set do_not_save_to_config, #195 --- scripts/image_browser.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/scripts/image_browser.py b/scripts/image_browser.py index 69bacf9..8249d2a 100644 --- a/scripts/image_browser.py +++ b/scripts/image_browser.py @@ -1131,8 +1131,7 @@ def create_tab(tab: ImageBrowserTab, current_gr_tab: gr.Tab): with gr.Row(visible=others_dir): with gr.Column(scale=10): - suffix = "" if others_dir else tab.name - img_path = gr.Textbox(dir_name, label="Images directory"+suffix, placeholder="Input images directory", interactive=others_dir) + img_path = gr.Textbox(dir_name, label="Images directory", placeholder="Input images directory", interactive=others_dir) with gr.Column(scale=1): img_path_depth = gr.Number(value="0", label="Sub directory depth") with gr.Column(scale=1): @@ -1646,6 +1645,11 @@ def on_ui_tabs(): debug_level_option = "" gr.Textbox(value=debug_level_option, elem_id="image_browser_debug_level_option", visible=False) + # Webui's ui_loadsave uses gradio labels as keys, this does not work with image browser, as the same labels are used on different tabs + # For this reason the do_not_save_to_config attribute is added to each gradio element + for key, value in image_browser.blocks.items(): + setattr(value, "do_not_save_to_config", True) + return (image_browser, "Image Browser", "image_browser"), def move_setting(cur_setting_name, old_setting_name, option_info, section, added):