1
0
Fork 0

fix(api): resolve XL VAE within model folder

This commit is contained in:
Sean Sube 2023-09-11 20:21:43 -05:00
parent 6fb0366f52
commit cf2cf51b17
Signed by: ssube
GPG Key ID: 3EED7B957D362AF1
1 changed files with 3 additions and 2 deletions

View File

@ -62,10 +62,11 @@ def convert_diffusion_diffusers_xl(
pipeline = StableDiffusionXLPipeline.from_pretrained(source) pipeline = StableDiffusionXLPipeline.from_pretrained(source)
if replace_vae is not None: if replace_vae is not None:
vae_path = path.join(conversion.model_path, replace_vae)
if replace_vae.endswith(".safetensors"): if replace_vae.endswith(".safetensors"):
pipeline.vae = AutoencoderKL.from_single_file(replace_vae) pipeline.vae = AutoencoderKL.from_single_file(vae_path)
else: else:
pipeline.vae = AutoencoderKL.from_pretrained(replace_vae) pipeline.vae = AutoencoderKL.from_pretrained(vae_path)
pipeline.save_pretrained(temp_path) pipeline.save_pretrained(temp_path)