diffusers icon indicating copy to clipboard operation
diffusers copied to clipboard

from_pretrained fails loading deprecated pipelines

Open dxqb opened this issue 5 months ago • 1 comments

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.<name>, that check no longer finds them, even though the relocated module still exists.

Reproduction

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

dxqb avatar Jun 20 '26 11:06 dxqb

I have a small fix for this. It looks like a bug in the deprecation mechanism: pipelines relocated under diffusers.pipelines.deprecated are not recognized by the loader, so from_pretrained wrongly treats them as a missing custom module. Opening a PR now with a regression test.

Nas01010101 avatar Jun 21 '26 15:06 Nas01010101