diff options
author | AUTOMATIC <16777216c@gmail.com> | 2022-10-08 10:39:08 +0000 |
---|---|---|
committer | AUTOMATIC <16777216c@gmail.com> | 2022-10-08 10:39:08 +0000 |
commit | 45cc0ce3c4616180b92dae37e5a89673bb145fa7 (patch) | |
tree | 1e59123b11e17868f5f77a17eedd14825f9b0244 | |
parent | 706d5944a075a6523ea7f00165d630efc085ca22 (diff) | |
parent | 616b7218f7c469d25c138634472017a7e18e742e (diff) | |
download | stable-diffusion-webui-gfx803-45cc0ce3c4616180b92dae37e5a89673bb145fa7.tar.gz stable-diffusion-webui-gfx803-45cc0ce3c4616180b92dae37e5a89673bb145fa7.tar.bz2 stable-diffusion-webui-gfx803-45cc0ce3c4616180b92dae37e5a89673bb145fa7.zip |
Merge remote-tracking branch 'origin/master'
-rw-r--r-- | modules/sd_models.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/modules/sd_models.py b/modules/sd_models.py index 8f794b47..9409d070 100644 --- a/modules/sd_models.py +++ b/modules/sd_models.py @@ -122,7 +122,11 @@ def load_model_weights(model, checkpoint_file, sd_model_hash): pl_sd = torch.load(checkpoint_file, map_location="cpu")
if "global_step" in pl_sd:
print(f"Global Step: {pl_sd['global_step']}")
- sd = pl_sd["state_dict"]
+
+ if "state_dict" in pl_sd:
+ sd = pl_sd["state_dict"]
+ else:
+ sd = pl_sd
model.load_state_dict(sd, strict=False)
|