Nodes/RES4LYF/ConditioningZeroAndTruncate
ComfyUI Node Runs on cloud

ConditioningZeroAndTruncate

The SD3.5-safe replacement for ConditioningZeroOut

By ClownsharkBatwing·Created 2 years ago·Updated 17 days ago· 1,222
ConditioningZeroAndTruncate
  • conditioning
  • conditioning

This node exists to fix a specific, silent problem with a stock ComfyUI node when you're running SD3.5. If you use ComfyUI's core ConditioningZeroOut to build an empty/null negative conditioning - the usual move when you're not running CFG, or just want a neutral negative - it zeroes out the embedding values but does not truncate the token count. If that conditioning originally came from a prompt longer than 77 tokens, the zeroed-out embedding keeps that long, un-truncated shape. Per this node's own description, that causes severe image-quality degradation specifically on SD3.5. ConditioningZeroAndTruncate does both jobs at once - zero it out and truncate to 77 tokens - so the bug never has a chance to bite.

How it works

Single-purpose node, same as its sibling ConditioningTruncate: no configuration, no parameters to set. Feed it a conditioning, it zeroes the embedding and truncates it to 77 tokens, and hands back the result. The node's own description is explicit that it's meant for negative conditioning on SD3.5.

The inputs and outputs that matter

  • conditioning (CONDITIONING) - whatever you'd normally route into ConditioningZeroOut for a null negative.

Output: conditioning (CONDITIONING), zeroed and truncated, ready for your sampler's negative slot.

It's a good example of how a fix that looks like it belongs upstream (in ComfyUI core) instead ends up living in a third-party pack, because the pack author is the one who actually hit the interaction and had a reason to chase it down. ConditioningZeroOut was never wrong for the models it was designed against - it's specifically SD3.5's CLIP behavior past 77 tokens that turns "zeroed but not truncated" from a harmless no-op into a real quality problem. Worth knowing the shape of that trap even outside SD3.5, since "zeroing an embedding doesn't automatically fix its shape" is a fair general lesson about conditioning nodes.

How to install it

Via ComfyUI Manager, search "RES4LYF". Or:

cd ComfyUI/custom_nodes
git clone https://github.com/ClownsharkBatwing/RES4LYF/
cd RES4LYF
pip install -r requirements.txt

then restart.

Common issues & troubleshooting

This is an easy trap because the failure mode is silent. ConditioningZeroOut still runs without error, still produces something that looks like a valid empty conditioning - it just quietly degrades quality on SD3.5 if the source prompt was long. If your SD3.5 outputs seem worse than they should be and you're using a null negative built from a lengthy prompt, check whether you're still on stock ConditioningZeroOut before looking anywhere else.

Swap it in wherever you'd use ConditioningZeroOut on SD3.5, nothing else changes. Same role in the graph, same expected use case - this just also handles the token-count side that the stock node misses.

Use it alongside ConditioningTruncate on your positive conditioning. They're a matched pair from the same pack, addressing the same 77-token CLIP-side issue on SD3.5 from the positive and negative sides respectively - using one without the other only closes half the gap.

CategoryRES4LYF/conditioning

Inputs (1)

NameTypeDefaultDescription
conditioningCONDITIONING

Outputs (1)

NameTypeDescription
conditioningCONDITIONING