Nodes/ComfyUI-KSTR-Nodes/CLIP Text Encode (Advanced, KSTR)
ComfyUI Node

CLIP Text Encode (Advanced, KSTR)

The Prompt-Weight Node That Knows Your Encoder Is Now an LLM

By Ye0l·Created 2 months ago·Updated about a month ago· 0
CLIP Text Encode (Advanced, KSTR)
  • clip
  • conditioning
text
token_normalizationmean
weight_interpretationcomfy

If you came up in A1111, you expect (important:1.4) to actually do something. Stock ComfyUI's CLIP Text Encode handles that fine on SD1.5 and SDXL. But the moment your model's text encoder became a language model - Qwen3 on Z-Image or Anima, T5 on Flux - that syntax is silently discarded, and most "advanced" encoders just give up. This node is the version that noticed the encoder landscape changed. It's a drop-in for CLIP Text Encode (Advanced) with two extra dials: token_normalization and weight_interpretation, and a special path for Anima.

How it works

The node tokenizes your prompt with word IDs, then rewrites the token weights before re-encoding. The two dials are the whole story:

  • token_normalization - none / mean / length / length+mean. mean recenters the weights so their average is 1.0 (stops a single (word:1.3) from pulling the whole prompt's emphasis). length divides each word's weight by the square root of its token count, so a long multi-token word doesn't get unintentionally overweighted. length+mean does both. Default is mean.
  • weight_interpretation - comfy / A1111 / compel / comfy++ / down_weight. Default is comfy, which is stock behavior with the normalization applied. A1111 encodes your prompt unweighted once, then multiplies the conditioning by the weight tensor and rescales - the flat, familiar scaling you know from WebUI. compel and comfy++ are the heavy lifters: they re-encode with masked-out tokens and take differences between the weighted and unweighted passes to build true attention-difference embeddings. down_weight scales weights down to a maximum of 1.0 and applies the masking approach. Expect these to be slower - they run several encode passes.

The genuinely interesting part is the Anima handling. ComfyUI's Anima encoder forces Qwen token weights to 1.0 and forwards T5 weights as conditioning metadata. A naive advanced encoder assumes an l stream key and breaks. This node detects the qwen3_06b/t5xxl token layout, skips the l-key assumption, and applies weighting to the T5 control stream instead - keeping Anima's native conditioning intact. On Anima, compel and comfy++ are effectively no-ops (there's no CLIP embedding stream to run mask-based algorithms against), so mean + A1111 or down_weight are the ones that do something there.

Inputs and output

  • text - the prompt, multiline.
  • clip - the CLIP/text encoder model.
  • token_normalization and weight_interpretation - as above.

Output is a single conditioning that plugs straight into your sampler, exactly like the stock node. No change to the rest of the graph.

Install

It ships in Ye0l/ComfyUI-KSTR-Nodes:

cd ComfyUI/custom_nodes
git clone https://github.com/Ye0l/ComfyUI-KSTR-Nodes

or search "ComfyUI-KSTR-Nodes" in ComfyUI Manager. Restart, and it's under Yeol/Conditioning. No extra dependencies.

Where to start

For a CLIP-era anime workflow (Illustrious, NoobAI, Pony), the combo most people land on is mean + comfy if you just want cleaner output, or mean + A1111 if you want WebUI-style weight feel back. The masking modes are for when you really need (concept:1.5) to bite without over-saturating. And if you're on Anima, keep the expectation low - weighting is fundamentally limited on an LLM encoder, and the author's own Anima fallback says so. One honest caveat: this pack is new and quiet in the community, so treat the fancier modes as "try and A/B it," not gospel.

CategoryYeol/Conditioning

Inputs (4)

NameTypeDefaultDescription
textSTRING
clipCLIP
token_normalizationCOMBOmean4 options: none, mean, length, length+mean
weight_interpretationCOMBOcomfy5 options: comfy, A1111, compel, comfy++, down_weight

Outputs (1)

NameTypeDescription
conditioningCONDITIONING