diff options
author | AUTOMATIC <16777216c@gmail.com> | 2022-10-10 17:46:55 +0000 |
---|---|---|
committer | AUTOMATIC <16777216c@gmail.com> | 2022-10-10 17:46:55 +0000 |
commit | 727e4d108674dc2813507e2a973a733ef21e8d53 (patch) | |
tree | 6f0dc725f836c16e0fa89dd41f600394ea15c737 /modules | |
parent | b3d3b335cf5fb6904d12af16b6a1cedab1c5106f (diff) | |
download | stable-diffusion-webui-gfx803-727e4d108674dc2813507e2a973a733ef21e8d53.tar.gz stable-diffusion-webui-gfx803-727e4d108674dc2813507e2a973a733ef21e8d53.tar.bz2 stable-diffusion-webui-gfx803-727e4d108674dc2813507e2a973a733ef21e8d53.zip |
no to different messages plus fix using != to compare to None
Diffstat (limited to 'modules')
-rw-r--r-- | modules/sd_models.py | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/modules/sd_models.py b/modules/sd_models.py index 4c06051e..0a55b4c3 100644 --- a/modules/sd_models.py +++ b/modules/sd_models.py @@ -152,15 +152,12 @@ def load_model_weights(model, checkpoint_info): devices.dtype_vae = torch.float32 if shared.cmd_opts.no_half or shared.cmd_opts.no_half_vae else torch.float16
vae_file = os.path.splitext(checkpoint_file)[0] + ".vae.pt"
- if os.path.exists(vae_file):
- print(f"Found VAE Weights: {vae_file}")
- elif shared.cmd_opts.vae_path != None:
+
+ if not os.path.exists(vae_file) and shared.cmd_opts.vae_path is not None:
vae_file = shared.cmd_opts.vae_path
- print(f'No VAE found for inside the model folder. Using CLI specified : {vae_file}')
- else:
- print("No VAE found for inside the model folder. Passing.")
if os.path.exists(vae_file):
+ print(f"Loading VAE weights from: {vae_file}")
vae_ckpt = torch.load(vae_file, map_location="cpu")
vae_dict = {k: v for k, v in vae_ckpt["state_dict"].items() if k[0:4] != "loss"}
|