ai-toolkit icon indicating copy to clipboard operation
ai-toolkit copied to clipboard

Win11: diffusers library not working, throws error: "ImportError: cannot import name 'apply_rope' from 'diffusers.models.attention_processor'"

Open ewandel opened this issue 6 months ago • 1 comments

This is for bugs only

Did you already ask in the discord?

No, because I found a fix myself but others might find this helpful

You verified that this is a bug and not a feature request or question by asking in the discord?

Yes

Describe the bug

I installed on Win11 using the installer on 22 August 2022. However, starting after following the tutorial failed with error message:

File "[...]ai-toolkit\toolkit\ip_adapter.py", line 8, in from diffusers.models.attention_processor import apply_rope ImportError: cannot import name 'apply_rope' from 'diffusers.models.attention_processor'

pip show diffusers output: Name: diffusers Version: 0.31.0.dev0 Summary: State-of-the-art diffusion in PyTorch and JAX. Home-page: https://github.com/huggingface/diffusers Author: The Hugging Face team (past and future) with the help of all our contributors (https://github.com/huggingface/diffusers/graphs/contributors) Author-email: [email protected] License: Apache 2.0 License Location: f:\ostris\ai-toolkit\venv\lib\site-packages Requires: filelock, huggingface-hub, importlib-metadata, numpy, Pillow, regex, requests, safetensors Required-by: lycoris-lora

If I go back to the previous stable version, everthing appears to be working. Command used: python -m pip install diffusers==0.30.0

Suggested fix: Change line 4 in requirements.txt from: "git+https://github.com/huggingface/diffusers.git" to: "diffusers==0.30.0"

ewandel avatar Aug 22 '24 15:08 ewandel