Nodes/ComfyUI-UtilsCollection/Text Encode with Z-Image Thinking Prompt (Legacy)
ComfyUI Node

Text Encode with Z-Image Thinking Prompt (Legacy)

Give Z-Image a thinking block it will actually use

By silveroxides·Created 2 months ago·Updated about 7 hours ago· 24
Text Encode with Z-Image Thinking Prompt (Legacy)
  • clip
  • CONDITIONING
prompt
thinking

Z-Image is Alibaba's 6B image model that made near-Flux quality run on a 12GB card, and one of its more interesting habits is that it thinks. Its Qwen3-VL-style encoder accepts a chain-of-thought block before the actual prompt - and what you put in that block meaningfully changes the render. This node is the smallest, most focused way to use that: TextEncodeZImageThinkPrompt takes a clip, a prompt, and a thinking string, and returns one CONDITIONING with the thinking block formatted into the Z-Image template.

That's the entire schema, and it's the appeal. There's no vlm_resolution combo, no VAE reference-latent stack, no autogrow - just text in, conditioning out. If you've ever hand-built the Z-Image chat template to inject a thinking block and gotten the angle brackets wrong at midnight, you already know why this node exists.

How thinking works on Z-Image

Z-Image's encoder reads the conversation like a chat model: a system/user/assistant exchange, with room for a reasoning section before the answer. The thinking field is where you tell the model how to approach the generation - the equivalent of "think step by step" translated to visual generation. In practice people use it for constraints: "the subject is a fox in snow; prioritize the red coat against the white background; avoid clutter in the upper third." The model then "reasons" about the scene before producing the prompt tokens that actually steer the diffusion pass.

The reason to put that in a separate thinking box instead of jamming it into the prompt is the same reason system prompts work: the model treats reasoning text differently from user text, and a clean separation produces more obedient results than a wall of mixed instructions. The tooltip-free schema keeps your options to two strings, so the main skill here is prompt design, not node plumbing.

A note on naming: this is the (Legacy)-tagged alias - the canonical node is UC_TextEncodeZImageThinkPrompt, and ComfyUI may suggest swapping. Identical behavior; take the swap. If you want a system prompt and thinking text, the pack's general TextEncodeSystemPrompt with model_type: z-image-thinking covers both in one node.

Install

Via ComfyUI Manager (search ComfyUI-UtilsCollection) or:

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

Restart ComfyUI. Deps are opencv-python and typing-extensions; nothing else downloads.

When you'd reach for it

When Z-Image is giving you generic compositions and you want to steer the reasoning before generation. Write the thinking block as a short set of priorities, keep the concrete description in prompt, and iterate on the thinking text like any other prompt knob. It won't fix a broken prompt - nothing will - but it's the right tool for a model that wants to be told how to think.

Categoryadvanced/conditioning

Inputs (3)

NameTypeDefaultDescription
clipCLIP
promptSTRING
thinkingSTRING

Outputs (1)

NameTypeDescription
CONDITIONINGCONDITIONING