Nodes/ComfyUI_agilly1989_motorway/PerpNegGuider_motorway_edition
ComfyUI Node

PerpNegGuider_motorway_edition

The PerpNeg guider that rides a bus — un-stick your negative prompt

By agilly1989·Created 2 years ago·Updated about a year ago· 7
PerpNegGuider_motorway_edition
  • MOTORWAY 🚌💨
  • MOTORWAY 🚌💨
INPUT_model_keymodel
INPUT_positive_keypositive
INPUT_negative_keynegative
INPUT_empty_conditioning_keyempty_conditioning
cfg8.0
neg_scale1.00
OUTPUT_GUIDER_keyGUIDER

If you've ever pushed a negative prompt hard and watched the image start burning, or wondered why your negatives barely move the needle, PerpNeg is the fix - and this _motorway_edition version is that fix adapted to ride the Motorway bus instead of regular wires.

PerpNeg ("perpendicular negative") is a clever hack on how classifier-free guidance works. Normally ComfyUI computes uncond_pred + (cond_pred - uncond_pred) * cfg - it amplifies the difference between your prompt and your negative prompt. PerpNeg instead splits that CFG update into two components: one parallel to the direction of the negative, one perpendicular to it. Then it throws the parallel part away (or scales it by neg_scale) and keeps only the perpendicular one. The result: your negatives still push the image away from what you named, but they stop contaminating every other aspect of the image. It's the "not all negative prompts are equal" paper, wrapped in a node.

What the motorway-ed wrapper changes

Every node in the Motorway pack is a clone of a stock ComfyUI node, rewired to talk through the MOTORWAY 🚌💨 bus. Instead of dragging a wire from your CheckpointLoaderSimple into this node, you put the model on the bus under a key and tell the node which key to read.

So the real inputs here are the INPUT_*_key strings - they name where the node fetches its data from:

  • INPUT_model_key (default model) - the model, parked on the bus by an upstream ramp node.
  • INPUT_positive_key and INPUT_negative_key (defaults positive/negative) - your two CLIP-encoded conditionings.
  • INPUT_empty_conditioning_key (default empty_conditioning) - PerpNeg needs the empty/blank conditioning to know what "no prompt" looks like.

The widgets you actually tune are cfg (guidance scale, default 8 - the normal 5–9 SD/SDXL range) and neg_scale (default 1). neg_scale is the PerpNeg dial: 1 is roughly normal CFG behavior, and raising it is how you lean into the perpendicular-only trick.

OUTPUT_GUIDER_key (default GUIDER) is where the finished guider gets parked on the bus. Grab it from there with a downstream node - in a bus workflow that's typically SamplerCustomAdvanced_motorway_edition, whose INPUT_guider_key defaults to guider, so either rename your output key to guider or change the sampler's key to match. Keys are case-sensitive and shared by name across the whole workflow.

Install

Two ways, both with no Python dependencies and no model downloads - the pack is pure code:

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

Or use ComfyUI Manager and search for the pack title ComfyUI_agilly1989_motorway. Then restart ComfyUI.

The fine print

This pack is a hobby project that its own author describes as "IN ACTIVE DEVELOPMENT (BETA)! IF THINGS BREAK ITS BECAUSE I BROKE IT." The _motorway_edition clones were auto-generated by a cloner that a later build (1.1.7) disabled, so on a fresh install you may only see the Motorway AxB, MotorwayStart, and primitive nodes - if PerpNegGuider_motorway_edition is missing from your node menu, that's why.

If you get KeyError: 'hash_...' doesn't exist in motorway, the key you asked for was never stored - check that an upstream ramp actually put model, positive, etc. on the bus with exactly those names. And remember: reuse a key and you silently overwrite it.

Honestly? If you're not already committed to building your whole workflow on the Motorway bus, the stock PerpNegGuider is the saner pick. This edition is for when you're all-in on the bus.

Categoryagilly1989 Nodes/Motorway-ed/_for_testing

Inputs (8)

NameTypeDefaultDescription
MOTORWAY 🚌💨MOTORWAY 🚌💨
INPUT_model_keySTRINGmodel
INPUT_positive_keySTRINGpositive
INPUT_negative_keySTRINGnegative
INPUT_empty_conditioning_keySTRINGempty_conditioning
cfgFLOAT8.00–100
neg_scaleFLOAT1.000–100
OUTPUT_GUIDER_keySTRINGGUIDER

Outputs (1)

NameTypeDescription
MOTORWAY 🚌💨MOTORWAY 🚌💨