Text Encode Qwen Image (Qwen-only, Custom System)
Your Qwen-Image prompt is being run through a canned system prompt. This node lets you write your own.
- clip
- CONDITIONING
Qwen-Image is Alibaba's 20B MMDiT, and it's a text-to-image model that reads like an LLM. Your prompt isn't fed to it raw - it's wrapped in a chat template that starts with a fixed system message: "Describe the image by detailing the color, shape, size, texture, quantity, text, spatial relationships of the objects and background…" ComfyUI hardcodes that wrapper in its TextEncodeQwenImage node. TextEncodeQwenImageT2ICustom is a drop-in replacement that lets you edit the system prompt yourself.
This is the text-to-image sibling of the same pack's better-known TextEncodeQwenImageEditEnhanced (the Edit node). Where that one's README is all about character consistency for image editing, this node is the one you reach for when you're generating from nothing and you think the official system prompt is leaving quality on the table. The name is a small lie: it doesn't call any API and needs no key. It's a template switcher, not a new text encoder.
How it works
The node builds its own tokenizer, stuffs your system_template in as the llama_template, temporarily swaps it onto your CLIP object, tokenizes and encodes, then puts the original tokenizer back in a finally block so it can't leak into the rest of your graph. The {} in your template is where your prompt gets inserted. If the default template looks familiar, it should - it's byte-for-byte the official ComfyUI one, so the node behaves exactly like stock until you change it.
The "Qwen-only" in the display name is the load-bearing word. It expects the Qwen2.5-VL text encoder that ships inside the Qwen-Image checkpoint, and it reads ComfyUI's bundled comfy.text_encoders.qwen_image tokenizer files. Feed it a Flux or SDXL CLIP and it'll fall over.
The inputs that matter
- clip - your loaded Qwen-Image checkpoint's CLIP. This is the Qwen2.5-VL encoder; nothing else.
- prompt - your actual prompt, multiline.
- system_template - the chat template,
{}included. This is the whole point of the node. If you don't know what to write, the README points at Qwen's officialprompt_utils.py; a well-tuned system prompt (think: "rewrite this into detailed, specific visual language") is the poor-man's prompt-optimizer, the same trick the Qwen HF Spaces use with a separate LLM - except this runs locally with zero extra models.
Output is a single CONDITIONING, which wires straight into the positive (and negative, if you have a negative-system variant) input of your sampler alongside the empty latent.
Installing it
ComfyUI Manager → search Comfyui-CustomizeTextEncoder-Qwen-image → install, restart. Or the manual route:
cd ComfyUI/custom_nodes
git clone https://github.com/chenpipi0807/Comfyui-CustomizeTextEncoder-Qwen-image
# restart ComfyUI
There's no requirements.txt and no extra pip deps - it's a pure-Python shim over ComfyUI core. You do need a ComfyUI recent enough to have built-in Qwen-Image support (the comfy.text_encoders.qwen_image module), and you need the Qwen-Image checkpoint itself loaded normally. No additional model downloads for the node.
Where people get burned
- Lose the
{}and your prompt vanishes silently.system_template.format(prompt)with no placeholder doesn't error - it just never inserts your text, so every image comes from the template alone. That fails gray, not red. Keep exactly one{}. - Literal braces break it. Paste a JSON-heavy template (any
{/}not meant as the placeholder) and.format()throws aKeyError. Escape real braces as{{and}}. - Keep the chat markup. You're replacing a full
<|im_start|>system…<|im_end|>template, not writing a plain sentence. The model's tokenizer expects the whole thing, image-pad tokens and all. - Remember it's per-CLIP. If you switch the checkpoint in the same workflow, this node encodes with whatever CLIP you wired in, and it only speaks Qwen.
It's a niche tool - this page doesn't get much traffic for a reason. But if you've ever stared at a Qwen-Image result and suspected the baked-in system prompt was flattening your style, this is the clean way to find out.
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| clip | CLIP | — | |
| prompt | STRING | — | |
| system_template | STRING | <|im_start|>system Describe the image by detailing the color, shape, size, texture, quantity, text, spatial relationships of the objects and background:<|im_end|> <|im_start|>user {}<|im_end|> <|im_start|>assistant | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| CONDITIONING | CONDITIONING | — |