Text Encode with Z-Image System Prompt (Scaled Bias)
Qwen3 wants its <|im_start|> back
- clip
- CONDITIONING
Z-Image is the 6B Alibaba model that killed Flux 2's launch hype and became the community's default for local photorealism - and its text encoder is Qwen3-4B, a bilingual chat LLM that expects its conversation in <|im_start|>/<|im_end|> markup. If you've been feeding Z-Image through a plain CLIP Text Encode, your system prompt isn't going where the model expects it. UC_ScaledBiasTextEncodeZITSystemPrompt fixes that.
The mechanism
The node constructs a Qwen3-style chat template: a system turn containing your system_prompt, then a user turn with your prompt, then the assistant opening. That's the exact shape Z-Image's Qwen3-4B encoder was trained on. With the system prompt in the right slot, the model actually behaves like it's been told what it is instead of having "you are a photographer" dumped in as part of the user text.
On top of the template it runs the pack's scaled-bias encoder, so you get token-level emphasis that works with Qwen tokenizers: <cat=1.4> around a word scales that word's embeddings, the modern replacement for the SD-era (cat:1.4) syntax that Qwen reads as literal punctuation. Any prompt without emphasis tags just encodes normally, so it's safe as a straight drop-in for a plain text encode on Z-Image.
Inputs: clip, prompt (multiline), system_prompt (multiline). Leave the system prompt empty and it encodes with no wrapper. Output: one CONDITIONING socket for the sampler.
Why it matters for Z-Image specifically
The KB's Z-Image panel is blunt about the model's weaknesses - weaker complex-prompt adherence than Flux 2, a persistent Asian face bias - which makes getting the prompting stack right more important, not less. A properly slotted system prompt is a cheap, free improvement on the model's main documented weakness. And because the encoder is bilingual, the same template works in English or Chinese without you having to manage anything.
Install
Part of ComfyUI-UtilsCollection:
cd ComfyUI/custom_nodes
git clone https://github.com/silveroxides/ComfyUI-UtilsCollection
Restart, or install via ComfyUI Manager (search "UtilsCollection"). You bring the Z-Image CLIP; the pack adds no downloads. Requirements are opencv-python and typing-extensions, auto-installed.
Gotchas
Same family rule as always: this is the Z-Image variant, so don't wire a Klein or Flux 2 dev CLIP into it - the chat templates differ and the wrong one produces silently wrong conditioning. The whole scaled-bias family is marked experimental, so expect churn as the author tracks Core behavior. And when you see "clip input is invalid," the clip is actually None - check Load CLIP before anything else.
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| clip | CLIP | — | |
| prompt | STRING | — | |
| system_prompt | STRING | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| CONDITIONING | CONDITIONING | — |