From a91ee36b5cbdfbc601ffb885ba3d2b37621522a0 Mon Sep 17 00:00:00 2001 From: Vladimir Mandic Date: Wed, 6 Aug 2025 18:35:43 -0400 Subject: [PATCH] fix settings components mismatch Signed-off-by: Vladimir Mandic --- CHANGELOG.md | 1 + modules/options_handler.py | 1 + modules/shared.py | 2 +- modules/shared_legacy.py | 2 +- modules/ui_settings.py | 10 ++++++++-- wiki | 2 +- 6 files changed, 13 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b43e60f2b..64279e45e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -74,6 +74,7 @@ And (*as always*) many bugfixes and improvements to existing features! - update requirements/packages - **Fixes** - refactor legacy processing loop + - fix settings components mismatch - fix Wan 2.2-5B I2V workflow - fix OpenVINO - fix video model vs pipeline mismatch diff --git a/modules/options_handler.py b/modules/options_handler.py index ac974f6de..5dd7f5435 100644 --- a/modules/options_handler.py +++ b/modules/options_handler.py @@ -9,6 +9,7 @@ from installer import log if TYPE_CHECKING: from modules.options import OptionInfo + cmd_opts = cmd_args.parse_args() compatibility_opts = ['clip_skip', 'uni_pc_lower_order_final', 'uni_pc_order'] diff --git a/modules/shared.py b/modules/shared.py index ea368da49..31d878601 100644 --- a/modules/shared.py +++ b/modules/shared.py @@ -693,7 +693,7 @@ options_templates.update(options_section(('extra_networks', "Networks"), { "wildcards_enabled": OptionInfo(True, "Enable file wildcards support"), })) -options_templates.update(options_section((None, "Hidden options"), { +options_templates.update(options_section(('hidden_options', "Hidden options"), { # internal options "diffusers_version": OptionInfo("", "Diffusers version", gr.Textbox, {"visible": False}), "disabled_extensions": OptionInfo([], "Disable these extensions", gr.Textbox, {"visible": False}), diff --git a/modules/shared_legacy.py b/modules/shared_legacy.py index b4f2e4c11..d83096675 100644 --- a/modules/shared_legacy.py +++ b/modules/shared_legacy.py @@ -9,7 +9,7 @@ class LegacyOption(OptionInfo): super().__init__(*args, **kwargs) -legacy_options = options_section((None, "Legacy options"), { +legacy_options = options_section(('legacy_options', "Legacy options"), { "ldsr_models_path": LegacyOption(os.path.join(paths.models_path, 'LDSR'), "LDSR Path", gr.Textbox, { "visible": False}), "interrogate_clip_skip_categories": LegacyOption(["artists", "movements", "flavors"], "CLiP: skip categories", gr.CheckboxGroup, {"choices": [], "visible":False}), "lora_legacy": LegacyOption(False, "LoRA load using legacy method", gr.Checkbox, {"visible": False}), diff --git a/modules/ui_settings.py b/modules/ui_settings.py index 0687e9a6f..042941692 100644 --- a/modules/ui_settings.py +++ b/modules/ui_settings.py @@ -119,6 +119,9 @@ def run_settings(*args): changed = [] for key, value, comp in zip(shared.opts.data_labels.keys(), args, components): if comp == dummy_component or value=='dummy': # or getattr(comp, 'visible', True) is False or key in hidden_list: + actual = shared.opts.data.get(key, None) # ensure the key is in data + default = shared.opts.data_labels[key].default + # shared.log.warning(f'Setting skip: key={key} value={value} actual={actual} default={default} comp={comp}') continue if not shared.opts.same_type(value, shared.opts.data_labels[key].default): shared.log.error(f'Setting bad value: {key}={value} expecting={type(shared.opts.data_labels[key].default).__name__}') @@ -191,6 +194,7 @@ def create_ui(): result = gr.HTML(elem_id="settings_result") script_callbacks.ui_settings_callback() # let extensions create settings sections = [] + options_count = len(shared.opts.data_labels) for item in shared.opts.data_labels.values(): # get unique sections from all items if len(item.section) == 2: section_id, section_text = item.section @@ -203,7 +207,7 @@ def create_ui(): if (section_id, section_text) not in sections: sections.append((section_id, section_text)) - shared.log.debug(f'Settings: sections={len(sections)} settings={len(shared.opts.list())}/{len(list(shared.opts.data_labels))}') + shared.log.debug(f'Settings: sections={len(sections)} settings={len(shared.opts.list())}/{len(list(shared.opts.data_labels))} quicksettings={len(quicksettings_list)}') with gr.Tabs(elem_id="settings"): quicksettings_list.clear() for (section_id, section_text) in sections: @@ -228,12 +232,14 @@ def create_ui(): current_items.append(key) components.append(component) create_dirty_indicator(section_id, current_items) + components_count = len(components) + if components_count != options_count: + shared.log.error(f'Settings: count mismatch: options={options_count} components={components_count}') with gr.TabItem("Show all pages", elem_id="settings_show_all_pages"): create_dirty_indicator("show_all_pages", []) request_notifications = gr.Button(value='Request browser notifications', elem_id="request_notifications", visible=False) - with gr.TabItem("Update", id="system_update", elem_id="tab_update"): from modules import update update.create_ui() diff --git a/wiki b/wiki index 85ff38d28..96e3932bf 160000 --- a/wiki +++ b/wiki @@ -1 +1 @@ -Subproject commit 85ff38d28980390786f4558666425d29f7bceb33 +Subproject commit 96e3932bffee9117951956074956e943f254702b