LatentSubtract_motorway_edition
The node for 'what's actually different here?'
- MOTORWAY 🚌💨
- MOTORWAY 🚌💨
LatentSubtract_motorway_edition takes two latents out of your Motorway pipe and subtracts the second from the first. One node, no settings beyond the keys. It's the sibling of LatentAdd and the whole "latent arithmetic" family, and it exists because vectors in latent space are meaningful - differences between them carry semantic information.
The honest answer to "what would I use this for?" is: fewer people than you'd think, and mostly as a building block. Latent differences show up in style-transfer experiments (add the difference between two styles to a third latent), in some anime-to-photoreal blending recipes, and in a few editing pipelines that need to isolate "what changed between pass A and pass B." It's also the natural inverse for anyone debugging: subtract a reference latent from your output and the residual tells you what the sampler actually added.
The core node reshapes the second latent to match the first before subtracting, so you won't get a shape mismatch crash if the two batches aren't identical sizes - a nicety that turns a would-be footgun into a no-op.
The wrapper
Standard Motorway-ed clone: core LatentSubtract logic, pipe I/O instead of direct wiring.
MOTORWAY 🚌💨- the pipe. Required.INPUT_samples1_key(defaultsamples1) - the minuend.INPUT_samples2_key(defaultsamples2) - the subtrahend.OUTPUT_LATENT_key(defaultLATENT) - wheresamples1 − samples2lands.
Both latents come out of the same pipe, so the graph upstream needs to have written samples1 and samples2 before this node runs - which in ComfyUI terms means both branches connect back into the pipe spatially before this node. As with every node in this pack, the only output port is the pipe; pull the result out with a Motorway AxB ramp pointed at the LATENT key if you want to feed it into a regular node.
Installing
It lives in the Motorway pack:
cd ComfyUI/custom_nodes
git clone https://github.com/agilly1989/ComfyUI_agilly1989_motorway
# restart ComfyUI
Or via ComfyUI Manager: search ComfyUI_agilly1989_motorway → Install. No model downloads, no extra pip packages.
Gotchas
- You need a
MotorwayStart(or primitive) node upstream to create the pipe. - Keys are exact strings.
Key: 'samples1' doesn't exist in motorwaymeans nothing upstream stored that key - check what your encoding branch actually wrote. - The pack is a one-dev beta. Author's README, verbatim-ish: "CURRENTLY IN ACTIVE DEVELOPMENT (BETA)! IF THINGS BREAK ITS BECAUSE I BROKE IT." The generated clone nodes have been dropped from releases mid-refactor before, so a missing node is probably a version issue, not you doing it wrong.
Subtraction is a niche tool, but when a workflow needs it, nothing else will do. Keep it in the back pocket for when a latent-space difference is the answer.
Inputs (4)
| Name | Type | Default | Description |
|---|---|---|---|
| MOTORWAY 🚌💨 | MOTORWAY 🚌💨 | — | |
| INPUT_samples1_key | STRING | samples1 | — |
| INPUT_samples2_key | STRING | samples2 | — |
| OUTPUT_LATENT_key | STRING | LATENT | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| MOTORWAY 🚌💨 | MOTORWAY 🚌💨 | — |