diff options
author | AUTOMATIC <16777216c@gmail.com> | 2022-11-28 05:39:59 +0000 |
---|---|---|
committer | AUTOMATIC <16777216c@gmail.com> | 2022-11-28 05:39:59 +0000 |
commit | 0376da180c81a11880a2587903d69d85541051e7 (patch) | |
tree | eacd4d6f2ebd0060aeabd57066f5e2a366f3316f /modules/sd_models.py | |
parent | bb11bee22ab02aa2fb5b96baa9be8103fff19e6a (diff) | |
download | stable-diffusion-webui-gfx803-0376da180c81a11880a2587903d69d85541051e7.tar.gz stable-diffusion-webui-gfx803-0376da180c81a11880a2587903d69d85541051e7.tar.bz2 stable-diffusion-webui-gfx803-0376da180c81a11880a2587903d69d85541051e7.zip |
make it possible to save nai model using safetensors
Diffstat (limited to 'modules/sd_models.py')
-rw-r--r-- | modules/sd_models.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/modules/sd_models.py b/modules/sd_models.py index a1ea5611..283cf1cd 100644 --- a/modules/sd_models.py +++ b/modules/sd_models.py @@ -144,8 +144,8 @@ def transform_checkpoint_dict_key(k): def get_state_dict_from_checkpoint(pl_sd):
- if "state_dict" in pl_sd:
- pl_sd = pl_sd["state_dict"]
+ pl_sd = pl_sd.pop("state_dict", pl_sd)
+ pl_sd.pop("state_dict", None)
sd = {}
for k, v in pl_sd.items():
|