mirror of
https://github.com/vladmandic/automatic
synced 2026-09-20 01:31:13 +02:00
Update sd_vae.py
Removed pathlib, but had to retain '+ ".vae.pt"' etc, otherwise it was adding a separator between the filename and the extension
This commit is contained in:
+1
-2
@@ -5,7 +5,6 @@ from copy import deepcopy
|
||||
from rich import print # pylint: disable=redefined-builtin
|
||||
import torch
|
||||
from modules import paths, shared, devices, script_callbacks, sd_models
|
||||
from pathlib import Path
|
||||
|
||||
|
||||
vae_ignore_keys = {"model_ema.decay", "model_ema.num_updates"}
|
||||
@@ -103,7 +102,7 @@ def resolve_vae(checkpoint_file):
|
||||
return vae_near_checkpoint, 'found near the checkpoint'
|
||||
|
||||
if is_automatic:
|
||||
for named_vae_location in [vae_path + os.sep + Path(checkpoint_file).stem + ".vae.pt", vae_path + os.sep + Path(checkpoint_file).stem + ".vae.ckpt", vae_path + os.sep + Path(checkpoint_file).stem + ".vae.safetensors"]:
|
||||
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")]:
|
||||
if os.path.isfile(named_vae_location):
|
||||
print(named_vae_location+' found in VAE dir')
|
||||
return named_vae_location, ' found in VAE dir'
|
||||
|
||||
Reference in New Issue
Block a user