Baidu Translate
Turn Chinese prompts into English CLIP food, in-graph
- text
Most checkpoints - SD, Flux, the whole lineage - were trained overwhelmingly on English captions. If you think in Chinese and prompt in Chinese, you're translating in your head or pasting into a separate browser tab before every run. BaiduTranslateNode puts that translation step directly in the graph: type your prompt in whatever language, get it translated, feed the result straight into your text encoder. No tab-switching, no copy-paste, and it's reusable across every workflow once it's wired in once.
How it works
It's a thin wrapper around Baidu's Translate API (百度翻译), one of the major machine-translation services in China alongside Google Translate and DeepL. You send it text plus a source and target language, and it sends back the translation - the node does nothing fancier than that API call. It's not a local model, so it needs network access and, importantly, your own API credentials (more on that below).
The languages exposed are limited to what the node's schema supports: auto-detect, Chinese, Traditional Chinese, and English, both directions. If you need other language pairs, this specific node won't do it - Baidu's API supports far more, but this node only exposes the four.
The inputs and outputs that matter
from_translate- source language:auto,zh(Chinese),cht(Traditional Chinese), oren(English). Defaults toauto, which is almost always what you want - let it detect rather than guessing wrong and getting garbage back.to_translate- target language:zh,en, orcht. Defaults toen, which is the practical default for feeding an English-trained CLIP encoder.baidu_appidandbaidu_appkey- your personal API credentials (see install below). Both are plain string fields.text- a multiline string field, your actual prompt or any text you want translated.
One output: text, a plain string - wire it into a CLIP Text Encode node (or anywhere else that wants a string) exactly like you would a manually typed prompt.
How to install it
Install the pack via ComfyUI Manager (search "ComfyUI-MingNodes") or manually:
cd ComfyUI/custom_nodes
git clone https://github.com/mingsky-ai/ComfyUI-MingNodes
then restart.
This node won't do anything without credentials, and getting them is a separate step from installing the node. Register for a free Baidu Translate developer account at fanyi-api.baidu.com, which the pack author explicitly calls out as free. That gives you an AppID and AppKey - paste those into the node's baidu_appid/baidu_appkey fields. There's no config file or environment variable here; the credentials live directly on the node, which means they'll be saved into any workflow JSON you export or share, so scrub them before posting a workflow publicly.
Common issues & troubleshooting
Node errors or returns nothing. Almost always missing or wrong credentials - double check the AppID and AppKey are pasted correctly with no stray whitespace, and that your Baidu developer account is actually active (registration sometimes needs a short approval step before the API starts responding).
Translation quality is inconsistent for creative/prompt-style text. Baidu Translate, like any general-purpose MT engine, is tuned for normal prose - it can mangle the comma-separated tag soup and stacked descriptors typical of SD/Flux prompts. Treat the output as a starting draft to clean up, not a guaranteed final prompt, especially for stylized or tag-heavy prompting styles.
You shared a workflow and now your API key is public. Because the credentials sit as plain fields on the node, they get baked into the exported workflow JSON. Clear both fields before sharing a workflow file or posting a screenshot with the node's widgets visible.
You need a language this node doesn't list. The dropdown only exposes auto/zh/cht/en. If you need Japanese, Korean, or anything else, this node can't do it even though Baidu's underlying API might - you'd need a different translation node or a manual API call.
Inputs (5)
| Name | Type | Default | Description |
|---|---|---|---|
| from_translate | COMBO | auto | 4 options: auto, zh, cht, en |
| to_translate | COMBO | en | 3 options: zh, en, cht |
| baidu_appid | STRING | — | |
| baidu_appkey | STRING | — | |
| text | STRING | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| text | STRING | — |