use_safetensors parameter not passed to submodules when loading pipeline · Issue #9576 · huggingface/diffusers (original) (raw)

Skip to content

Provide feedback

Saved searches

Use saved searches to filter your results more quickly

Sign up

@elismasilva

Description

@elismasilva

Describe the bug

When a model is loading from_pretrained, if the model is .bin and not .safetensors i got warnings like

"An error occurred while trying to fetch models/stablediffusionapi/yamermix-v8-vae: Error no file named diffusion_pytorch_model.safetensors found in directory models/stablediffusionapi/yamermix-v8-vae.
Defaulting to unsafe serialization. Pass allow_pickle=False to raise an error instead"

But is expected if i pass use_safetensors=False to supress this warning.

So i notice that after this line is need to pass

cached_folder=cached_folder,

use_safetensors variable

And after this line repass the parameter

loading_kwargs["variant"] = model_variants.pop(name, None)

Reproduction

from diffusers import StableDiffusionXLPipeline import torch pipe = StableDiffusionXLPipeline.from_pretrained('stablediffusionapi/yamermix-v8-vae', torch_dtype=torch.float16)

Logs

No response

System Info

Who can help?

No response