huggingface / diffusers

🤗 Diffusers: State-of-the-art diffusion models for image and audio generation in PyTorch and FLAX.
https://huggingface.co/docs/diffusers
Apache License 2.0
26.15k stars 5.39k forks source link

diffusers/scripts/convert_diffusers_to_original_sdxl.py doesn't support models with variant = "fp16" #8974

Open jslegers opened 3 months ago

jslegers commented 3 months ago

Describe the bug

In an SDXL model, several of the components are stored as model.fp16.safetensors rather than model.safetensors.

The import script seems to always expect model.safetensors and thus produces an error when trying to convert a model with components in format model.fp16.safetensors.

Reproduction

#@title Convert to checkpoint
%cd /content
input_path = "/path/to/model_to_convert"
output_path = "/path/to/model_to_save.ckpt"
!python convert_diffusers_to_original_sdxl.py \
  --model_path {input_path} --half --checkpoint_path {output_path}
jslegers commented 3 months ago

Related to #8805

github-actions[bot] commented 1 month ago

This issue has been automatically marked as stale because it has not had recent activity. If you think this still needs to be addressed please comment on this thread.

Please note that issues that do not follow the contributing guidelines are likely to be ignored.