Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ImportError: cannot import name 'CrossAttention' from 'diffusers.models.attention' #32

Open
wangzhen-ing opened this issue Aug 27, 2023 · 6 comments

Comments

@wangzhen-ing
Copy link

when I run this program“edit_real”, I met question:
ImportError: cannot import name 'CrossAttention' from 'diffusers.models.attention'
how to solve this question

@SiBensberg
Copy link

SiBensberg commented Aug 29, 2023

Had the same problem. Downgrading diffusers to version 0.14 did the trick:
python -m pip install diffusers==0.14.0

Maybe they moved the cross attention module.

@wangzhen-ing
Copy link
Author

Had the same problem. Downgrading diffusers to version 0.14 did the trick: python -m pip install diffusers==0.14.0

Maybe they moved the cross attention module.

thank you very much!

@wangzhen-ing
Copy link
Author

wangzhen-ing commented Sep 4, 2023 via email

@ty625911724
Copy link

I try python version 3.8, diffusers==0.12.0 spacy==3.4.4 Pydantic==1.10.8. Maybe it could be helpful.

@SiBensberg
Copy link

SiBensberg commented Sep 6, 2023

Hi @wangzhen-ing,
with the versions @ty625911724 mentioned, it is working for me.

@BadourAlBahar
Copy link

It looks like they changed the name of CrossAttention to Attention. Not sure if these are the only changes but so far you need to fix the following:
from diffusers.models.attention import Attention as CrossAttention
module_name == "Attention"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants