match vae file

This commit is contained in:
Vladimir Mandic
2023-05-18 19:09:34 -04:00
parent f14857fe0b
commit 1c70056744
+8 -1
View File
@@ -96,7 +96,14 @@ def resolve_vae(checkpoint_file):
if vae_near_checkpoint is not None and (shared.opts.sd_vae_as_default):
return vae_near_checkpoint, 'near checkpoint'
if is_automatic:
for named_vae_location in [os.path.join(vae_path, os.path.splitext(os.path.basename(checkpoint_file))[0] + ".vae.pt"), os.path.join(vae_path, os.path.splitext(os.path.basename(checkpoint_file))[0] + ".vae.ckpt"), os.path.join(vae_path, os.path.splitext(os.path.basename(checkpoint_file))[0] + ".vae.safetensors")]:
for named_vae_location in [
os.path.join(vae_path, os.path.splitext(os.path.basename(checkpoint_file))[0] + ".pt"),
os.path.join(vae_path, os.path.splitext(os.path.basename(checkpoint_file))[0] + ".ckpt"),
os.path.join(vae_path, os.path.splitext(os.path.basename(checkpoint_file))[0] + ".safetensors"),
os.path.join(vae_path, os.path.splitext(os.path.basename(checkpoint_file))[0] + ".vae.pt"),
os.path.join(vae_path, os.path.splitext(os.path.basename(checkpoint_file))[0] + ".vae.ckpt"),
os.path.join(vae_path, os.path.splitext(os.path.basename(checkpoint_file))[0] + ".vae.safetensors"),
]:
if os.path.isfile(named_vae_location):
return named_vae_location, 'in VAE dir'
if shared.opts.sd_vae == "None":