Baidu translator 百度翻译
Your own Baidu app credentials, translated text straight into the graph
- app_id
- api_key
- text
Baidu's translator API, wired into ComfyUI with your own credentials. Feed it text, pick a target language, and out comes the translation as a STRING you can pipe anywhere - into a prompt encoder, into a display node, or into another node for further processing. The schema is nearly identical to the pack's Youdao node, just with Baidu's account model: an app_id and an api_key instead of Youdao's key/secret pair.
This is the version of the pack's Baidu node that works standalone. The sibling node BaiduTranslator (2lab) has no credential fields at all, because it routes through the 2lab cloud; this one, with the app_id/api_key inputs, calls Baidu directly with keys you own. If you're not on the 2lab platform, this is the one you want.
The inputs that matter:
app_idandapi_key(both KEY) - your credentials from Baidu's open platform. Register an app, enable the translation service, and these are what it gives you. Hidden field type, so they stay out of screenshots.text- what to translate, multiline.to_lang- target language, defaulten, withzhas the alternative. Note it'szhhere, notzh-CHSlike Youdao - every provider has its own codes, and Baidu's for Chinese is justzh.textout (STRING) - the translation.
Why would you use Baidu's translator specifically instead of any free option? If your workflow already lives in the Chinese ecosystem - Chinese checkpoints, Chinese prompts, Chinese model outputs - Baidu's engine is a solid, well-priced fit, and the pack's intended audience (developers publishing to the 2lab WeChat platform) is exactly that world. If you're outside it, the value is thinner: the same convenience, but you're signing up for a Baidu developer account mainly to feed a niche pack's node.
The honest caveats are the same ones that run through this pack: thin Chinese README, no English documentation or community, and a node that's a thin wrapper around an HTTP API. When it fails, you're reading Baidu's error response.
Installing it
Part of AI2lab/comfyUI-tool-2lab. ComfyUI Manager → search "comfyUI-tool-2lab" → install → restart, or:
cd ComfyUI/custom_nodes
git clone https://github.com/AI2lab/comfyUI-tool-2lab
Restart ComfyUI. No model downloads. You'll need a Baidu open-platform app to get app_id and api_key.
Common issues
Credential problems first: wrong app_id/api_key, or a translation service that's enabled on the app but not for the language pair you picked. Baidu's free tier also has rate and character limits that hit hard if you batch-translate a whole dataset - a mid-run failure is usually quota, not a bug. And because the node passes through the API's response, an error may arrive as a numeric Baidu error code rather than a friendly message; Baidu's docs decode them. None of it is GPU or local-workflow trouble - this node is a network call with a string output, and that's all.
Inputs (4)
| Name | Type | Default | Description |
|---|---|---|---|
| app_id | KEY | — | |
| api_key | KEY | — | |
| text | STRING | — | |
| to_lang | COMBO | en | 2 options: en, zh |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| text | STRING | — |