huggingface / huggingface/diffusers
from_pretrained fails loading deprecated pipelines
- Lingua principale
- Python
- Stelle
- 34.5k
- Fork
- 7.3k
- Merge medio
- 3g 3h
- PR unite (30g)
- 91
Descrizione
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
Guida per i contributori
Apri la guida per i contributori
Direzione di ricerca
Inizia in src/diffusers/pipelines/pipeline_loading_utils.py, in _get_custom_components_and_folders, quindi riproduci il problema con DiffusionPipeline.from_pretrained("warp-ai/wuerstchen-prior"). Confronta la ricerca esistente in diffusers.pipelines con la posizione del modulo deprecato descritta nell’issue. Il lavoro è completato quando la pipeline Wuerstchen deprecata viene caricata invece di generare il ValueError relativo al modulo mancante.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- python
- Ambito
- machine-learning
- Tipo di issue
- Bug
- Difficoltà
- 2/5
- Tempo stimato
- 1-3 ore
- Stato di attività
- Tranquilla
- Chiarezza
- Specificata chiaramente
- Idoneità per principianti
- 72/100