Nodes/ComfyUI/ModelMergeSubtract
ComfyUI Node Runs on cloud

ModelMergeSubtract

The difference merge that removes styles and extracts LoRAs

By Comfy-Org·Created 4 years ago·Updated about 11 hours ago· 130,493
ModelMergeSubtract
  • model1
  • model2
  • MODEL
multiplier1.00

ModelMergeSubtract is the merge node you reach for when you want to remove something instead of blend something. While every other merge node averages weights toward a target, this one subtracts one model from another - model1 − multiplier · model2. It's the least flashy node in the family and the one with the most surgical uses.

The headline use is style removal. If you have a checkpoint with a style you hate baked into it - a look, a color cast, a face tendency - and you have the parent model it was derived from, subtracting the parent at the right multiplier pulls that baked-in behavior back out. The math: result = multiplier · (model1 − model2). Positive multiplier takes model2's weights away from model1; negative multiplier does the opposite (you can flip the subtraction direction entirely, which is why the multiplier range runs −10 to +10 instead of 0–1).

The second use is the one that gets people excited: LoRA extraction. The concepts KB spells it out - if you have a base model and a fine-tune of it, the difference between them is, loosely, the fine-tune's contribution, and that difference can be captured as a LoRA so you can apply it elsewhere without carrying a multi-GB checkpoint. This node is the "compute the difference" step of that pipeline. You're not going to get a ready-to-train LoRA out of one node alone, but this is where the subtraction happens.

How it works

Mechanically it's the same patch machinery as ModelMergeSimple - clone model1, apply model2's weights as a patch - but with the patch strengths flipped: model1 is scaled by multiplier and model2 by −multiplier, giving result = multiplier · (model1 − model2). At multiplier 1.0 that's a clean difference; at 0.0 the result is a zeroed model, which is another reason the range extends negative. There's no saving, no training, no data - it's instant tensor arithmetic on the weights.

The inputs that matter

  • model1 (MODEL) - the model you want to subtract from.
  • model2 (MODEL) - the model whose influence you remove (or, flipped, add).
  • multiplier (FLOAT, default 1.0, −10 to +10, step 0.01) - how strongly to subtract, and which direction.

One MODEL out, into a sampler or another merge.

Where people get burned

Shape mismatch is the loud failure - model1 and model2 must be the same architecture, full stop. The subtle failure is oversubtraction: crank the multiplier too high and you don't remove a style, you destroy the model, producing garbage with no fix except dialing it back. Start at 1.0 and move in 0.1 steps; the difference between "style removed" and "model destroyed" is often a single decimal.

Also manage expectations on what subtraction can fix. If a style is genuinely trained into the weights rather than layered on, subtraction thins it but rarely removes it completely - it's a scalpel for inherited tendencies, not a cure for a fundamentally different training set.

How you get it

Core ComfyUI, model/merging category, ships with the program - no install. It's been part of the core merge family since the beginning.

Categorymodel/merging

Inputs (3)

NameTypeDefaultDescription
model1MODEL
model2MODEL
multiplierFLOAT1.00-10–10

Outputs (1)

NameTypeDescription
MODELMODEL