mirror of
https://github.com/AUTOMATIC1111/stable-diffusion-webui.git
synced 2026-01-05 16:51:21 -08:00
update model checkpoint switch code
This commit is contained in:
parent
8ca34ad6d8
commit
7e2d39a2d1
1 changed files with 4 additions and 5 deletions
|
|
@ -514,12 +514,11 @@ class Api:
|
|||
return options
|
||||
|
||||
def set_config(self, req: Dict[str, Any]):
|
||||
checkpoint_key="sd_model_checkpoint"
|
||||
if checkpoint_key in req and str(req[checkpoint_key]) not in checkpoint_alisases:
|
||||
raise RuntimeError(f"model {v!r} not found")
|
||||
|
||||
for k, v in req.items():
|
||||
if k == "sd_model_checkpoint":
|
||||
checkpoint_info = checkpoint_alisases.get(v, None)
|
||||
if checkpoint_info is None:
|
||||
print(f"model [{v}] not founded, skip config saving process")
|
||||
return
|
||||
shared.opts.set(k, v)
|
||||
|
||||
shared.opts.save(shared.config_filename)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue