-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Resize ControlLoRA #2175
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
Resize ControlLoRA #2175
Conversation
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.
Pull Request Overview
This PR extends the LoRA resizing functionality to support ControlLoRA, which is a LoRA version of ControlNet. The changes enable resizing of ControlLoRA models that can be saved using the ControlLoraSave node from stability-ComfyUI-nodes.
- Adds support for multiple LoRA naming formats beyond the original format
- Implements dynamic format detection to handle different trainer formats
- Updates key construction logic to work with the detected format
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
|
Thank you, this is a good idea to generalize the converter. Could you please check the Copilot review? |
|
I agree that using global variables is a bad practice (it was a quick patch based on the previous PR). I'll refactor it. |
|
I've refactored the code to avoid the mutable global variable (there is no need to rename |
|
Thank you for update! This looks good. |
This PR is based on #2057 . It supports resizing ControlLoRA (LoRA version of ControlNet). We can save a ControlLoRA using
ControlLoraSavenode in stability-ComfyUI-nodes, then resize it usingnetworks/resize_lora.py.For example, I've uploaded some resized ControlLoRAs in https://huggingface.co/woctordho/sdxl-control-lora . They help save some VRAM from 2.5 GB (the original ControlNet) to 0.3 GB (the resized ControlLoRA).