comfyanonymous / ComfyUI

The most powerful and modular diffusion model GUI, api and backend with a graph/nodes interface.
https://www.comfy.org/
GNU General Public License v3.0
57.49k stars 6.09k forks source link

Multi-LoRA Composite method #5691

Open catboxanon opened 1 day ago

catboxanon commented 1 day ago

Feature Idea

Idea presented in a paper from earlier this year to combine multiple LoRAs in a more cohesive manner. https://maszhongming.github.io/Multi-LoRA-Composition/

The paper presents three methods, referred to as Merge, Switch, and Composite. Merge is the current implementation in ComfyUI (merges LoRA weights then apply to model). Switch performs the same logic as Merge, but applies a single LoRA at each step. Composite calculates the cond and uncond for each LoRA individually at each denoise step, and averages each of these weights for a single denoise step -- this is what this feature request is proposing.

Existing Solutions

Of the methods mentioned above:

Other

https://arxiv.org/abs/2402.16843 https://github.com/maszhongming/Multi-LoRA-Composition

example