Uh oh!
There was an error while loading. Please reload this page.
[WIP] [Core] Add support for ControlNet LoRA - #4899
Conversation
@patrickvonplaten here's what I have found out so far. Note that this is entirely my understanding and I am happy to stand corrected. Control-LoRA workflow as per ComfyUIFor debugging purposes, I developed a simplified Colab Notebook out of the official Colab Notebook provided in the ComfyUI repository. From there one, I narrowed it down to the following LoCs that are responsible for initializing a ControlNet model and populating it with the Control-LoRA parameters (such as the ones found here and here). (For debugging, I am using this checkpoint: https://huggingface.co/stabilityai/control-lora/blob/main/control-LoRAs-rank128/control-lora-canny-rank128.safetensors (Canny).)
What we're doingNow, based on this observation, I tried to do a similar thing in this PR:
This along with the code snippet I provided in my PR description, does follow what ComfyUI is doing. But as mentioned above, I am happy to stand corrected. |
patrickvonplaten
commented
Sep 29, 2023
Where does a divergence appear? If you get ComfyUI working where is the point that the official implementation starts to differ from ours. E.g. where do numerical values diverge? |
sayakpaul
commented
Sep 29, 2023
For now, I am only considering the final results. I couldn't identify any implementation-related differences in our implementation which is why I tried to detail as much as possible in my previous comment. |
patrickvonplaten
commented
Oct 2, 2023
Can you set intermediate print statements to find out at which point the results start to diverge? |
clarencechen
commented
Oct 24, 2023
@sayakpaul This gist (https://gist.github.com/madebyollin/e6e217a77db94e2a960ab6ccbd627db9) by @madebyollin helped him debug and fix the SDXL VAE when running in FP16. It may also be helpful with comparing and debugging the Control LoRA activations. |
sayakpaul
commented
Oct 24, 2023
@clarencechen you mean we could reuse the gist to see if there's a problem FP16 inference here? |
clarencechen
commented
Oct 24, 2023
I think you can reuse the gist to help track and diagnose most numerical discrepancies in Pytorch models. |
adhikjoshi
commented
Nov 2, 2023
this is not a priority anymore? |
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
commented
Nov 27, 2023
Closing for #5938. |
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. |
lavinal712
commented
Jan 29, 2025
I use diffusers to load control-lora canny from https://huggingface.co/stabilityai/control-lora. Here is the result. |
lavinal712
commented
Jan 29, 2025
@sayakpaul Does this meet your expected outcome? |

This PR introduces support for ControlNet LoRA.
Why the design?
You might wonder why not unify everything in
load_lora_weights(). The reason why I decided not to do that is because there might be use cases where people load UNet LoRA checkpoints as well as ControlNet LoRA checkpoints. Plus ControlNet LoRA will always depend on a ControlNet that's initialized from a UNet.The current design
Load things:
Infer:
Results don't seem to be following the conditioning image at all. I will play with the hyperparameters a bit to see how the results get affected.
@patrickvonplaten could you give this a look and comment on what I might be missing out on?