diff options
author | AUTOMATIC <16777216c@gmail.com> | 2023-06-27 06:26:18 +0000 |
---|---|---|
committer | AUTOMATIC <16777216c@gmail.com> | 2023-06-27 06:26:18 +0000 |
commit | d06af4e517865277d0521642c2c5513af9afd76f (patch) | |
tree | 28c89b68d5bd60a8de6fca6e47578f684ef0f627 /modules/api/api.py | |
parent | a96687682a40c7c791dca7d4d81296259b043c8b (diff) | |
download | stable-diffusion-webui-gfx803-d06af4e517865277d0521642c2c5513af9afd76f.tar.gz stable-diffusion-webui-gfx803-d06af4e517865277d0521642c2c5513af9afd76f.tar.bz2 stable-diffusion-webui-gfx803-d06af4e517865277d0521642c2c5513af9afd76f.zip |
fix and rework #11113
Diffstat (limited to 'modules/api/api.py')
-rw-r--r-- | modules/api/api.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/modules/api/api.py b/modules/api/api.py index f96056b6..1d4aeff5 100644 --- a/modules/api/api.py +++ b/modules/api/api.py @@ -522,9 +522,9 @@ 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") + checkpoint_name = req.get("sd_model_checkpoint", None) + if checkpoint_name is not None and checkpoint_name not in checkpoint_alisases: + raise RuntimeError(f"model {checkpoint_name!r} not found") for k, v in req.items(): shared.opts.set(k, v) |