Nodes/ComfyCollectorNodes/Neutral Prompt (CCN)
ComfyUI Node

Neutral Prompt (CCN)

Neutral Prompt (CCN)

By valkymaera·Created 4 months ago·Updated 10 days ago· 1
Neutral Prompt (CCN)
  • model
  • main_conditioning
  • aux_conditioning
  • model
  • conditioning
strategy
side
weight1.00
k_ratio0.050
cfg_rescale0.00
debugfalse

Neutral Prompt (CCN) is the ComfyUI port of a mechanic that A1111 users who hung around long enough will recognize as AND_PERP, AND_SALT, and AND_TOPK - the "neutral prompt" extension by ljleb. The pitch, one line: when you merge two conditionings the normal way, the aux prompt drags the main prompt's meaning sideways; neutral-prompt merging removes the conflict so the auxiliary prompt adds only what the main prompt isn't already saying. The author used it constantly in A1111 and ported the concept here (MIT, credited in the README). If you've ever wanted to inject "cinematic lighting" or "a red balloon" into an image without the model rewriting your character to be the lighting, this is the tool.

It's model-agnostic - the operations are pure tensor math on conditioning, so it works for image and video models alike. It patches the model and runs one of three strategies, chosen by strategy:

  • perpendicular - projects out the component of the aux conditioning that points along the main prompt (Perp-Neg orthogonalization). The aux contributes only its novel directions, so overlap and conflict simply vanish.
  • salient - per-element competition: the aux wins wherever it activates more strongly than the main prompt, and only there. Great when you want the aux to own the regions it's best at.
  • top_k - keeps only the strongest fraction of the aux prediction by absolute value and adds it. The tooltip's framing is right: "good for small details and targeted adjustments." k_ratio (default 0.05 = strongest 5%) is the dial.

The side input decides which half of the CFG equation the strategy hits: positive merges with your main prompt, negative merges with your negative prompt - the perpendicular-negative case is where this gets genuinely powerful, because orthogonal negatives can coexist without canceling each other. weight scales the aux effect (negative weights are legal and invert the contribution). There's also cfg_rescale (std-dev based CFG rescaling, the paper technique that tames over-exposure at high CFG - leave at 0 unless you're pushing CFG hard) and debug, which prints per-step diagnostics.

Outputs: model and conditioning. Wire the conditioning into your sampler's positive or negative socket; chain multiple NeutralPrompt nodes model→model to stack several strategies on the same run - the final CFG function processes all of them.

Inputs you'll actually set, condensed: main_conditioning, aux_conditioning, strategy, side, weight. That's the whole API, and the README is upfront that "some will respond better than others at various weights" - model behavior varies, so this is a tuning tool, not a set-and-forget.

Install

cd ComfyUI/custom_nodes
git clone https://github.com/valkymaera/ComfyCollectorNodes

or ComfyUI Manager → "ComfyCollectorNodes". Restart, find it in the "CCN" category. Stock deps, no downloads, MIT.

Common issues

The classic stumble is double-applying: this node patches the model to run the strategy, so wire its model output downstream, not the original model, or the strategy silently never runs and your "perpendicular" result looks like a plain merge. Weights also behave differently than prompt text weights - 1.0 is strong here, and salience/top_k are sensitive to k_ratio, so start at weight 1.0, k_ratio 0.05, and move one knob at a time. And because it re-encodes and processes conditioning every step, expect it to be a little slower than a flat merge on long video runs - the perpendicular math touches every element every step. The author's own note applies: results vary by model, so test against your base before trusting a recipe from someone else's workflow.

CategoryCCN

Inputs (9)

NameTypeDefaultDescription
modelMODEL
main_conditioningCONDITIONING
aux_conditioningCONDITIONING
strategyCOMBO3 options: perpendicular, salient, top_k
sideCOMBOWhich side of the CFG equation to apply the strategy to. 'positive' merges with the main prompt; 'negative' merges with the negative prompt.
weightFLOAT1.00-10–10Strength of the auxiliary conditioning effect
k_ratiooptFLOAT0.0500.001–1Top-K only: fraction of elements to keep (0.05 = strongest 5%%)
cfg_rescaleoptFLOAT0.000–1Std-dev based CFG rescaling (0 = disabled). Reduces over-exposure artifacts at high CFG.
debugoptBOOLEANfalsePrint per-step diagnostics to the console

Outputs (2)

NameTypeDescription
modelMODEL
conditioningCONDITIONING