Skip to content

from_pretrained fails loading deprecated pipelines #14008

@dxqb

Description

@dxqb

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: 0f1abc4 (main)
  • Python: 3.12
  • Platform: Linux

Who can help?

@yiyixuxu @stevhliu


Drafted by Claude

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions