Nodes/ComfyUI-UtilsCollection/Text Encode with Flux2 Klein System Prompt (Scaled Bias) (Legacy)
ComfyUI Node

Text Encode with Flux2 Klein System Prompt (Scaled Bias) (Legacy)

Klein's chat template with per-token emphasis on top

By silveroxides·Created 2 months ago·Updated about 7 hours ago· 24
Text Encode with Flux2 Klein System Prompt (Scaled Bias) (Legacy)
  • clip
  • CONDITIONING
prompt
system_prompt
thinking_content

Klein is the local editing workhorse of 2026 - small, fast, and genuinely good at changing one thing in a photo. But its Qwen3 encoder is a chat LLM: the prompt needs chatml <|im_start|> wrapping, a system message, and a <think> block, and like all LLM encoders it silently discards (word:1.3). This node is the Klein-aware encoder that handles the template and adds the scaled-bias syntax so you can emphasize specific tokens anyway.

How it works

It builds the exact Klein template - <|im_start|>system\n{system_prompt}<|im_end|>\n<|im_start|>user\n{prompt}<|im_end|>\n<|im_start|>assistant\n<think>\n{thinking_content}\n</think> - tokenizes with skip_template=True (no double-wrapping), and encodes to CONDITIONING. If you leave system_prompt empty the system turn is omitted; the think block is always present, empty by default, which is how the tokenizer expects it.

The scaled-bias layer runs before encoding: any <tag=strength> pattern in your prompt (like <dress=1.4>) is parsed out, and the token embeddings for that exact phrase are multiplied by the strength in the output conditioning. So you get emphasis that survives an LLM tokenizer that would have ignored (dress:1.4) entirely.

The inputs that matter:

  • clip - Klein's Qwen3 encoder.
  • prompt - the edit request, bias tags welcome.
  • system_prompt - optional behavior instructions.
  • thinking_content - optional injected reasoning. Leave empty for the structural placeholder, or feed it actual CoT text to steer the model's pre-render reasoning.

Why this over the plain Klein encoder

The pack's plain TextEncodeKleinSystemPrompt produces identical conditioning when your prompt has no <tag=strength> patterns - the bias parser is a no-op then. So the choice is really "will I use emphasis syntax?" For edit work, that's often yes: Klein understands "change the dress," but <dress=1.3> is how you say really change the dress when the surrounding context is busy. It's a finer control than rewriting the sentence.

Where people get burned

  • Strength range matters. 1.0–1.5 is the usable band; past ~1.5 you get oversaturated embeddings rather than crisper emphasis.
  • The bias parser only fires on the exact <name=number> shape. Freeform brackets like <<dress=1.4>> are left as literal text.
  • This is Klein's template - don't feed it Flux 2 dev's clip. Different encoder, different template family.

Installing it

Ships in silveroxides/ComfyUI-UtilsCollection. ComfyUI Manager: search ComfyUI-UtilsCollection, install, restart. Or manually:

cd ComfyUI/custom_nodes
git clone https://github.com/silveroxides/ComfyUI-UtilsCollection
cd ComfyUI-UtilsCollection
pip install -r requirements.txt   # opencv-python, typing-extensions

Restart. No node-specific model downloads. Legacy alias of UC_ScaledBiasTextEncodeKleinSystemPrompt, identical behavior.

Categoryadvanced/conditioning

Inputs (4)

NameTypeDefaultDescription
clipCLIP
promptSTRING
system_promptSTRING
thinking_contentSTRINGCustom thinking content to inject. Leave empty for default.

Outputs (1)

NameTypeDescription
CONDITIONINGCONDITIONING