-
Notifications
You must be signed in to change notification settings - Fork 6k
Create convert_diffusers_sdxl_lora_to_webui.py #6395
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
Conversation
diffusers_state_dict = load_file(input_lora) | ||
peft_state_dict = convert_all_diffusers_to_peft(diffusers_state_dict) | ||
kohya_state_dict = convert_peft_to_kohya(peft_state_dict) | ||
save_file(kohya_state_dict, output_lora) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we wanna have an option for push_to_hub
? That'd be very cool IMO.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Love it! I'd merge it as is for now and add it in a next PR , we can also have other utils to PR a Kohya weight to existing diffusers trained repos and other cool utils like that
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lovely 😍
# - Colab (only on Pro): https://colab.research.google.com/github/huggingface/notebooks/blob/main/diffusers/SDXL_Dreambooth_LoRA_advanced_example.ipynb | ||
# Canonical diffusers training scripts: | ||
# - Script: https://github.com/huggingface/diffusers/blob/main/examples/dreambooth/train_dreambooth_lora_sdxl.py | ||
# - Colab (runs on free tier): https://colab.research.google.com/github/huggingface/notebooks/blob/main/diffusers/SDXL_DreamBooth_LoRA_.ipynb |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we also add a working example for the script itself? I think that might be helpful too!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
✅
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks a lot @apolinario @sayakpaul for taking care of this!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Slick!
* Create convert_diffusers_sdxl_lora_to_webui.py * Move some conversion logic to utils * fix logging import * Add usage example --------- Co-authored-by: multimodalart <joaopaulo.passos+multimodal@gmail.com>
* Create convert_diffusers_sdxl_lora_to_webui.py * Move some conversion logic to utils * fix logging import * Add usage example --------- Co-authored-by: multimodalart <joaopaulo.passos+multimodal@gmail.com>
What does this PR do?
Converts Diffusers SDXL LoRA to WebUIs format (AUTOMATIC1111, ComfyUI, SD.Next, etc)
Who can review?
@sayakpaul @younesbelkada