Nodes/ComfyUI_agilly1989_motorway/ModelMergeSubtract_motorway_edition
ComfyUI Node

ModelMergeSubtract_motorway_edition

How you pull a style off and bolt it somewhere else

By agilly1989·Created 2 years ago·Updated about a year ago· 7
ModelMergeSubtract_motorway_edition
  • MOTORWAY 🚌💨
  • MOTORWAY 🚌💨
INPUT_model1_keymodel1
INPUT_model2_keymodel2
multiplier1.00
OUTPUT_MODEL_keyMODEL

Adding two models usually makes soup. Subtracting one from the other, though, is how you find the thing that makes a model special. ModelMergeSubtract computes model1 minus model2 times a multiplier, and while it sounds like the same shape of nonsense, it's the honest workhorse of style extraction. This is its Motorway-ed clone.

What subtraction buys you

The math: for each weight in model2's diffusion_model, the merged model applies -multiplier worth of model2 on top of model1. With the default multiplier = 1 you get model1 minus all of model2 - usually meaningless on its own. The interesting move is the difference trick:

  • Diff two checkpoints to isolate a style: if B is your base and C is "base + style", then ModelMergeSubtract(model1=B, model2=C) approximates the style delta. That delta is exactly what LoRA extraction formalizes - the KB notes you can capture a fine-tune's difference from its base as a LoRA rather than shipping whole checkpoints.
  • Add that delta onto a different base: chain a subtract here with an ModelMergeAdd downstream, and "B's style, A's base" becomes a real output. This is the canonical use of this node - you almost never run it alone and admire the result.

multiplier (range -10 to 10) just scales how much of model2 you're removing. Negative multipliers flip the subtraction into an addition - a legit way to fake ModelMergeAdd with a knob.

The inputs

  • INPUT_model1_key (default model1) and INPUT_model2_key (default model2) - the keys holding your two models. Order matters a lot here: this is model1 minus model2, not the reverse.
  • multiplier - the scalar on model2's contribution. Default 1.0.
  • OUTPUT_MODEL_key (default MODEL) - where the result lands.

The wrapper keeps multiplier as a widget, turns the two models into key strings, and writes the result by key. Runtime behavior matches stock ModelMergeSubtract exactly.

Install

One install for the whole pack. ComfyUI Manager, search "ComfyUI_agilly1989_motorway", or:

cd ComfyUI/custom_nodes
git clone https://github.com/agilly1989/ComfyUI_agilly1989_motorway

Restart ComfyUI. No requirements.txt, no model downloads.

Troubleshooting

  • Wrong direction of the effect? Swap model1 and model2, or flip multiplier negative. The math is directional and there's no auto-detection.
  • Pure subtraction output usually looks broken on its own - that's expected. It's a component for the difference-add chain, not a finished model.
  • 'MotorwayClass' object has no attribute 'hash_' = a model key isn't in the Motorway; check the loaders ran and the key spelling matches (case-sensitive).
  • Pack caveats: BETA, and the newest published version (1.1.7) disabled clone generation, so on a fresh install these _motorway_edition nodes may be missing from the menu. They're present in the 1.1.0–1.1.6 builds comfy.icu indexed.
Categoryagilly1989 Nodes/Motorway-ed/advanced/model_merging

Inputs (5)

NameTypeDefaultDescription
MOTORWAY 🚌💨MOTORWAY 🚌💨
INPUT_model1_keySTRINGmodel1
INPUT_model2_keySTRINGmodel2
multiplierFLOAT1.00-10–10
OUTPUT_MODEL_keySTRINGMODEL

Outputs (1)

NameTypeDescription
MOTORWAY 🚌💨MOTORWAY 🚌💨