Skip to content

Title: ModuleNotFoundError: Could not import module ‘CLIPTextModel’ in diffusers 0.36.0 + transformers 4.57.0 #12580

@xxxzzz200

Description

@xxxzzz200

I’m encountering the following error when using diffusers version 0.36.0 together with transformers version 4.57.0:

File "//diffusers/src/diffusers/pipelines/stable_diffusion/pipeline_stable_diffusion.py", line 19, in
from transformers import CLIPImageProcessor, CLIPTextModel, CLIPTokenizer, CLIPVisionModelWithProjection
File "/usr/local/lib/python3.10/site-packages/transformers/utils/import_utils.py", line 2320, in getattr
raise ModuleNotFoundError(
ModuleNotFoundError: Could not import module 'CLIPTextModel'. Are this object's requirements defined c

Working scenario:
When I downgrade transformers to 4.51.3 (while keeping diffusers 0.36.0), the import succeeds and the pipeline loads without error.

Environment details:

Python: 3.10.12
torch:2.4.0+cu121
diffusers: 0.36.0
transformers: 4.57.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions