Skip to content

ImportError: cannot import name 'CogView4LoraLoaderMixin' from 'diffusers.loaders' #11218

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

Open
godwenbin opened this issue Apr 7, 2025 · 2 comments
Labels
bug Something isn't working

Comments

@godwenbin
Copy link

Describe the bug

Traceback (most recent call last):
File "/root/mambaforge/envs/gwb_kohya/bin/cogkit", line 5, in
from cogkit.cli import cli
File "/root/mambaforge/envs/gwb_kohya/lib/python3.10/site-packages/cogkit/init.py", line 4, in
from cogkit.python import generate_image, generate_video
File "/root/mambaforge/envs/gwb_kohya/lib/python3.10/site-packages/cogkit/python/init.py", line 4, in
from .generation.image import generate_image
File "/root/mambaforge/envs/gwb_kohya/lib/python3.10/site-packages/cogkit/python/generation/image.py", line 11, in
from cogkit.utils import (
File "/root/mambaforge/envs/gwb_kohya/lib/python3.10/site-packages/cogkit/utils/init.py", line 6, in
from cogkit.utils.lora import load_lora_checkpoint, unload_lora_checkpoint
File "/root/mambaforge/envs/gwb_kohya/lib/python3.10/site-packages/cogkit/utils/lora.py", line 4, in
from diffusers.loaders import CogVideoXLoraLoaderMixin, CogView4LoraLoaderMixin
ImportError: cannot import name 'CogView4LoraLoaderMixin' from 'diffusers.loaders' (/root/mambaforge/envs/gwb_kohya/lib/python3.10/site-packages/diffusers/loaders/init.py)

Reproduction

1

Logs

System Info

diffusers 0.33.0.dev0
linux
python 3.10.14

Who can help?

No response

@godwenbin godwenbin added the bug Something isn't working label Apr 7, 2025
@yiyixuxu
Copy link
Collaborator

yiyixuxu commented Apr 7, 2025

hi @godwenbin
thank for reporting the issue
i cannot reproduce from my end, can you run this directly with diffusers?

from diffusers.loaders import CogVideoXLoraLoaderMixin, CogView4LoraLoaderMixin

@hlky
Copy link
Contributor

hlky commented Apr 10, 2025

Hi @godwenbin. It looks like you are reusing a venv from kohya, gwb_kohya, when installing cogkit it's possible the venv didn't update diffusers as it was already installed. Can we double check the installed version, look for __version__ in /root/mambaforge/envs/gwb_kohya/lib/python3.10/site-packages/diffusers/__init__.py. If possible, try cogkit in a fresh venv, or reinstall diffusers in the existing venv with pip install -U git+https://github.com/huggingface/diffusers.git

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants