Skip to content

Commit

Permalink
fix(api): allow all supported tensors extensions for VAE files
Browse files Browse the repository at this point in the history
  • Loading branch information
ssube committed Nov 9, 2023
1 parent 5951519 commit f4f3bda
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions api/onnx_web/convert/diffusion/diffusion.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
from ...diffusers.version_safe_diffusers import AttnProcessor
from ...models.cnet import UNet2DConditionModel_CNet
from ...utils import run_gc
from ..utils import ConversionContext, is_torch_2_0, load_tensor, onnx_export
from ..utils import RESOLVE_FORMATS, ConversionContext, check_ext, is_torch_2_0, load_tensor, onnx_export
from .checkpoint import convert_extract_checkpoint

logger = getLogger(__name__)
Expand Down Expand Up @@ -375,7 +375,7 @@ def convert_diffusion_diffusers(

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

0 comments on commit f4f3bda

Please sign in to comment.