Nodes/ComfyUI Smart Model Loader/Conditioning Zero Out
ComfyUI Node

Conditioning Zero Out

The quiet node behind 'true darks'

By r-vage·Created 29 days ago·Updated 4 days ago· 2
Conditioning Zero Out
  • conditioning
  • model
  • conditioning
max_tokens0

Nobody gets excited about a node whose job is to empty out conditioning. But "Conditioning Zero Out" is exactly the kind of understated utility that makes a workflow behave. It takes a conditioning tensor and zeroes it - and, if you ask, truncates it down to a specific token length. That's the whole node, and both halves are more useful than they sound.

Why would you want a zeroed conditioning? The short answer: negative-space control and ablations. Zeroed conditioning is the "no signal" state - the neutral baseline every prompt is contrasted against. Feed a zeroed tensor as the negative side and you're testing what the model does with pure prompt adherence and no guidance from a negative at all. In some workflows that's exactly the trick behind cleaner true darks, and it's also the standard way to figure out what a prompt is actually contributing: zero it, sample, compare. The pack calls this "model-aware conditioning cleanup," which is marketing-speak for "truncate and zero in one step so nothing weird leaks downstream."

The clever part is the token-length handling. The node ships with a mapping of model architecture → base token count (SD1.5/SDXL → 77, SD3 → 154, Flux → 256, HiDream/LTXV → 128, WAN 2.1 → 512, and more). Connect a model and leave max_tokens at 0, and it auto-detects the right length and truncates to it - useful when a pipeline left you with a 256-token Flux conditioning but you're sampling with a 77-token SDXL model downstream. Set max_tokens above 0 and it overrides detection entirely. Set it to 0 with no model connected and you get a pure zero-out: the tensor keeps its original size, just with every value (and the pooled output, if present) zeroed. Dtype, device, and metadata are preserved, and the source conditioning isn't mutated.

Inputs

  • conditioning - the tensor to clear (required).
  • model - optional; drives auto token-length detection.
  • max_tokens - 0 = auto from model (or keep original if no model), >0 = explicit truncation length, up to 4096.

Output: conditioning, the zeroed (and optionally truncated) version.

Installing

cd ComfyUI/custom_nodes
git clone https://github.com/r-vage/ComfyUI_SmartModelLoader.git
cd ComfyUI_SmartModelLoader
python -m pip install -r requirements.txt

or ComfyUI Manager → ComfyUI Smart Model Loader, restart.

Common issues

  • "I connected a model and nothing got truncated" - if the model architecture isn't in the node's mapping, detection returns 0 and it does a pure zero-out with no truncation. That's the documented fallback, not a bug; set max_tokens explicitly if you need a specific length.
  • Sampling with zeroed everything - if you zero the positive and the negative, you've removed all guidance; expect a gray mush. The node is for one side of the pair.
  • Unknown architecture - newer models get added to the mapping over time, but when in doubt, measure: check what token count the encoder actually produced and set max_tokens to match.
Category🌒 Smart Model Loader/ Conditioning

Inputs (3)

NameTypeDefaultDescription
conditioningCONDITIONINGThe conditioning to zero out.
max_tokensINT00–4096Max token length. 0 = auto from model (or keep original if no model). Overrides model detection when > 0.
modeloptMODELOptional model input to auto-detect base token length for truncation.

Outputs (1)

NameTypeDescription
conditioningCONDITIONINGZeroed-out conditioning.