LlTokenizerOptions
The padding knob for LLM-based text encoders
- clip
- CLIP
If your model's text encoder is a language model - Qwen3, Qwen2.5-VL, Mistral3, the LLMs inside Klein and Z-Image - then your prompt goes through a tokenizer, and tokenizers pad. LlTokenizerOptions is the node that tells those tokenizers how much to pad, and it exists because padding is a silent quality killer.
The problem it solves
LLM-style encoders are built for fixed-length sequences: your prompt is tokenized, padded up to some length, and only then encoded into conditioning. Two failure modes follow. First, the padding itself gets encoded - a CLIP object stuffed with padded tokens can leak that padding into your conditioning. Second, the default lengths can be too short for long prompts, so the tail of your text gets truncated before it ever reaches the encoder. This is the real, widely-hit issue behind LLM-encoder image models: people write long prompts, the encoder silently cuts them, and the image just doesn't have what they asked for at the end of the prompt.
How it works
You feed in a clip, set min_padding and min_length (both integers, 0–10000, default 0), and get the patched clip back. The node clones the CLIP and calls set_tokenizer_option for four model families at once - qwen3_4b, qwen3_8b, qwen25_7b, and mistral3_24b - setting both a min_padding and a min_length option on each. The output is a CLIP, so you can slot it between your model loader / text encoder and everything downstream, or just wire it in place of your existing clip.
If you're hitting truncation with a long system prompt plus user prompt (the pack's own flagship is Klein system-prompt encoding), raising min_length gives the encoder room to actually see the whole text. The source marks it is_experimental=True and puts it in the _for_testing/conditioning category, so treat the numbers as knobs to test against your specific model rather than universal truths.
Honest warnings
- This is a conditioning-category, experimental node that only matters if your model uses one of those four LLM tokenizers. For SDXL/Flux-T5/CLIP-style encoders it does nothing useful.
- The tooltip-free interface means you're expected to know what you're doing. If
min_lengthsounds alien, you probably want the model-specific text-encode nodes in this same pack instead, which handle system-prompt templates for you.
Install
ComfyUI Manager → search ComfyUI_SamplingUtils, or:
cd ComfyUI/custom_nodes
git clone https://github.com/silveroxides/ComfyUI_SamplingUtils
then restart ComfyUI. Real requirements.txt deps: kornia, scipy, pilgram, opencv-python, unifiedefficientloader>=0.5.0. And the standing pack note - the README says DEPRECATED, install ComfyUI-UtilsCollection instead - matters more here than for the plumbing nodes, since experimental conditioning nodes are the first to be folded or renamed in a migration.
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| clip | CLIP | — | |
| min_padding | INT | 00–10000 | — |
| min_length | INT | 00–10000 | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| CLIP | CLIP | — |