Nodes/Comfyui-ergouzi-Nodes/2🐕Baidu Translation API
ComfyUI Node

2🐕Baidu Translation API

Translate prompts between Chinese and English via Baidu's API

By 11dogzi·Created 2 years ago·Updated 2 years ago· 102
2🐕Baidu Translation API
    • TEXT
    textFree Baidu Translation API application website”https://fanyi-api.baidu.com/?ext_channel=Aldtype&fr=pcHeader“,Only the first time is required to input ID and KEY,More SD tutorials available on Bilibili @ 灵仙儿和二狗子🐕
    appid
    api_key
    Translation_mode

    Most prompt-translation nodes in the ComfyUI ecosystem lean on an OpenAI-compatible endpoint or a local model. This one doesn't - EG_FX_BDAPI ("Baidu Translation API") calls Baidu's translation service directly, which makes sense given the pack's author is a Chinese creator building for a Chinese-speaking audience where checkpoints are typically prompted in English but the person prompting thinks in Chinese. If that's not your situation, this is one of the few nodes in the pack you can safely skip; if it is, it's a genuinely convenient inline translator.

    How it works

    You type text into the text field, pick a Translation_mode (zh-en or en-zh), and the node calls Baidu's Fanyi (translation) API and returns the translated string. The default text in the field isn't a placeholder to delete blindly - it's the node's own built-in instructions, pointing you to Baidu's translation API signup page and noting that you only need to enter your appid and api_key once. That's a real account signup, on a Chinese cloud platform (fanyi-api.baidu.com), separate from anything ComfyUI or comfy.icu manages - this node authenticates to Baidu directly, not through any proxy.

    The inputs and outputs that matter

    • text (STRING, multiline, required) - the text to translate. Replace the default instructional text with your own prompt once you've got credentials set up.
    • appid (STRING, optional) - your Baidu Translate API app ID, from their developer console.
    • api_key (STRING, optional) - the matching API key.
    • Translation_mode (enum: zh-en / en-zh, optional) - direction of translation.

    Output is a single TEXT (STRING) - the translated result, ready to feed into a CLIP Text Encode or a prompt-concat node.

    How to install it

    ComfyUI Manager: search Comfyui-ergouzi-Nodes. Manual:

    cd ComfyUI/custom_nodes
    git clone https://github.com/11dogzi/Comfyui-ergouzi-Nodes.git
    

    Restart ComfyUI. Then, before this node does anything useful, go register for a free Baidu Translate API account at fanyi-api.baidu.com and get your appid/api_key pair - that's a one-time step per install, not per run. This English-titled repo is also the one the author's README marks as frozen, with newer development happening in a Chinese-named sibling pack - worth knowing if you're relying on this specific translation node long-term.

    Common issues & troubleshooting

    Node does nothing, or errors, with no obvious cause. The first thing to check is whether appid and api_key are actually filled in - without valid Baidu credentials the node has no way to call the translation service at all. This is the single most likely cause of a silent failure here.

    Signup process is entirely in Chinese and asks for identity verification. Baidu's developer console isn't built for an international audience; expect Chinese-language forms and, depending on the tier, phone or ID verification during signup. If that's a dealbreaker, an LLM-based translation node pointed at an OpenAI-compatible endpoint is the more accessible alternative for the same job.

    Rate limits or costs kick in at higher volume. Baidu's free tier for translation API is meant for light use; if you're translating prompts in a tight batch loop, check your account's quota before assuming the node itself is broken when calls start failing partway through a run.

    Category2🐕/🗒️Text

    Inputs (4)

    NameTypeDefaultDescription
    textSTRINGFree Baidu Translation API application website”https://fanyi-api.baidu.com/?ext_channel=Aldtype&fr=pcHeader“,Only the first time is required to input ID and KEY,More SD tutorials available on Bilibili @ 灵仙儿和二狗子🐕
    appidoptSTRING
    api_keyoptSTRING
    Translation_modeoptCOMBO2 options: zh-en, en-zh

    Outputs (1)

    NameTypeDescription
    TEXTSTRING