ModelMergeSubtract_motorway_edition
How you pull a style off and bolt it somewhere else
- MOTORWAY 🚌💨
- MOTORWAY 🚌💨
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
ModelMergeAdddownstream, 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(defaultmodel1) andINPUT_model2_key(defaultmodel2) - 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(defaultMODEL) - 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
multipliernegative. 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_editionnodes may be missing from the menu. They're present in the 1.1.0–1.1.6 builds comfy.icu indexed.
Inputs (5)
| Name | Type | Default | Description |
|---|---|---|---|
| MOTORWAY 🚌💨 | MOTORWAY 🚌💨 | — | |
| INPUT_model1_key | STRING | model1 | — |
| INPUT_model2_key | STRING | model2 | — |
| multiplier | FLOAT | 1.00-10–10 | — |
| OUTPUT_MODEL_key | STRING | MODEL | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| MOTORWAY 🚌💨 | MOTORWAY 🚌💨 | — |