-
Notifications
You must be signed in to change notification settings - Fork 5.7k
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
LoRA from train_dreambooth_lora_sdxl.py is not working in A1111 anymore #6894
Comments
Thanks for the detailed thread. Can you pin me a version that was working as expected for you? I am asking because none of those scripts went through significant logical changes in the past 7 days. |
Yeah that's the thing, I am unable to restore the environment perfectly and I'm blocked right now, not sure where the issue is :/ |
Ah then it's a bit of a pity. In any case, please do ping me here if you're able to give me a pinpointed version. I am happy to look further from there :-) |
Anyway going through README guide it's not working properly, I am happy to meet or whatever to solve this issue :) |
README guide? Do you mean the commands from https://github.com/huggingface/diffusers/blob/main/examples/dreambooth/README_sdxl.md don't work? Can you provide a fully reproducible snippet for me?
Sorry, we cannot do that. As maintainers, we need to be cognizant of our time and keep the discussions as open as possible, |
I mean command from Not sure on what part of the pipeline there is an issue, like I said I am able to use LoRA using code for inference that you provided in README, but can't correctly convert it. Might be both the conversion itself or LoRA has some different properties that conversion script can't handle. Let me send you full pipeline for you to reproduce the issue, I will try to include as many details as possible:
|
As mentioned I need to know a version that was working as expected for you. CC: @linoytsaban @apolinario here. |
Well because I can't really provide it - can we just focus on the current version that is probably not working properly? I was also considering A1111 to not work, but I am able to work with my previous LoRA's so I think it has to be something in this pipeline |
That makes it thousand times more difficult for us to make progress here actually, hence I am a bit adamant on it. To be able to pinpoint the issue -- can we say the trained LoRA provides expected results when the inference is done from Your initial issue description suggests so. So, I quite suspect that it's the conversion script that's the culprit here. |
Yes, LoRA provides expected results when the inference is done from diffusers. When it's done in A1111 it actually changes the output image (same seed), but not in a way that it should, looks like its just adding some noise at the beginning of the generation process. I will send an example in 3 minutes |
Then it's quite likely that the conversion script is the problem as mentioned. So, I will let @apolinario and @linoytsaban comment further (as they are the developers of that script). |
Also adding an image generated locally with new LoRA that doesn't work in A1111 - trained for 4000 iterations with batch_size=2 Code to generate:
Image:NoteAs you can see it's much closer, of course quality is not good enough because in AUTOMATIC1111 there are some additional things that make it look better like negative embeddings etc. |
UpdateI tried to load exact same model after the conversion in ComfyUI and it works properly, but I found this issue from a week ago: #6777 Do you think it's related? Did any of LoRA keys changed? Looks like A1111 do not support it yet |
Could be related but the LoRA keys didn’t change. We have got multiple tests ensuring that. |
Hey @patryk-bartkowiak-nitid, thanks for creating this issue! Just to make sure I understand, right now comfyUI conversion works fine but A111 doesn't? |
Exactly |
Hmm, I'm not sure what have caused this since we haven't made any changes to the conversion script, and the changes made to the training script should not affect that. @sayakpaul was there any change in the peft keys maybe that would make the conversion script incompatible? |
No, I don’t think so. There were no changes to the training script or the underlying utils that would lead to key incompatibilities. |
Could this have had an impact? #6895 |
Pretty sure not as it only touches the model card which has nothing to do with the state dict. |
Any ideas @sayakpaul @linoytsaban ? Still trying to figure this out |
Sorry but I don't work with A1111 or ComfyUI either. And I cannot offer any help related to conversion to non-diffusers formats right now. |
@patryk-bartkowiak-nitid can you check the |
I compared converted
Now I got two |
Before:
After
|
I also encountered the same problem |
This issue has been automatically marked as stale because it has not had recent activity. If you think this still needs to be addressed please comment on this thread. Please note that issues that do not follow the contributing guidelines are likely to be ignored. |
@sayakpaul |
Yeah could be. |
This issue has been automatically marked as stale because it has not had recent activity. If you think this still needs to be addressed please comment on this thread. Please note that issues that do not follow the contributing guidelines are likely to be ignored. |
assuming fixed in #7435 |
Describe the bug
I have been using train_dreambooth_lora_sdxl.py and convert_diffusers_sdxl_lora_to_webui.py to train LoRA for specific character, It was working till like a week ago. I am using the same baseline model and the same data.
I realized that previous size of all the LoRA files had 29967176 bytes, now it has 29889672 and less keys in dict after I load it as pure
.safetensors
file.I realized that it works fine with inference guide in README:
But after I convert and load to A1111 (it loads correctly) it doesnt work anymore, looks like its adding some noise to the output only.
I already tried checkpointing to previous commits on
diffusers
,torch
andtorchvision
, but nothing really helps. I am still not able to use LoRA in A1111.Reproduction
Code to train LoRA:
Code to convert to A1111 format
Logs
Can't really post any errors, looks like typical image generation, no errors or warning during training and conversion
System Info
Who can help?
@yiyixuxu @sayakpaul @DN6 @patrickvonplaten
The text was updated successfully, but these errors were encountered: