Conditioning Clamp (CCN)
Stop extreme prompt embeddings from burning your image
- conditioning
- conditioning
Every conditioning tensor in ComfyUI is just a list of per-token embedding vectors, and like any tensor it can have outliers. Extreme values in that embedding often translate to extreme, burnt, or artifact-y pixels downstream. Conditioning Clamp (CCN) is the blunt instrument for that: it clamps every value in the conditioning tensor to a min_value / max_value range and passes the result to your sampler. Nothing fancy, nothing magical - just a hard cap on the numbers.
How it works
It takes your CONDITIONING, clones each entry's tensor, and runs torch.clamp(cond, min_value, max_value), with the pooled output and any attached metadata carried through untouched. Defaults are -4.0 to 4.0, which is a reasonable starting band for a lot of CLIP-style embeddings - tight enough to snip wild outliers, loose enough that you're not crushing normal signal. It prints the before/after min and max to the console so you can see what actually got clipped.
The inputs that matter
conditioning in, conditioning out - it's inline-safe, passes through unchanged in shape. min_value (default -4, range -20 to 0) and max_value (default 4, range 0 to 20) are the two knobs. If you're seeing "burn" - the overblown, washed-out, deep-fried look - the classic first suspect is CFG too high, not the conditioning magnitude, so rule that out first (on distilled models the answer is usually just CFG 1). But when you've got emphasis-heavy prompts or a model that produces hot embeddings, clamping is a legitimate, cheap experiment: set max_value to 2 or 3 and see whether the artifacts soften.
Install
Standard for this pack. ComfyUI Manager → search ComfyCollectorNodes → Install → restart, or:
cd ComfyUI/custom_nodes
git clone https://github.com/valkymaera/ComfyCollectorNodes
Restart ComfyUI; no pip step (no extra deps). It sits under the (CCN) suffix.
Where it won't help
Clamping is a magnitude fix, not a direction fix. If your problem is a wrong concept bleeding into the image rather than an overloaded one, you want subtraction, projection removal, or a negative prompt - tools that change what the conditioning says, not just how loud it is. And because it reshapes the value distribution, it can subtly shift color and contrast even when it "works," so treat it as a tuning knob to A/B, not a set-and-forget. For a one-line artifact tamer it does exactly what it says on the tin.
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| conditioning | CONDITIONING | — | |
| min_value | FLOAT | -4.0-20–0 | — |
| max_value | FLOAT | 4.00–20 | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| conditioning | CONDITIONING | — |