prevent (Managed by Forge) settings from reverting to default (#2090)

* prevent (Managed by Forge) settings reverting to default
* save CLIP skip to config when changed, inconsistent / unpredictable saving behaviour otherwise
This commit is contained in:
DenOfEquity 2024-10-16 14:10:26 +01:00 committed by GitHub
parent 2c543719e3
commit 9efa4eabfd
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 5 additions and 1 deletions

View File

@ -83,6 +83,10 @@ class UiSettings:
if comp == self.dummy_component:
continue
# don't set (Managed by Forge) options, they revert to defaults
if key in ["sd_model_checkpoint", "CLIP_stop_at_last_layers", "sd_vae"]:
continue
if opts.set(key, value):
changed.append(key)

View File

@ -119,7 +119,7 @@ def make_checkpoint_manager_ui():
Context.root_block.load(ui_refresh_memory_management_settings, inputs=mem_comps, queue=False, show_progress=False)
ui_clip_skip = gr.Slider(label="Clip skip", value=lambda: shared.opts.CLIP_stop_at_last_layers, **{"minimum": 1, "maximum": 12, "step": 1})
bind_to_opts(ui_clip_skip, 'CLIP_stop_at_last_layers', save=False)
bind_to_opts(ui_clip_skip, 'CLIP_stop_at_last_layers', save=True)
ui_checkpoint.change(checkpoint_change, inputs=[ui_checkpoint], show_progress=False)
ui_vae.change(modules_change, inputs=[ui_vae], queue=False, show_progress=False)