fix(api): correct VAE extension check during conversion
This commit is contained in:
parent
293a1bb184
commit
4fd50984f0
|
@ -381,7 +381,8 @@ def convert_diffusion_diffusers(
|
||||||
|
|
||||||
if replace_vae is not None:
|
if replace_vae is not None:
|
||||||
vae_path = path.join(conversion.model_path, replace_vae)
|
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)
|
pipeline.vae = AutoencoderKL.from_single_file(vae_path)
|
||||||
else:
|
else:
|
||||||
pipeline.vae = AutoencoderKL.from_pretrained(vae_path)
|
pipeline.vae = AutoencoderKL.from_pretrained(vae_path)
|
||||||
|
|
|
@ -64,7 +64,8 @@ def convert_diffusion_diffusers_xl(
|
||||||
|
|
||||||
if replace_vae is not None:
|
if replace_vae is not None:
|
||||||
vae_path = path.join(conversion.model_path, replace_vae)
|
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)
|
logger.debug("loading VAE from single tensor file: %s", vae_path)
|
||||||
pipeline.vae = AutoencoderKL.from_single_file(vae_path)
|
pipeline.vae = AutoencoderKL.from_single_file(vae_path)
|
||||||
else:
|
else:
|
||||||
|
|
Loading…
Reference in New Issue