Skip to content

Instantly share code, notes, and snippets.

View welel's full-sized avatar
:octocat:
Hi

Pavel Loginov welel

:octocat:
Hi
  • Saint-Petersburg
View GitHub Profile
@Pyr-000
Pyr-000 / $README.md
Last active October 1, 2024 16:12
Convert original Stable Diffusion checkpoints and safetensors to diffusers

Stable Diffusion model conversion script

Convert from the 'original implementation' to Huggingface diffusers. Both .safetensors and .ckpt checkpoints are supported.

The script is adapted from the diffusers conversion script: https://github.com/huggingface/diffusers/blob/main/scripts/convert_original_stable_diffusion_to_diffusers.py

Usage:

python enhanced_convert_original_stable_diffusion_to_diffusers.py --checkpoint_path "<input_model_filepath>" --dump_path "<output_directory_path>" --extract_ema

For inference use, extracting with --extract_ema is usually recommended. This will be ignored if the source model does not contain both EMA and non-EMA weights.