Improve option handling (sd_model_checkpoint / forge_additional_modules) (#2181)

* Sort modules when checking for changes
* Compare consistent checkpoint values
This commit is contained in:
altoiddealer
2024-10-26 16:10:05 -04:00
committed by GitHub
parent d4d8ad406e
commit 145a46907e
3 changed files with 18 additions and 11 deletions

View File

@@ -234,8 +234,9 @@ def set_config(req: dict[str, Any], is_api=False, run_callbacks=True, save_confi
if k == 'sd_model_checkpoint':
if v is not None and v not in sd_models.checkpoint_aliases:
raise RuntimeError(f"model {v!r} not found")
main_entry.checkpoint_change(v, save=False, refresh=False)
should_refresh_model_loading_params = True
checkpoint_changed = main_entry.checkpoint_change(v, save=False, refresh=False)
if checkpoint_changed:
should_refresh_model_loading_params = True
elif k == 'forge_additional_modules':
modules_changed = main_entry.modules_change(v, save=False, refresh=False)
if modules_changed: