aboutsummaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authorAUTOMATIC1111 <16777216c@gmail.com>2023-05-14 11:46:36 +0300
committerGitHub <noreply@github.com>2023-05-14 11:46:36 +0300
commit5f5435eb1aafbd2dfda3e00024d8528addd17e03 (patch)
treee206ee60f9be21e9e20d483213b7d0a610d2bdbd /modules
parent3ddc76342298ad0b2d14cb571ceb48c0b0c4176d (diff)
parent80adb6979d46bbb832254004cac4f4f9bec9efb3 (diff)
Merge pull request #10218 from micky2be/find_vae
Files in vae folder with same name as a checkpoint can be found too
Diffstat (limited to 'modules')
-rw-r--r--modules/sd_vae.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/modules/sd_vae.py b/modules/sd_vae.py
index b7176125..e4ff2994 100644
--- a/modules/sd_vae.py
+++ b/modules/sd_vae.py
@@ -85,10 +85,10 @@ def refresh_vae_list():
def find_vae_near_checkpoint(checkpoint_file):
- checkpoint_path = os.path.splitext(checkpoint_file)[0]
- for vae_location in [f"{checkpoint_path}.vae.pt", f"{checkpoint_path}.vae.ckpt", f"{checkpoint_path}.vae.safetensors"]:
- if os.path.isfile(vae_location):
- return vae_location
+ checkpoint_path = os.path.basename(checkpoint_file).rsplit('.', 1)[0]
+ for vae_file in vae_dict.values():
+ if os.path.basename(vae_file).startswith(checkpoint_path):
+ return vae_file
return None