Perp-Neg Guider
Let your negative prompt stop fighting your positive one
- model
- positive
- negative
- empty_conditioning
- GUIDER
Perp-Neg - perpendicular negative prompting - answers a question that has bugged people since negative prompts existed: what if the thing your negative prompt pushes away from is also part of what your positive prompt wants? You ask for "a photo, cinematic lighting" and put "cartoon, flat lighting" in the negative, and the sampler dutifully steers away from everything negative-related, including bits that overlap with your positive. Perp-Neg splits the negative's effect into a component parallel to the positive direction and one perpendicular to it, and only keeps the perpendicular part. The negative stops fighting you on shared ground and only works on the axis where it can't contradict the prompt. It comes from the "Negative Prompt in Diffusion Models" paper (arXiv 2312.08781), and PerpNegGuider is the current, supported form of it in ComfyUI.
How it's wired - this is the important part. The old PerpNeg was a model patcher that hung off a regular KSampler. This one is a guider, which means it changes how you build your sampling graph:
- model - your checkpoint.
- positive / negative - the usual two conditioning encodings from CLIPTextEncode.
- empty_conditioning - a conditioning from encoding an empty prompt. This is the "no prompt at all" reference the perpendicular math needs. Easy to forget; the node won't do what it should without it.
- cfg (default 8) - your guidance scale, same idea as the KSampler's.
- neg_scale (default 1.0) - how strongly the perpendicular negative steering is applied. This is the knob that matters.
Output is a GUIDER, and a guider plugs into SamplerCustomAdvanced's guider input (alongside a sampler and sigmas), replacing the BasicGuider that node expects by default. If you've never used SamplerCustomAdvanced, that's the mental shift: you're building a sampling stack instead of using a one-box KSampler.
Why the guider form is better. The source shows the trick: instead of running the positive+negative pair and then a separate empty-conditioning pass (three model calls worth of work across two batches), the guider feeds positive, negative, and empty into a single batched calc_cond_batch call per step. You get the perpendicular correction without paying for a third pass. That's the upgrade that motivated deprecating the old node.
Gotchas. It only makes sense where a real negative prompt is doing work - i.e., CFG above 1 on SDXL-lineage models. On guidance-distilled CFG-1 models there's no unconditional pass to decompose, so Perp-Neg is a no-go there. Default cfg of 8 is high by modern standards; start lower and let the negative do the steering. And be aware the whole technique has quietly faded - community discussion of perp-neg is thin since its 2023-2024 peak, and it's a niche tool even among people who care about negative prompt quality. It's for when a normal negative genuinely makes your image worse in one specific way and you've already tried rewording it.
Ships with ComfyUI core. Search "PerpNegGuider" to add it; no install.
Inputs (6)
| Name | Type | Default | Description |
|---|---|---|---|
| model | MODEL | — | |
| positive | CONDITIONING | — | |
| negative | CONDITIONING | — | |
| empty_conditioning | CONDITIONING | — | |
| cfg | FLOAT | 8.00–100 | — |
| neg_scale | FLOAT | 1.000–100 | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| GUIDER | GUIDER | — |