huggingface / huggingface/diffusers

Improper variable name in convert_original_stable_diffusion_to_diffusers.py: rename variable

Open
#10,757 2 comments 0 reactions 0 assignees View on GitHub
bug stale
Dominant language
Python
Stars
34.5k
Forks
7.3k
Avg merge
3d 3h
Merged PRs (30d)
91

Description

### 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:
```py
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:
```py
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:
```py
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:

```txt
Traceback (most recent call last):
File "/home/user/path/to/script/convert_original_stable_diffusion_to_diffusers.py", line 154, in
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

```shell

```

### 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_

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.