Nodes/ComfyUI-UtilsCollection/System Prompt Encode
ComfyUI Node

System Prompt Encode

One node, five model templates

By silveroxides·Created 2 months ago·Updated about 7 hours ago· 24
System Prompt Encode
  • clip
  • CONDITIONING
model_typeflux2dev
prompt
system_prompt
thinking_content

If you've ever typed a system prompt into Core's CLIP Text Encode and watched it do exactly nothing, this node is the fix. Modern encoders - Z-Image's Qwen3, Krea 2's Qwen3-VL, Flux 2's Mistral - are chat models under the hood, and a bare string doesn't reach them. They need their chat template wrapped around it: <|im_start|>system blocks for the Qwen line, [SYSTEM_PROMPT] tags for Flux 2. UC_TextEncodeSystemPrompt picks the right wrapper for you, from one model_type dropdown.

What it is

A drop-in replacement for your standard text encode, with one extra job: it takes your system_prompt, wraps it in the exact template the selected model expects, and only then tokenizes and encodes your prompt. The output is a normal CONDITIONING you feed to a KSampler, exactly like you're used to.

The model_type options tell the story - flux2dev, klein, krea2, z-image, z-image-thinking. Each one changes the template:

  • flux2dev[SYSTEM_PROMPT]...[/SYSTEM_PROMPT][INST]prompt[/INST]
  • klein / krea2 / z-image<|im_start|>system\n...<|im_end|>...<|im_start|>assistant\n
  • z-image-thinking → same chat template but opens a <think> block so you can seed reasoning tokens

That last option is the interesting one. Z-Image's Qwen3 encoder genuinely understands a thinking block before the answer, and thinking_content lets you inject your own. It's a real knob for nudging composition and prompt adherence that plain encoding never exposed.

The inputs that matter

  • clip - your loaded text encoder. Wire whatever Core's Load CLIP gave you for the model you're prompting.
  • model_type - this is the one that actually changes behavior. Get it wrong and you get a template mismatch that usually shows up as weak, garbled conditioning rather than a hard error.
  • prompt - your actual text, braces and weights included.
  • system_prompt - the instructions to wrap. Leave empty and the node degrades to a plain encode.
  • thinking_content - only meaningful for klein and z-image-thinking. Empty means "let the model use its default."

Installing it

This is part of ComfyUI-UtilsCollection, so install the pack:

cd ComfyUI/custom_nodes
git clone https://github.com/silveroxides/ComfyUI-UtilsCollection

Then restart ComfyUI. ComfyUI Manager can do it too - search "ComfyUI-UtilsCollection". Dependencies are light (just opencv-python and typing-extensions), and the pack needs a recent ComfyUI since it's built on the current Core node API. Old installs just won't show the node.

Where people get burned

The classic mistake is leaving model_type on the default flux2dev while running Z-Image. You'll get conditioning, sure - but it's the wrong template, and the drift shows up as worse prompt adherence you can't easily explain. Set the dropdown to match the encoder you actually loaded. Also note thinking_content is silently ignored unless you're on a thinking-capable profile, so if your <think> text isn't doing anything, check which template you picked.

The pack is a big, fast-moving collection and several of its nodes are experimental. When ComfyUI updates Core's encoder behavior, this node tracks it - which is good - but it also means updating the pack matters more than with a static utility. Check the README's "Text encoding and conditioning" section when you're setting up a new model.

Categoryadvanced/conditioning

Inputs (5)

NameTypeDefaultDescription
clipCLIP
model_typeCOMBOflux2devSelect the model type to use the correct template format.
promptSTRING
system_promptSTRING
thinking_contentSTRINGCustom thinking content for Klein or the z-image-thinking profile. Leave empty for the model default.

Outputs (1)

NameTypeDescription
CONDITIONINGCONDITIONING