diff options
author | AUTOMATIC1111 <16777216c@gmail.com> | 2022-10-15 10:35:18 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-10-15 10:35:18 +0300 |
commit | af144ebdc70ef6f006bebd47af7a8d3180665538 (patch) | |
tree | c3ef9ef64f9959f2820a8083420f4f9b7486d636 /modules/sd_models.py | |
parent | e21f01f64504bc651da6e85216474bbd35ee010d (diff) | |
parent | 6a4e84671016d38c10a55fedcdf09321dba737ae (diff) | |
download | stable-diffusion-webui-gfx803-af144ebdc70ef6f006bebd47af7a8d3180665538.tar.gz |
Merge branch 'master' into ckpt-cache
Diffstat (limited to 'modules/sd_models.py')
-rw-r--r-- | modules/sd_models.py | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/modules/sd_models.py b/modules/sd_models.py index f3660d8d..3aa21ec1 100644 --- a/modules/sd_models.py +++ b/modules/sd_models.py @@ -136,7 +136,7 @@ def load_model_weights(model, checkpoint_info): if checkpoint_info not in checkpoints_loaded:
print(f"Loading weights [{sd_model_hash}] from {checkpoint_file}")
- pl_sd = torch.load(checkpoint_file, map_location="cpu")
+ pl_sd = torch.load(checkpoint_file, map_location=shared.weight_load_location)
if "global_step" in pl_sd:
print(f"Global Step: {pl_sd['global_step']}")
@@ -159,9 +159,8 @@ def load_model_weights(model, checkpoint_info): if os.path.exists(vae_file):
print(f"Loading VAE weights from: {vae_file}")
- vae_ckpt = torch.load(vae_file, map_location="cpu")
+ vae_ckpt = torch.load(vae_file, map_location=shared.weight_load_location)
vae_dict = {k: v for k, v in vae_ckpt["state_dict"].items() if k[0:4] != "loss"}
-
model.first_stage_model.load_state_dict(vae_dict)
model.first_stage_model.to(devices.dtype_vae)
|