aboutsummaryrefslogtreecommitdiff
path: root/modules/sd_vae.py
diff options
context:
space:
mode:
authorMuhammad Rizqi Nur <rizqinur2010@gmail.com>2022-11-13 10:55:47 +0700
committerMuhammad Rizqi Nur <rizqinur2010@gmail.com>2022-11-19 12:01:41 +0700
commit2c5ca706a7e624d268545ba3318ba230b7b33477 (patch)
treeca0041601d18dbd4229ead6fcdaa86da595cac49 /modules/sd_vae.py
parente5690d0bf2da1f0719ca581cd2e797e9b74db67e (diff)
Remove no longer necessary parts and add vae_file safeguard
Diffstat (limited to 'modules/sd_vae.py')
-rw-r--r--modules/sd_vae.py1
1 files changed, 1 insertions, 0 deletions
diff --git a/modules/sd_vae.py b/modules/sd_vae.py
index 71e7a6e6..8bdb2c17 100644
--- a/modules/sd_vae.py
+++ b/modules/sd_vae.py
@@ -139,6 +139,7 @@ def load_vae(model, vae_file=None):
# save_settings = False
if vae_file:
+ assert os.path.isfile(vae_file), f"VAE file doesn't exist: {vae_file}"
print(f"Loading VAE weights from: {vae_file}")
vae_ckpt = torch.load(vae_file, map_location=shared.weight_load_location)
vae_dict_1 = {k: v for k, v in vae_ckpt["state_dict"].items() if k[0:4] != "loss" and k not in vae_ignore_keys}