Nodes/ComfyUI/T5 Tokenizer Options
ComfyUI Node Runs on cloud

T5 Tokenizer Options

The quiet tuning knob for T5-encoded models

By Comfy-Org·Created 4 years ago·Updated about an hour ago· 129,865
T5 Tokenizer Options
  • clip
  • CLIP
min_padding0
min_length0

T5 Tokenizer Options is the node that makes long prompts behave differently on T5-encoded models. It's a CLIP-in, CLIP-out node - it doesn't touch your conditioning directly, it changes how the tokenizer inside the CLIP model pads your text. And on the SD3 / SD3.5 / Chroma / Flux family of models, that padding is a real quality dial, not a curiosity.

The reason it exists: those models use T5-XXL (or T5-derived encoders) as their text backbone, and T5 tokenizers pad every prompt to a fixed length. Padding means your real tokens get diluted by filler. min_padding and min_length tell the tokenizer how much buffer to leave, which changes the encoding you get back - subtly, but measurably. In the community's own words about Chroma: "The min_padding value in T5 Tokenizer Options also modifies the image." It's the kind of setting you tune once and forget, but it's real.

How it works

You feed it a clip and two integers:

  • min_padding - minimum padding the tokenizer adds, default 0.
  • min_length - minimum token length to enforce, default 0.

The node clones your CLIP model and writes those values as tokenizer options for every T5-family encoder it knows about - t5xxl, mt5xl, umt5xxl, pile_t5xl, t5base - so whichever flavor your model uses, the setting lands. The output is the same CLIP object, now carrying the tokenizer tweaks, which you feed into CLIPTextEncode as usual.

What matters in practice

  • It's a clone. The node doesn't mutate your original CLIP; it clones and patches. You can run one branch with defaults and one with custom padding, then compare.
  • Zero is a real value. Defaults of 0 mean "let the tokenizer do its thing." Raising min_length forces a minimum sequence even for short prompts, which some T5-based workflows report stabilizes output.
  • Pair it with real prompting. T5 models reward long, natural-language descriptions. This node tunes how that text gets tokenized, not what it means.

Gotchas

It only applies to T5-family encoders. This is experimental and marked as such in ComfyUI - on SD 1.5/SDXL CLIP encoders, the options silently apply to nothing that matters. Don't put it in an SDXL workflow expecting a change.

The effect is subtle. If you're chasing a dramatic quality shift, this isn't it. It's a refinement for people who've already got the model, steps, and sampler dialed in and want the last few percent of prompt fidelity. One community report on Chroma even uses it as a deliberate image-mutation knob, which tells you both how subtle and how real the effect is.

Wrong order in the graph. It must be between the CLIP loader and CLIPTextEncode - the CLIP it outputs is the one you encode with. Put it after the encode and nothing changes.

Ships with ComfyUI core, no install. For SD3.5-class and Flux-family prompting nerds it's one of those "oh, that's what that does" nodes you discover after a hundred hours.

Categorymodel/conditioning

Inputs (3)

NameTypeDefaultDescription
clipCLIP
min_paddingINT00–10000
min_lengthINT00–10000

Outputs (1)

NameTypeDescription
CLIPCLIP