Nodes/FunUI/FunUI Negative Erase
ComfyUI Node

FunUI Negative Erase

Giving the negative prompt a job at CFG 1

By digital-garbage·Created about a year ago·Updated a day ago· 21
FunUI Negative Erase
  • positive
  • negative
  • positive
  • status
◄strength0.00►
◄modeproject►
◄keep_sizetrue►

On a guidance-distilled model the negative prompt box is a decoration. At CFG 1 there is no unconditional pass for it to steer - ComfyUI doesn't weight it to zero, it doesn't compute it at all - so your carefully built "blurry, ugly, deformed, bad anatomy" is deleted before it can do anything. The field still renders, which is why "negative prompts don't work" is a post that reappears every couple of weeks.

FunUI Negative Erase is one attempt to give it a job. Not by restoring a second pass, the way NAG does, but by taking the negative's direction out of your positive prompt's words before the encoder's output ever reaches the sampler.

The mechanism

Pool the negative conditioning down to one unit vector - its direction in the encoder's space. Then, for each word (row) in the positive conditioning, remove the component that lies along that direction.

That's a projection, not a subtraction: h - a·(h·n)n. A word at right angles to the negative is untouched; at strength = 1, exactly the along-negative part is gone. It's a clean operation, and it's why strength 0 passes your positive through untouched - the node's default is off, so it can sit in a graph doing nothing until you want it.

Two modes:

  • project (default) - removes the part of each word pointing along the negative.
  • subtract - pulls every word away from the negative by a share of its own size. Blunter; a different shape of the same idea.

keep_size puts each word back on its original magnitude afterwards, so only its direction changed. That re-normalisation is capped, deliberately: without a cap, a word that was mostly the unwanted concept comes back as amplified rounding error, which is a much worse artifact than a weak word.

The node only touches text rows where the model tags them - on H3 the row kinds are tagged, so it edits the words and leaves the rest of the packed sequence alone. It writes nothing if the output isn't finite, so you never hand a NaN conditioning downstream.

Inputs and outputs

  • positive - the conditioning you want to edit.
  • negative - your negative prompt, encoded. The node pools this into one direction; a longer, more specific negative is not necessarily a better direction.
  • strength - 0 to 2, default 0. Start around 0.3–0.5. This is the only knob that matters.
  • mode and keep_size - leave on defaults until you've found a strength you like.

Out comes a new positive and a status string. Read it: off, there is no negative conditioning to take out, the negative prompt is empty or has no usable direction, so nothing was taken out. Those are all "nothing happened", stated plainly instead of failing.

Wire the new positive into the sampler and keep your negative conditioning wired as well - the sampler still wants the input even though it will ignore it at CFG 1.

An honest caveat

The pack itself marks this module experimental, and the author's own note is the reason: whether a plain sentence has a clean linear presence in an LLM text encoder was never really established. Nouns behave better than adjectives - "a hat" is a thing you can find a direction for, "ugly" is a modifier smeared across every token around it. So this is a lever to try, not a guarantee. It is not NAG, and it will not give you the tight control a working negative gives you on a CFG 4–7 model.

If you want the reliable version of this job on a distilled model, state the constraint positively - "clean studio background, sharp focus, plain seamless backdrop" - and treat Negative Erase as an extra push on top of that.

Installing it

cd ComfyUI/custom_nodes
git clone https://github.com/digital-garbage/FunUI
pip install -r requirements.txt

Manager or comfy node install FunUI also work; restart after either. The pack's Python dependencies are comfy-kitchen>=0.2.32 and gguf, and nothing here needs either - this node is pure torch. If the node is missing entirely, its module is switched off in Settings ▸ Modules or failed to load; the log names it.

Where people get burned

Cranking strength to 1.5 and getting mush. Past 1 you're removing more than the negative's share and the re-normalisation cap starts fighting you. The useful range is narrow and low.

A long rambling negative. Pooling a paragraph into one vector gets you the average of a paragraph. One or two concepts, stated as nouns.

Expecting it to work on SDXL. It'll run. It's aimed at models sampling at CFG 1, where there's nothing else in the negative slot anyway.

CategoryFunUI/Conditioning

Inputs (5)

NameTypeDefaultDescription
positiveCONDITIONING—
negativeCONDITIONING—
strengthFLOAT0.000–20 = off. How much of the negative prompt is taken out of the positive prompt's words (1 = all of it).
modeCOMBOprojectproject: removes the part of each word that lies along the negative's direction. subtract: pulls every word away from the negative by a share of its own size.
keep_sizeBOOLEANtruePut each word back on its original size, changing its direction only.

Outputs (2)

NameTypeDescription
positiveCONDITIONING—
statusSTRING—