ComfyUI Node

LC Anima LoRA Merge

Two LoRAs into one file, with a fader per block

By lonecatone23·Created about a month ago·Updated about 17 hours ago· 8
LC Anima LoRA Merge
  • model
  • model
  • merged_lora
◄lora_a▾►
◄lora_b▾►
◄strength_a1.00►
◄strength_b1.00►
◄mix0.50►
◄methodsum►
◄presetBoth full►
◄blocks0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5►
◄ties_density0.50►
◄blocks_in—►
◄lora_cNone►
◄strength_c1.00►
◄lora_dNone►
◄strength_d1.00►

What it is

Two Anima LoRAs, one file. Instead of stacking two loaders and hoping the strengths don't fight, you get a 28-block curve that says how much of A versus B lands in each block. Style in one, character in the other, and you decide where each one wins.

Like the rest of the Anima LoRA trio in this pack, it loads the LoRAs, applies the merged result to your model like a loader would, and hands you the merged LoRA on a second output for LC LoRA Save.

The curve, and what the numbers mean

blocks is 28 values, 0 to 1, and the scale is worth memorising:

  • 0 = only A
  • 0.5 = both at full strength
  • 1 = only B

So it isn't a blend percentage the way a checkpoint merge is - 0.5 is the "both of them, on" position, and the ends are the each-one-alone positions. Layers outside the 28 blocks follow the bars' average.

preset gives you starting shapes: Both full, A early, B late, B early, A late, A only, B only. Drag a bar and it switches to Custom. mix is a single blunt slider over the whole thing, like a normal model merge - 0 is only A, 1 is only B, and at 0.5 the bars apply as set.

strength_a and strength_b scale each LoRA globally. There are also lora_c and lora_d slots with their own strengths, which apply at a flat strength in every block rather than sitting on the curve - handy for a seasoning LoRA you don't want to place.

sum versus ties

method is the real decision here.

sum adds both LoRAs exactly. Fast, predictable, and if you saved the merge and then loaded it, you get the same picture the node produced. Two LoRAs of the same family stack cleanly.

ties is TIES merging (Yadav et al., 2023) applied per layer: keep only each LoRA's strongest changes, controlled by ties_density, let them vote on the sign of every weight, and drop the changes where the two pull against each other. That's the case for two styles or two characters that genuinely clash - sum gives you a muddle of both, ties gives you the strongest surviving features. It's slower, because it works on each layer's full weight change rather than the low-rank factors.

One honest note from the author: two LoRAs in two loaders and the same two merged with sum produce the same picture, but not bit for bit. One combined patch rounds slightly differently than two separate ones. Don't chase that difference.

Install

cd ComfyUI/custom_nodes
git clone https://github.com/lonecatone23/ComfyUI_LC_ModelBuilder_nodes

Restart after. No requirements.txt applies to this node - it runs on ComfyUI core, and the pack's install.py is only about onnxruntime for the face-scoring nodes. The block bars and heatmaps are JS, so hard-refresh (Ctrl+Shift+R) after updating or you'll get a node that renders oddly.

Where people get burned

This is one of the pack's beta nodes and the author says so: presets and defaults can change between versions, so a workflow saved today may need its bars set again after an update. Test on a fixed seed batch, and keep your originals - the node never touches your source LoRAs, but your saved merges will accumulate.

The other trap is trying to fix a mismatch with sum. If A and B were trained on the same base and the same style, sum works fine. If you're trying to combine two characters that both insist on their own face, sum gives you two half-faces; that's what ties and ties_density exist for. And if you need the face from B only in a specific block range, don't hand-place it - run the Block Scan, take its blocks curve, and wire it into this node's blocks_in.

CategoryLC ModelBuilder/Anima

Inputs (15)

NameTypeDefaultDescription
modelMODELAnima model. The merged LoRA is applied to it, like a LoRA loader.
lora_aCOMBOLoRA A, from models/loras.
lora_bCOMBOLoRA B, from models/loras.
strength_aFLOAT1.00-4–4—
strength_bFLOAT1.00-4–4—
mixFLOAT0.500–1One slider for the whole merge, like a plain model merge: 0 = only LoRA A, 1 = only LoRA B. At 0.5 the bars apply as set; toward 0 B fades out everywhere, toward 1 A does.
methodCOMBOsumsum = the LoRAs added, exactly (fast). ties = keeps each LoRA's strongest changes and drops the ones that fight each other: for LoRAs that clash, e.g. two styles or two characters. Slower (works on every full layer).
presetCOMBOBoth fullPer block: 0 = only A, 0.5 = both at full strength, 1 = only B. Dragging the graph switches to Custom.
blocksSTRING0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.528 block values, 0 (A) to 1 (B). Drag the bars on the node.
ties_densityFLOAT0.500.05–1ties only: share of each LoRA's changes that is kept (its strongest). Lower = only the most important changes survive.
blocks_inoptSTRINGA 28-block curve from another node. When wired it replaces the preset and the bars.
lora_coptCOMBONoneOptional third LoRA, at strength_c in every block (not on the curve).
strength_coptFLOAT1.00-4–4—
lora_doptCOMBONoneOptional fourth LoRA, at strength_d in every block (not on the curve).
strength_doptFLOAT1.00-4–4—

Outputs (2)

NameTypeDescription
modelMODELThe model with the merged LoRA applied.
merged_loraLC_LORAThe merged LoRA, for LC LoRA Save.