Skip to content

Commit

Permalink
fix(api): resolve XL VAE within model folder
Browse files Browse the repository at this point in the history
  • Loading branch information
ssube committed Sep 12, 2023
1 parent 6fb0366 commit cf2cf51
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions api/onnx_web/convert/diffusion/diffusion_xl.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,11 @@ def convert_diffusion_diffusers_xl(
pipeline = StableDiffusionXLPipeline.from_pretrained(source)

if replace_vae is not None:
vae_path = path.join(conversion.model_path, replace_vae)
if replace_vae.endswith(".safetensors"):
pipeline.vae = AutoencoderKL.from_single_file(replace_vae)
pipeline.vae = AutoencoderKL.from_single_file(vae_path)
else:
pipeline.vae = AutoencoderKL.from_pretrained(replace_vae)
pipeline.vae = AutoencoderKL.from_pretrained(vae_path)

pipeline.save_pretrained(temp_path)

Expand Down

0 comments on commit cf2cf51

Please sign in to comment.