Nodes/KayTool/𝙆 Baidu Translater
ComfyUI Node

𝙆 Baidu Translater

Bring your own API key, get Chinese/English translation

By kk8bit·Created 2 years ago·Updated about a year ago· 364
𝙆 Baidu Translater
    • A
    • B
    Text_A
    Text_B
    Translatetrue
    FromAuto
    ToEnglish
    ID
    Key

    The third of KayTool's translation nodes, and the odd one out: where AIO Translater and Tencent Translater run on a backend the pack's author manages for you, Baidu Translater wants your own credentials. You register at Baidu's Translate Open Platform (fanyi-api.baidu.com) for an App ID and App Key, plug them into the node, and it calls Baidu's translation API directly on your account. The trade-off is straightforward: more setup, but a translation path that's yours - no dependency on someone else's hosted proxy staying up.

    The language list here is also noticeably narrower than the other two translators in this pack: just Simplified Chinese, Traditional Chinese, and English (plus Auto-detect as a source option). If you need translation between other language pairs, AIO Translater or Tencent Translater cover far more ground; this node is specifically the Chinese/English one.

    How it works

    Same dual-slot pattern as Tencent Translater - Text_A and Text_B in, translated A and B out - plus a Translate toggle to switch the whole thing off (useful for testing your graph's wiring without spending API calls). The node's own tooltips are explicit about the two credential fields: ID is your Baidu App ID, Key is your Baidu App Key, both obtained by registering at the platform above. Per the pack's docs, once you've entered them the node saves that configuration for future use, so you're not expected to re-type your key every session.

    The inputs and outputs that matter

    • Text_A / Text_B (STRING, multiline) - text to translate.
    • From (choice of 4: Auto / Simplified Chinese / Traditional Chinese / English).
    • To (choice of 3: English / Simplified Chinese / Traditional Chinese).
    • ID / Key (STRING) - your Baidu App ID and App Key, per the node's own tooltips.
    • Translate (BOOLEAN, default true) - on/off switch.
    • A / B (STRING, outputs, each with a tooltip confirming they correspond to Text_A/Text_B).

    Installing it

    Bundled with the full KayTool pack: ComfyUI Manager → search KayTool → install → restart, or cd ComfyUI/custom_nodes && git clone https://github.com/kk8bit/KayTool and restart. On top of that, this specific node needs a free Baidu Translate Open Platform account - register at fanyi-api.baidu.com to get the App ID and App Key the node asks for.

    Common issues

    An empty or failed translation with this node points almost entirely at the credentials: a missing, expired, or mistyped ID/Key pair is the classic failure mode for any bring-your-own-API-key node, and unlike the other two translators in this pack there's no shared fallback to lean on if yours isn't working - you'll need to double-check the values against what Baidu's platform actually issued you. If you're only translating between Chinese and English, this node is genuinely the most self-contained option in the pack (your account, your limits, no dependency on the author's backend); for anything else, the language list is simply too narrow and you're better off with AIO Translater or Tencent Translater instead.

    CategoryKayTool/Translate

    Inputs (7)

    NameTypeDefaultDescription
    Text_ASTRING
    Text_BSTRING
    TranslateBOOLEANtrueToggle this switch to enable or disable the translation function. (切换此开关以启用或禁用翻译功能。)
    FromCOMBOAutoSelect the source language of the text. 'Auto' will automatically detect the language. (选择文本的源语言。'自动检测'将自动识别语言。)
    ToCOMBOEnglishChoose the target language into which the text will be translated. (选择文本要翻译成的目标语言。)
    IDSTRINGEnter your Baidu API App ID here. You can obtain an App ID and API key by registering at https://fanyi-api.baidu.com/. (在此处输入你的百度 API App ID。你可以通过注册 https://fanyi-api.baidu.com/ 获得 App ID 和 API 密钥。)
    KeySTRINGEnter your Baidu API App Key here. You can obtain an App ID and API key by registering at https://fanyi-api.baidu.com/. (在此处输入你的百度 API App Key。你可以通过注册 https://fanyi-api.baidu.com/ 获得 App ID 和 API 密钥。)

    Outputs (2)

    NameTypeDescription
    ASTRINGTranslated text corresponding to input Text A. (对应输入文本 A 的翻译文本。)
    BSTRINGTranslated text corresponding to input Text B. (对应输入文本 B 的翻译文本。)