fix settings components mismatch

Signed-off-by: Vladimir Mandic <mandic00@live.com>
This commit is contained in:
Vladimir Mandic
2025-08-06 18:35:43 -04:00
parent aa0652caa9
commit a91ee36b5c
6 changed files with 13 additions and 5 deletions
+1
View File
@@ -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
+1
View File
@@ -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']
+1 -1
View File
@@ -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}),
+1 -1
View File
@@ -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}),
+8 -2
View File
@@ -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()
+1 -1
Submodule wiki updated: 85ff38d289...96e3932bff