v7 doesn't work with kohya scripts - how to revert to v6

#46
by adolha - opened

Hello,

I was using the model with kohya's scripts:
python gen_img_diffusers.py --ckpt Lykon/DreamShaper ...
Everything worked fine until it downloaded v7 a couple days ago. Now I get the error:
sd-scripts/venv/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1614, in getattr
raise AttributeError("'{}' object has no attribute '{}'".format(
AttributeError: 'AttentionBlock' object has no attribute 'to_q'
Any idea how to fix it? Or is there a way to revert to v6 or lock the version?

Thanks,
Adrian

adolha changed discussion title from v7 doesn't work with kohl scripts - how to revert to v6 to v7 doesn't work with kohya scripts - how to revert to v6

Are you training a Lora or just genning with it?
oO; training a lora shuoldn't need to get the diffusers option lol

Thanks for the comment. Tried both training and genning, none is working. It throws the same error in both cases.

Are you not using the safetensors file? XD

I’m using the modelId, the scripts do the rest. I’m wondering though what could be different between v6 and v7? What changed and could cause the above error?

You could literally just download v6?

@adolha did you solve your problem?

In the end, I could just download v6, of course, but I'd really prefer to use the model id and I'd still want to upgrade to v7.
@Lykon I haven't solved my problem yet. Hoped I'd get some answers here before I start digging more into it. :)
Looks like the scripts don't work with v7, thought you might recognize what's changed between versions and what could cause the error.

so to get this straight, you're having problems with v7 diffusers, right? Not safetensors.

yes, that's right. I'm using https://github.com/kohya-ss/sd-scripts/blob/main/docs/gen_img_README-ja.md to generate images. I'm passing the model id in the scripts command: python gen_img_diffusers.py --ckpt Lykon/DreamShaper and get into the error mentioned above.
Same error when trying to train LoRA.

That's odd, so you're just generating. I've seen people using v7 diffusers and I've also tested them myself. Quick question: have you tried downloading diffusers from civitai?
I'll try to reupload them to huggingface, because they do work locally. Also have you tried to just redownload them? Maybe your files just got corrupted.

There is also the fact that generation services such as sinkin.ai and mage.space are using v7 diffusers right now.

I don't think the files are corrupted, because the error reproduces on different environments. Maybe it requires a newer version of diffusers or xformers? I currently have the following versions installed:
diffusers==0.10.2
xformers==0.0.20
torch==2.0.1
tensorflow==2.10.1
safetensors==0.2.6
....
I didn't have a chance yet, but that's what I was thinking: to try and download them directly, maybe upgrade some dependencies. Thought to ask here first, maybe someone else had the same issue...

Dreamshaper uses Diffusers v 0.16.1

Good to know. That could be it. Not sure though if it won't break other things or models, but I'll give it a try.

Lykon changed discussion status to closed

Sign up or log in to comment