ComfyUI Extension: ComfyUI LoRA Combine Node
A custom ComfyUI node that allows you to combine two LoRAs with adjustable strengths and multiple merging methods.
Custom Nodes (0)
README
ComfyUI LoRA Combine Node
A custom ComfyUI node that allows you to combine two LoRAs with adjustable strengths and multiple merging methods.
Features
- Combine two LoRA files from your ComfyUI loras folder
- Adjust the strength of each LoRA independently (-100.0 to 100.0)
- Choose merge method (linear, weighted average, concatenation) with optional compatibility checks
- Output a merged LoRA_MODEL that can be used with other ComfyUI nodes
- Works with any LoRA format (Stable Diffusion, Qwen, etc.) as long as they have compatible tensor structures
Installation
- Download or clone this repository
- Copy the
Comfyui_LoraCombine
folder to yourComfyUI/custom_nodes/
directory (or clone the repo directly there) - Restart ComfyUI
The node will appear as "Combine LoRAs" in the "loaders" category.
Usage
- Add the "Combine LoRAs" node to your workflow
- Select two LoRA files from your loras folder
- Set the strength values for each LoRA
- Connect the output to a node that accepts LORA_MODEL (like Save LoRA Weights to save it, or LoraModelLoader to apply it)
Node Inputs
lora_name1
: First LoRA filestrength1
: Strength multiplier for first LoRA (default: 1.0)lora_name2
: Second LoRA filestrength2
: Strength multiplier for second LoRA (default: 1.0)
Node Output
LORA_MODEL
: The combined LoRA weights
Saving Combined LoRAs
To save your combined LoRA:
- Connect the output to "Save LoRA Weights" node
- Set a filename prefix (can include subfolders)
- Optionally set steps for file naming
- Run the workflow
How It Works
The node merges LoRA weights by:
- Loading both LoRA safetensors files
- For each tensor key that exists in both LoRAs:
merged[key] = strength1 * lora1[key] + strength2 * lora2[key]
- For keys that exist in only one LoRA:
merged[key] = strength * lora[key]
- Outputting the combined weight dictionary
Requirements
- ComfyUI (with training nodes enabled for saving)
- PyTorch (included with ComfyUI)
- safetensors (only for compatibility checks)
Credits
- Original concept and initial implementation by Snowshoes311
- Major enhancements to merging methods and compatibility checks by @sweetmax797
License
MIT License - feel free to use and modify as needed.