aboutsummaryrefslogtreecommitdiff
path: root/modules/sd_models.py
diff options
context:
space:
mode:
authorAUTOMATIC1111 <16777216c@gmail.com>2022-10-10 20:45:14 +0300
committerGitHub <noreply@github.com>2022-10-10 20:45:14 +0300
commitb3d3b335cf5fb6904d12af16b6a1cedab1c5106f (patch)
treecb3e7c39936dae5357ed355605d26b2c8e29c6e5 /modules/sd_models.py
parent39919c40dd18f5a14ae21403efea1b0f819756c7 (diff)
parentaf62ad4d25dcd0454944368f4925d83101cdedbc (diff)
Merge pull request #2131 from ssysm/upstream-master
Add VAE Path Arguments
Diffstat (limited to 'modules/sd_models.py')
-rw-r--r--modules/sd_models.py9
1 files changed, 8 insertions, 1 deletions
diff --git a/modules/sd_models.py b/modules/sd_models.py
index 2cdcd84f..4c06051e 100644
--- a/modules/sd_models.py
+++ b/modules/sd_models.py
@@ -153,7 +153,14 @@ def load_model_weights(model, checkpoint_info):
vae_file = os.path.splitext(checkpoint_file)[0] + ".vae.pt"
if os.path.exists(vae_file):
- print(f"Loading VAE weights from: {vae_file}")
+ print(f"Found VAE Weights: {vae_file}")
+ elif shared.cmd_opts.vae_path != 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):
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"}