aboutsummaryrefslogtreecommitdiffstats
path: root/modules/sd_vae.py
diff options
context:
space:
mode:
authorMuhammad Rizqi Nur <rizqinur2010@gmail.com>2022-10-31 08:19:34 +0000
committerMuhammad Rizqi Nur <rizqinur2010@gmail.com>2022-10-31 08:22:03 +0000
commit726769da35970f4c100fa7edf11850f9dc059c41 (patch)
treefc9c2d5d714b73f41cd9a0dd8b6258cf48bc8046 /modules/sd_vae.py
parentb96d0c4e9ecec3c856b9b4ec795dbd0d34fcac51 (diff)
downloadstable-diffusion-webui-gfx803-726769da35970f4c100fa7edf11850f9dc059c41.tar.gz
stable-diffusion-webui-gfx803-726769da35970f4c100fa7edf11850f9dc059c41.tar.bz2
stable-diffusion-webui-gfx803-726769da35970f4c100fa7edf11850f9dc059c41.zip
Checkpoint cache by combination key of checkpoint and vae
Diffstat (limited to 'modules/sd_vae.py')
-rw-r--r--modules/sd_vae.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/modules/sd_vae.py b/modules/sd_vae.py
index 2ce44d5f..e9239326 100644
--- a/modules/sd_vae.py
+++ b/modules/sd_vae.py
@@ -43,7 +43,7 @@ def refresh_vae_list(vae_path=vae_path, model_path=model_path):
vae_dict.update(res)
return vae_list
-def load_vae(model, checkpoint_file, vae_file="auto"):
+def resolve_vae(checkpoint_file, vae_file="auto"):
global first_load, vae_dict, vae_list
# save_settings = False
@@ -94,6 +94,12 @@ def load_vae(model, checkpoint_file, vae_file="auto"):
if vae_file and not os.path.exists(vae_file):
vae_file = None
+ return vae_file
+
+def load_vae(model, vae_file):
+ global first_load, vae_dict, vae_list
+ # save_settings = False
+
if vae_file:
print(f"Loading VAE weights from: {vae_file}")
vae_ckpt = torch.load(vae_file, map_location=shared.weight_load_location)