LoRA Merge (Anima Knobs)
Merge Them Key by Key Instead
- model
- clip
- model
- clip
- report
Anima is unusually forgiving about LoRAs - it's one of the few modern bases where three of them stack without the image collapsing into soup. That's a feature. It's also how you end up with a style LoRA that poisons the texture at 0.6 and does nothing useful at 0.35, with no in-between. This node is the in-between.
LoRA Merge (Anima Knobs) takes two Anima LoRAs and blends them key by key - not "weight 0.6", but "this attention layer 0.6, this MLP 0.2, the LLM adapter 0.0" - then writes the result as one ordinary LoRA file. If you've ever merged a face LoRA into a style LoRA and wanted to keep the style out of the eyes, this is the dial for that.
Where it sits in an Anima workflow
Anima is a 2B diffusion transformer on a Cosmos-Predict2 backbone with a Qwen3-0.6B text encoder - great prompt comprehension, slow for its size. LoRA training on it plateaus around 1800 steps and the model already knows most concepts, so the LoRAs people make are light, subtle things: a line weight, a painterly finish, a face. Light and subtle is exactly what collides when you stack. Merging is the alternative: you lose the ability to dial each source mid-session and you gain one file with fixed proportions you can drop into any workflow.
How the merge works
The knobs write a JSON matrix into the node's matrix field, and for each key in the LoRA the node picks a ratio: 0 means keep LoRA 1 there, 1 means take LoRA 2. Blending is done by concatenation - the two delta-weight matrices are scaled and stacked along the rank dimension, so ΔW = (1-t)·ΔW1 + t·ΔW2 is represented exactly rather than approximated. Nothing is compressed or truncated.
The cost is physical: the merged file's rank is the sum of the two input ranks. Two rank-32 LoRAs give you a rank-64 file, roughly double the size. kohya's resize_lora.py will SVD-compress it afterwards if that matters.
The naming follows Anima's structure, not SD's. B00–B27 are blocks.0–blocks.27 of the DiT, BASE covers llm_adapter and embeddings, attn1 is self-attention, attn2 is cross-attention - the layer that decides how hard your prompt pushes - and ff is the MLP, where most "texture" lives. The sub-knobs to_q/to_k/to_v/to_out map onto the q/k/v/o projections.
The inputs that matter
You set the two LoRAs, lora1_name and lora2_name, from whatever is in models/loras. matrix is written by the knob panel; hand-editing it is possible but not the normal path. te_ratio (default 0.5, 0–1) is, per the tooltip, the LoRA 2 share for the text-encoder half - applied uniformly because the TE can't be split into blocks the way the DiT can. Set it to 0 and you keep LoRA 1's text encoder entirely, the usual move when LoRA 2 is a style you don't want leaking into prompt interpretation.
filename is the output name and save_file is the mode switch. Per its tooltip: off, the merge is applied straight onto the connected model/clip and nothing is written - that's the tune-as-you-generate mode. Fix your seed, turn a knob, queue, look.
Outputs are model, clip, and report. Wire model into your KSampler, and clip only if you also want the text-encoder side merged. Read the report: paired keys, keys in only one LoRA, dropped-at-zero, skipped-as-unsupported, max rank. If a knob you turned shows up as skipped, that file didn't have the key.
Installing it
Same pack, same two lines, no dependencies at all - the project file declares an empty dependency list and it runs on stock ComfyUI:
cd ComfyUI/custom_nodes
git clone https://github.com/galigali-san/ComfyUI-RecipeMerge
Restart ComfyUI, hard-refresh the browser, and look under advanced/model_merging for LoRA Merge (Anima Knobs). ComfyUI Manager users can just search the pack title "RecipeMerge". You'll also need a ComfyUI build new enough to load Anima at all.
Where people get burned
The node throws if you connect neither model/clip nor turn on save_file, because it genuinely has nothing to do - it previews or it saves. Beginners hit that error and assume it's broken.
Second: this merges LoRA files, not checkpoints, and both files have to be Anima LoRAs - mixing an SDXL LoRA in errors on the block-structure check rather than quietly producing garbage. Third: LoHa, LoKr, DoRA and tucker-format conv layers aren't supported. Plain LoRA and compatible LoCon only.
Last caveats. The panel labels are Japanese, and the SD-style presets get linearly interpolated onto Anima's 28 layers - so a preset named "paint transfer" is a suggested ratio curve, not a function. The docs say the purpose names are unverified; treat them as starting points. And before you publish a merged Anima LoRA, check the license: the weights are non-commercial, though v1.2 explicitly allows individuals to sell derivative LoRAs. The node embeds your recipe in the output metadata either way.
Inputs (8)
| Name | Type | Default | Description |
|---|---|---|---|
| lora1_name | COMBO | 0 options: | |
| lora2_name | COMBO | 0 options: | |
| matrix | STRING | {} | — |
| te_ratio | FLOAT | 0.500–1 | テキストエンコーダ部分のlora2の割合(ブロック分けできないので一律) |
| filename | STRING | merged_lora | — |
| save_file | BOOLEAN | false | ONで新しいLoRAファイルとして保存。OFFならmodel/clipに直接適用するだけ(生成しながらつまみを試すモード) |
| modelopt | MODEL | — | |
| clipopt | CLIP | — |
Outputs (3)
| Name | Type | Description |
|---|---|---|
| model | MODEL | — |
| clip | CLIP | — |
| report | STRING | — |