Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improper variable name in convert_original_stable_diffusion_to_diffusers.py: rename variable #10757

Open
ramenspazz opened this issue Feb 10, 2025 · 1 comment
Labels
bug Something isn't working

Comments

@ramenspazz
Copy link

ramenspazz commented Feb 10, 2025

Describe the bug

The function signature for download_from_original_stable_diffusion_ckpt shows that it accepts the argument checkpoint_path_or_dict, as shown in the function definition:

def download_from_original_stable_diffusion_ckpt(
    checkpoint_path_or_dict: str | Dict[str, Tensor],
    original_config_file: str = None,
    image_size: int | None = None,
# snip...

,The variable, checkpoint_path, assigned to by args.checkpoint_path in the function call:

pipe = download_from_original_stable_diffusion_ckpt(
        checkpoint_path=args.checkpoint_path,
        original_config_file=args.original_config_file,
        image_size=args.image_size,
# snip...

Should be changed to:

pipe = download_from_original_stable_diffusion_ckpt(
        checkpoint_path_or_dict=args.checkpoint_path,
        original_config_file=args.original_config_file,
        image_size=args.image_size,
# snip...

The script file works correctly with these changes.

Reproduction

  1. download script (on the date 9FEB2025): wget https://raw.githubusercontent.com/huggingface/diffusers/v0.20.0/scripts/convert_original_stable_diffusion_to_diffusers.py
  2. run script on safetensor file: python convert_original_stable_diffusion_to_diffusers.py --checkpoint_path model.safetensors --dump_path ~/ --from_safetensors
    result:
Traceback (most recent call last):
  File "/home/user/path/to/script/convert_original_stable_diffusion_to_diffusers.py", line 154, in <module>
    pipe = download_from_original_stable_diffusion_ckpt(
        checkpoint_path=args.checkpoint_path,
    ...<15 lines>...
        pipeline_class=pipeline_class,
    )
TypeError: download_from_original_stable_diffusion_ckpt() got an unexpected keyword argument 'checkpoint_path'

Logs

System Info

  • 🤗 Diffusers version: 0.32.2
  • Platform: Linux-6.12.11-200.fc41.x86_64-x86_64-with-glibc2.40
  • Running on Google Colab?: No
  • Python version: 3.13.1
  • PyTorch version (GPU?): 2.6.0+cu124 (False)
  • Flax version (CPU?/GPU?/TPU?): not installed (NA)
  • Jax version: not installed
  • JaxLib version: not installed
  • Huggingface_hub version: 0.28.1
  • Transformers version: 4.48.3
  • Accelerate version: 1.3.0
  • PEFT version: not installed
  • Bitsandbytes version: not installed
  • Safetensors version: 0.5.2
  • xFormers version: not installed
  • Accelerator: NA

Who can help?

No response

@ramenspazz ramenspazz added the bug Something isn't working label Feb 10, 2025
@hlky
Copy link
Collaborator

hlky commented Feb 10, 2025

Hi @ramenspazz. This was fixed in 0.21 and the script has since been refactored.

Try main

https://raw.githubusercontent.com/huggingface/diffusers/refs/heads/main/scripts/convert_original_stable_diffusion_to_diffusers.py

or a newer tag

https://raw.githubusercontent.com/huggingface/diffusers/v0.32.2/scripts/convert_original_stable_diffusion_to_diffusers.py

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants