Nodes/ComfyCollectorNodes/Conditioning Projection Removal (CCN)
ComfyUI Node

Conditioning Projection Removal (CCN)

A negative prompt for Flux and SD3, done pre-attention

By valkymaera·Created 4 months ago·Updated 10 days ago· 1
Conditioning Projection Removal (CCN)
  • positive
  • negative
  • conditioning
scale1.00
poolingmean
debugfalse

Here's the thing nobody warns you about when you switch to a flow model: on Flux Dev and Schnell, and SD3, there is no real negative prompt. Guidance distillation baked CFG into the weights, so the negative box is either ignored or a lie. The community workaround is usually Perp-Neg, which modifies the sampling process. Conditioning Projection Removal (CCN) attacks the problem earlier and lighter: instead of touching the sampler, it edits the conditioning itself, projecting the negative's direction out of the positive before attention ever sees it.

How it works

Vector projection is the whole mechanism, and it's genuinely elegant. It takes a positive and a negative conditioning, collapses the negative's token sequence into a single direction vector, then for every token in the positive subtracts the component that points along that negative direction. At scale = 1.0 you remove exactly the negative's directional influence; above 1 you overcorrect, actively pushing away from the negative; at 0 it's a pass-through.

The one real design choice is pooling - how to collapse the negative's many tokens into one concept axis:

  • mean (default) - average all tokens. The general-purpose choice.
  • max - take the single highest-norm token, i.e. the most "opinionated" word. Good when your negative is one sharp concept.
  • weighted_norm - average weighted by each token's norm, so stronger tokens dominate the direction.

Wiring it in

Wire your positive and negative conditioning (both can come from ordinary CLIPTextEncode nodes - the negative is just encoded text, not a real negative pass), pick scale and pooling, and out comes a single cleaned conditioning that replaces your positive. debug prints projection diagnostics (aligned token counts, norms) so you can see what the node actually did.

Install

ComfyUI Manager → search ComfyCollectorNodes → Install → restart. Or:

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

Restart, no pip step. It's under the (CCN) suffix.

Honest limitations, straight from the source

The author is upfront about the trade-offs, and you should be too. Mean-pooling a multi-concept negative dilutes each concept into one averaged direction, so complex negatives lose their edge - the suggested fix is to chain multiple nodes, each with a single focused negative. And because it operates in embedding space before attention, it can't leverage the model's own semantic interpretation the way post-attention methods like NAG can. In plain terms: it's a lightweight, cheap suppressor, great for a single "remove X" concept on a flow model, not a replacement for a proper negative prompt on models that have one. Set scale around 1 and tune up only if the concept persists; overcorrecting too far starts to distort unrelated content.

CategoryCCN/conditioning

Inputs (5)

NameTypeDefaultDescription
positiveCONDITIONING
negativeCONDITIONING
scaleFLOAT1.000–10Projection removal strength. 1.0 = remove exactly the negative's directional component. >1.0 = overcorrect, pushing away from the negative. 0 = no effect.
poolingCOMBOmeanHow to collapse the negative's token sequence into a single concept direction. mean = average all tokens (good general default). max = take the token with the largest norm (picks the most 'opinionated' token). weighted_norm = weight each token by its norm before averaging (emphasizes stronger tokens).
debugoptBOOLEANfalsePrint diagnostics to console

Outputs (1)

NameTypeDescription
conditioningCONDITIONING