ZwPrompt
Your Chinese prompt, auto-translated to English, straight into the sampler
- clip
- CONDITIONING
- STRING
You write your prompt in Chinese, hit queue, and out comes a picture that actually matches. That's the whole pitch of ZwPrompt: it's a drop-in replacement for ComfyUI's stock CLIPTextEncode that translates your Chinese text to English before the model ever sees it.
Why that matters: SDXL-lineage models - Illustrious, NoobAI, Pony, the whole tag-prompting family - are CLIP-encoded, and CLIP was trained on English token vocabulary. Feed it raw Chinese and it does its best, which is not great. The community workaround has been "translate your tags first, then paste them in," which is a workflow-killer mid-iteration. ZwPrompt just does the translation for you at encode time, so you stay in your own language the whole time you're tweaking.
It ships in ComfyUI-zw-tools (category ZwTools), a Chinese-language pack by the developer zzw5516 that's actually a small ecosystem: prompt nodes, a tag/word-bank manager, a history browser, and a file manager with cloud upload. ZwPrompt is the star of the two prompt nodes; its sibling ZwPromptText is the same thing without a CLIP input.
How it works
Mechanically it's barely more than CLIPTextEncode with a translation step bolted on the front. In the source, the encode() function does this:
- If the
enabled_transtoggle is on, passtextthroughtranslate(). translate()checks which backend you've configured (stored in the pack's local SQLite DB): 0 = off, 1 = Baidu Translate, 2 = the author's AI8808 API (DeepSeek-based).- Both backends short-circuit with a
has_chinese()check - if your text is already English, it passes through untouched. - The result goes through
clip.tokenize()→clip.encode_from_tokens(), and comes out as standard conditioning.
The translation backends are not LLM prompt rewriters - Baidu's free API does plain zh→en machine translation, which is honestly the right tool for tag text. One light aside: it won't make your prose poetic, but you're feeding tags to CLIP, so you don't want it to.
The inputs that matter
- text - your multiline prompt, in whatever language. The default is literally "双击 呼出 词库面板" ("double-click to open the word bank panel"), which is the pack's hint that double-clicking the textarea pops its tag-manager UI. You can delete that; it's just a placeholder.
- enabled_trans - the on/off translation switch (added in the 2025-12-01 update), so you can flip between your Chinese original and the English output without rebuilding the node.
- clip - wire in your model's CLIP, exactly like
CLIPTextEncode.
Outputs: a CONDITIONING (wire it straight into the KSampler's positive/negative) and a STRING holding the translated text. That second output is quietly the most useful thing here for debugging - hook it to a Show Text node and you can see exactly what English the model actually saw before you blame the checkpoint for a weird result.
Installing it
The usual two routes:
# via ComfyUI Manager: search "ComfyUI-zw-tools"
# or manually:
cd ComfyUI/custom_nodes
git clone https://github.com/zzw5516/ComfyUI-zw-tools
Then restart ComfyUI. Two setup notes, both grounded in the README:
pip install ffmpeg-pythonis a hard prerequisite - not because the prompt nodes use ffmpeg (they don't), but because the pack imports its file/video manager at module load. Skip it and the whole pack fails to import, taking ZwPrompt with it.- Right after install you must configure a translation backend in the pack's settings panel - a Baidu Translate
appid+ secret key, or an AI8808 API key (that one's a paid DeepSeek service and also powers the pack's AI prompt expansion). No key configured means the translation step silently does nothing and your Chinese goes through untranslated.
Where people get burned
The big one is the ffmpeg-python install above - a fresh install loads with both prompt nodes missing, and Manager won't tell you why. The second is proxy weirdness: if Baidu's API call fails, the code literally returns the string "Internet Error: 百度翻译失败,可能需要关闭网络代理" - i.e. "translation failed, you may want to turn off your network proxy." Proxies and Baidu's API don't get along. Finally, remember the passthrough: enable the toggle, feed English in, and nothing visibly happens. That's not a bug - that's the has_chinese() check working as designed.
One honest caveat: it's a convenience layer, not a magic quality dial. Verify the translated output once (the STRING output makes that easy) before you trust it across a long session.
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| enabled_trans | BOOLEAN | true | — |
| text | STRING | 双击 呼出 词库面板 | — |
| clip | CLIP | — |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| CONDITIONING | CONDITIONING | — |
| STRING | STRING | — |