huggingface / huggingface/diffusers

from_pretrained fails loading deprecated pipelines

Open Beginner friendly
#14,008 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
34.5k
Forks
7.3k
Avg merge
3d 3h
Merged PRs (30d)
91

Description

Note: I understand these pipelines are deprecated and bugfixes aren't accepted anymore. But this seems to be a bug in _the process of moving pipelines to deprecated itself_

### Describe the bug

`_get_custom_components_and_folders` (`src/diffusers/pipelines/pipeline_loading_utils.py`) resolves custom pipeline components by checking `hasattr(diffusers.pipelines, module_candidate)`. Since #13157 moved several pipelines (e.g. Wuerstchen) to `diffusers.pipelines.deprecated.`, that check no longer finds them, even though the relocated module still exists.

### Reproduction

```python
from diffusers import DiffusionPipeline
DiffusionPipeline.from_pretrained("warp-ai/wuerstchen-prior")
```
```
ValueError: prior/wuerstchen.py as defined in `model_index.json` does not exist in warp-ai/wuerstchen-prior and is not a module in 'diffusers/pipelines'.
```

`model_index.json` declares `"prior": ["wuerstchen", "WuerstchenPrior"]`. `hasattr(diffusers.pipelines, "wuerstchen")` is `False`, but `hasattr(diffusers.pipelines.deprecated, "wuerstchen")` is `True` — confirming the module just moved out from under the check.

**Suggested fix:** have `_get_custom_components_and_folders` also check `diffusers.pipelines.deprecated` before raising.

### System Info

- diffusers commit: 0f1abc4ae8b0eb2a3b40e82a310507281144c423 (main)
- Python: 3.12
- Platform: Linux

### Who can help?
@yiyixuxu @stevhliu

---
Drafted by Claude

Contributor guide

Open the contributing guide

Research direction

Start in src/diffusers/pipelines/pipeline_loading_utils.py at _get_custom_components_and_folders, then reproduce with DiffusionPipeline.from_pretrained("warp-ai/wuerstchen-prior"). Compare the existing diffusers.pipelines lookup with the deprecated module location described in the issue. Done means the deprecated Wuerstchen pipeline loads instead of raising the missing-module ValueError.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
machine-learning
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Quiet
Clarity
Clearly specified
Newbie friendliness
72/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.