StableDiffusionXLPipeline.from_pretrained use_safetensors=True is downloading onnx models

#28
by Vargol - opened

Why is
pipe = StableDiffusionXLPipeline.from_pretrained(
"stabilityai/stable-diffusion-xl-base-1.0", torch_dtype=torch.float16, variant="fp16", use_safetensors=True
)

Downloaded onnx models and not safetensors ?

(apple_sd) Vargol:MacMiniM18Gb apple_sd % python x2.py
Downloading model.onnx: 100%|β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ| 1.04M/1.04M [00:00<00:00, 8.67MB/s]
Downloading (…)_encoder/config.json: 100%|β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ| 767/767 [00:00<00:00, 2.03MB/s]
Downloading model.onnx: 100%|β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ| 7.29M/7.29M [00:01<00:00, 5.66MB/s]
Downloading model.onnx: 100%|β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ| 137M/137M [00:12<00:00, 10.6MB/s]
Downloading model.onnx: 100%|β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ| 198M/198M [00:14<00:00, 13.7MB/s]
Downloading model.onnx: 32%|β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–‹ | 157M/493M [00:14<00:30, 10.8MB/s^Fetching 25 files: 16%|β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–Š | 4/25 [00:18<01:36, 4.60s/it]
Downloading model.onnx: 100%|β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ| 198M/198M [00:14<00:00, 17.7MB/s^CTraceback (most recent call last):β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ | 262M/493M [00:18<00:07, 32.1MB/s]

I'm assuming the change to add then has messed something up

Vargol changed discussion title from StableDiffusionXLPipeline.from_pretrained use_safetensors=True is downloading onyx models to StableDiffusionXLPipeline.from_pretrained use_safetensors=True is downloading onnx models

Thanks a lot for the issue! It'll be fixed here: https://github.com/huggingface/diffusers/pull/4338 and we'll make another patch release 0.19.2 in ~4 hours.

On the bright side, only the small ONNX models are downloaded (<500MB of weights).

Thanks Patrick , I look forward to the release

Sign up or log in to comment