-
Notifications
You must be signed in to change notification settings - Fork 78
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 compatibility #111
Comments
Hey! Thanks for raising this very important concern Can you tell me if using peft library will fix this issue of compatibility? I am currently a little occupied with some other projects, but I can find some time to do a sliders with peft implementation code release in the next few weeks. |
Tried to convert the created lora to PEFT using "convert_lora_to_peft_format.py" script from ai-toolkit , that is one of the most used solutions to train Flux's loras. When trying to convert a lora saved as .safetensor :
When trying to convert a lora saved as .pt :
Must say that I'm not a specialist, but usually the message "HeaderTooLarge" points to a bad formatted file. You have all time you need, I'm not here to pressure, I'm here to help on testing your solution. And thanks again. |
#80 (comment) - looks like you can just update the line where the file is saved Although when I try to use said safetensors in ComfyUI, it seems to do nothing and I get a bunch of this in the logs
|
You can save it as safetensors or pt ... it will not work. |
This fork supposedly contains the training script for some flux slider LoRAs that appear to work (at least as they've been uploaded to civitai) https://github.com/ntc-ai/sliders-conceptmod/blob/main/conceptmod/textsliders/train_lora_flux.py but I was having trouble getting it to run yesterday. |
Sorry, this fork (conceptmod) always produce an error, it's not possible to create loras with it. The author must use another unpublished version to create the sliders he published. |
Upgrading all deps and adding this before the conceptmod imports seems to have allowed it to progress to the training loop (haven't run it to completion yet)
Also needed to set the EDIT: at least the first file from 500 steps gets the |
both scripts use the same routine to save the lora ... so the resulting files (.pt or .safetensors) produces exactly the same errors. |
So, after some studies, I was able to convert the .pt file that I mentioned on the first post to an usable .safetensors file. https://gist.github.com/edicam/7d4974e81aa6970fa97ba0f17a2d2e3d The resulting file was tested on ComfyUI and works like a charm, the slider is very good ! The script above is based on https://github.com/ostris/ai-toolkit/blob/main/scripts/convert_lora_to_peft_format.py. I'm not an AI specialist, so I don't care if it's not optimized or if it should have a better syntax... it works, it's fast and this is most important to me. Thanks again to @rohitgandikota for this great repository ! |
I was able to make your gist work for the conceptmod ones as well with minor edits https://gist.github.com/sanguivore-easyco/e1757f2ecfb0e352f2eefa22ed3a8259 (in case anyone else ends up here looking) Thanks @edicam and @rohitgandikota |
Sorry, have you tried using the created lora file in other applications ?
Because it can't be loaded by ComfyUI or Forge, it can't be converted using sd-scripts or ai-toolkit scripts ...
I know it works on the jupyter notebook, but the network used there is the one that is generated while training, it is not loaded from the new created file.
I have a new lora file, but I can't use it anywhere :)
Thanks for your precious work.
eta: the lora file was saved as a .pt file
The text was updated successfully, but these errors were encountered: