huggingface / huggingface/diffusers

from_pretrained fails loading deprecated pipelines

Offen Anfängerfreundlich
#14,008 1 Kommentar 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
Vorherrschende Sprache
Python
Sterne
34.5k
Forks
7.3k
Ø Merge
3 T. 3 Std.
Gemergte PRs (30 T.)
91

Beschreibung

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

Beitragsleitfaden

Beitragsleitfaden öffnen

Rechercherichtung

Beginne in src/diffusers/pipelines/pipeline_loading_utils.py bei _get_custom_components_and_folders und reproduziere das Problem anschließend mit DiffusionPipeline.from_pretrained("warp-ai/wuerstchen-prior"). Vergleiche die bestehende Suche in diffusers.pipelines mit dem im Issue beschriebenen veralteten Modulpfad. Die Aufgabe ist erledigt, wenn die veraltete Wuerstchen-Pipeline geladen wird, anstatt den ValueError wegen des fehlenden Moduls auszulösen.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
python
Bereich
machine-learning
Issue-Typ
Bug
Schwierigkeit
2/5
Geschätzter Aufwand
1-3 Stunden
Aktivitätsstatus
Ruhig
Klarheit
Klar beschrieben
Anfängerfreundlichkeit
72/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.