Token Count
See what your prompt costs in CLIP, T5 and Qwen tokens
- clip
- t5_clip
- token_info
"How many tokens is this prompt?" used to have one easy answer - 77, it was always 77 - and then the answer stopped being a constant. Flux encodes with T5-XXL, the newer LLM-encoded models use Qwen, and each one counts your words differently. TokenCounterdAIly (display name Token Count) is the small node from the dAIly pack that gives you the number for CLIP-L, T5 and Qwen at the same time, and it does it without you loading a single model.
Why you'd reach for it
People have been asking for a token counter in ComfyUI since the 77-token era, because "am I past the limit?" is a real question with real symptoms. On CLIP-based models (SD 1.5, SDXL, Illustrious, Pony) going past 77 means your prompt silently gets chunked and the tail of it gets less attention. On the LLM-encoded models there's no hard truncation, but there's a soft ceiling instead: communities consistently report drift and mushy output past roughly 75–100 effective tokens, even on models that officially accept thousands. So the count isn't trivia - it's the difference between a prompt that lands and one that quietly degrades. This node just makes the number visible instead of you having to guess.
How it works
Drop your prompt text in, and it counts tokens with three tokenizers: CLIP-L, T5-XXL (the Flux encoder), and Qwen. The neat part is that it doesn't need a model loaded to do it - if you don't connect anything it falls back to public tokenizers, so you can check a prompt in a bare workflow. If you do wire in a model it uses the real tokenizer for a more faithful count.
The output is a formatted string with the token and character counts, and it also rewrites the node title as you type, something like Tokens | C75 T312 Q189 | 420ch. That title trick is genuinely the nicest feature - you can watch your prompt grow toward the cap while you're still editing it, no separate display node required.
Inputs and outputs that matter
- text (STRING, multiline) - the only input you'll normally set. Paste your prompt here.
- clip and t5_clip (both CLIP, optional) - connect your actual CLIP and/or T5 model if you want exact per-model counts. Leave empty to use the fallback tokenizers.
- token_info (STRING) - the formatted result. This is an output node, so it doesn't need to feed anything; you can just read the string or wire it to a text display node.
Installation
It's part of the dAIly Prompt & Token Utils pack, so you get it alongside the CSV prompt mixers. Easiest route is ComfyUI Manager - search for "dAIly Prompt & Token Utils" (or just "dAIly") and install. Or, manually:
cd ComfyUI/custom_nodes
git clone https://github.com/DailyMok/ComfyUI-dAIly.git
Then restart ComfyUI. No model files to download and no heavy dependencies - the whole pack is lightweight.
Gotchas
The fallback count is a guide, not gospel: it uses the public tokenizer for each family, which usually matches your model but can drift a version or two behind the exact checkpoint you're running. If you're right on the edge of the cap, plug the real model in. And remember the number is per-encoder - on a Flux workflow the T5 column is the one that matters; on a Qwen-based model, it's the Qwen column. Look at the right number before you start deleting words.
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| text | STRING | — | |
| clipopt | CLIP | — | |
| t5_clipopt | CLIP | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| token_info | STRING | — |