1
0
Fork 0

fix(api): correct VAE extension check during conversion

This commit is contained in:
Sean Sube 2023-12-08 22:55:51 -06:00
parent 293a1bb184
commit 4fd50984f0
Signed by: ssube
GPG Key ID: 3EED7B957D362AF1
2 changed files with 4 additions and 2 deletions

View File

@ -381,7 +381,8 @@ def convert_diffusion_diffusers(
if replace_vae is not None:
vae_path = path.join(conversion.model_path, replace_vae)
if check_ext(replace_vae, RESOLVE_FORMATS):
vae_file = check_ext(replace_vae, RESOLVE_FORMATS)
if vae_file[0]:
pipeline.vae = AutoencoderKL.from_single_file(vae_path)
else:
pipeline.vae = AutoencoderKL.from_pretrained(vae_path)

View File

@ -64,7 +64,8 @@ def convert_diffusion_diffusers_xl(
if replace_vae is not None:
vae_path = path.join(conversion.model_path, replace_vae)
if check_ext(vae_path, RESOLVE_FORMATS):
vae_file = check_ext(vae_path, RESOLVE_FORMATS)
if vae_file[0]:
logger.debug("loading VAE from single tensor file: %s", vae_path)
pipeline.vae = AutoencoderKL.from_single_file(vae_path)
else: