Baidu Translate (PixNodes)
Free translation inside your workflow
- translated_text
If your workflow touches more than one language - a Chinese prompt that needs to become an English one for a model that behaves better in English, or a batch of captions to translate - then a translate node inside the graph beats copy-pasting into a web tab. Pix_BaiduTranslateNode wraps Baidu's free translation API (the same endpoint behind fanyi.baidu.com), with the keys saved locally so you enter them once. It's the cheapest serious translation option in the pack: Baidu's free tier is genuinely free, and the node's default model picks are built around that.
Inputs: appid and appkey (your Baidu translation API credentials), from_language and to_language dropdowns (auto / zh / cht / en / jp / kor / fra / de / ru), and text, the multiline text to translate. One output: translated_text as a STRING. The language list is where the pack's audience shows - zh, cht, en, jp, kor, fra, de, ru is a very China-plus-major-languages spread, and "auto" covers the rest.
The key handling is the part worth understanding, because it's shared across the whole pack. Credentials live in ComfyUI/user/PixNodes/api_key.json. Enter a valid appid/appkey once and run - they're saved to that file, and on later runs you can leave the fields empty and the node picks up the saved values. Conversely, if the API returns an auth error (52003 = unknown AppID, 54001 = bad signature), the node clears the stored credentials rather than failing forever - which is a thoughtful touch and also means "my keys disappeared" is a feature, not a bug. If translation suddenly stops with an auth error, that's why; re-enter the keys.
Mechanically it's the standard Baidu fanyi flow: an MD5-signed request with a random salt to the api.fanyi.baidu.com endpoint, 15-second timeout, multi-segment responses joined back into a single string. Signing is handled for you - the one thing you must get right is registering at Baidu's open platform and getting a real AppID/key pair; the free tier is enough for personal use.
The output is a plain string, so it feeds anything that accepts text - a prompt encoder, a Show Text node, or another PixNodes text consumer. If you're translating prompts for model-friendliness, this is the node to reach for; the alternative Pix_ChatGLM4Translate in the same pack is LLM-based (more context-aware, but needs a Zhipu API key), while this one is the zero-cost, no-LLM option.
Install is the standard PixNodes path - ComfyUI Manager, search PixNodes, restart - or:
cd ComfyUI/custom_nodes
git clone https://github.com/pixixai/Comfyui-PixNodes
cd Comfyui-PixNodes
pip install -r requirements.txt
then restart. Requirements are just openai and Requests - Requests is the one this node actually uses, and it's already present in most ComfyUI installs.
Two honest caveats. First, the free tier has rate limits and a character cap per call; batch a whole document rather than calling it per line. Second, this is an API node with a credential - the KB's security essay flags exactly this shape of node, so keep the pack updated and don't install random forks. That aside, it's the "just works" translation node of the suite.
Inputs (5)
| Name | Type | Default | Description |
|---|---|---|---|
| appid | STRING | — | |
| appkey | STRING | — | |
| from_language | COMBO | 自动检测(auto) | 9 options: 自动检测(auto), 简体中文(zh), 繁体中文(cht), 英文(en), 日文(jp), 韩文(kor), +3 |
| to_language | COMBO | 简体中文(zh) | 9 options: 自动检测(auto), 简体中文(zh), 繁体中文(cht), 英文(en), 日文(jp), 韩文(kor), +3 |
| text | STRING | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| translated_text | STRING | — |