bmaltais / kohya_ss

Apache License 2.0
9.53k stars 1.23k forks source link

Can't use 2.x LoRas - Failed to match keys when loading lora. text model encoder related? #287

Closed Mctwost closed 1 year ago

Mctwost commented 1 year ago

So for the last 5 days i've tried to create loras with the same database i was using for my 1.5s but with images being 768 by 768 and enabling both v2 and parameterization.

I'm able to create the loras but when it comes time to use them i get the following error every single-time and of course it doesnt show the lora:

Screenshot_3

While creating the LORA model and looking at console i noticed this aswell:

text_encoder\model.safetensors not found

I tried to find how to fix this issue for days but im unable to find a solution to it. I would really appreciate some help on this matter. Tried to use the "verify lora" tool and it gives me 663 modules and no error.

If is due to the model not found for text encoder, how do i get such file? thanks and thank you so much for your work bmaltais

bmaltais commented 1 year ago

Are you using the sd2.1 quick start as the base model? Try using the quick start models to test

Mctwost commented 1 year ago

Are you using the sd2.1 quick start as the base model? Try using the quick start models to test

Tried a pretrained one (illuminati 1.1) and also just tried stabilityai 2.1 and 2.1 base with both v2 and v_parameterization enabled. Same problem gives text_encoder\model.safetensors not found finishes the lora, and when i try it on SD it gives me the error on the screenshot above

Dragoy commented 1 year ago

I encountered the same problem when teaching Lora on SD 2.1 768

Mctwost commented 1 year ago

I encountered the same problem when teaching Lora on SD 2.1 768

I tried many to no avail, just downloaded v 2.1 768 pruned with ema and when loading the model i dont encounter the text encoder model missing, i don't know if it will work yet but ill report on it in an hour.

Edit: Aaaaaand nope, it will give the huge error from the screenshot again.

Dragoy commented 1 year ago

I encountered the same problem when teaching Lora on SD 2.1 768

I tried many to no avail, just downloaded v 2.1 768 pruned with ema and when loading the model i dont encounter the text encoder model missing, i don't know if it will work yet but ill report on it in an hour.

Edit: Aaaaaand nope, it will give the huge error from the screenshot again.

As it turned out automatic does not support lora 2.1 To make it work, you need to install an additional extension https://github.com/kohya-ss/sd-webui-additional-networks