Nodes/ComfyUI-Text-Translation/Text Translation V2
ComfyUI Node

Text Translation V2

Don't Like the Default Translator? Text Translation V2 Lets You Pick

By pictorialink·Created about a year ago·Updated about a year ago· 12
Text Translation V2
    • string
    trans_switchtrue
    trans_text
    translator
    source_language
    target_language

    The plain Text Translation node does one thing well: anything you feed it comes out in English, via Bing, no questions asked. Text Translation V2 is the version that asks questions. You get to choose the engine - Bing, Google, or Alibaba - and you get to choose the source and target languages instead of being stuck with auto-detect-to-English. Same zero-key, zero-account deal, same translators library underneath, just with the dials exposed.

    When it's the one you want

    Most of the time, honestly, the plain node is enough: auto-detect → English is the right default for feeding a prompt to a CLIP/LLM text encoder. But you reach for V2 when:

    • Bing is rate-limiting or flaky from your region and Google behaves better. They're not interchangeable in practice.
    • You want English → your own language, not the other way around. Handy when you download a workflow whose prompts are in a language you don't read, or when you're translating a character prompt to check it says what you think it says.
    • You're translating into a language that isn't English and the plain node can't do that at all.

    The inputs that matter

    • trans_switch - boolean, on by default. On translates, off passes text through untouched. Same bypass trick as the plain node.
    • trans_text - the multiline text you want translated.
    • translator - Bing, Google, or Alibaba. Bing is the default, matching the plain node's behavior.
    • source_language - auto plus eleven languages. Keep it on auto unless you know better.
    • target_language - eleven languages, with English(en) first.

    The output is a single string, wired into a CLIP Text Encode or wherever the text goes next.

    Two mechanics worth knowing. First, the languages are stored as display strings like 中文(zh); the node parses out the code before calling the library, so what you see is what you pick. Second, the node ships with a front-end "Show / Hide button" - by default it hides the extra dropdowns behind a click, so a fresh node looks nearly as clean as the plain one until you need the controls.

    Installing and the known error

    Same install as the rest of the pack - ComfyUI Manager (search ComfyUI-Text-Translation), or:

    cd ComfyUI/custom_nodes
    git clone https://github.com/pictorialink/ComfyUI-Text-Translation
    cd ComfyUI-Text-Translation
    pip install -r requirements.txt
    

    Restart, and remember the pre-May-2024 versions are incompatible with the current pack - delete the old folder before updating.

    This node is literally the one the README shows in its error section:

    Prompt outputs failed validation
    Text_Translation_V2:
    - Value not in list: translator: 'alibaba' not in ['Bing', 'Google', 'Alibaba']
    

    After a pack update, an existing node can hold a stale widget value (say, a translator that no longer exists, or a lowercase one). It's not your fault and not your config. Delete the node and re-add it. If you're switching engines a lot, expect the occasional rate-limit hiccup from whichever endpoint you picked - that's the price of free.

    CategoryText Translation

    Inputs (5)

    NameTypeDefaultDescription
    trans_switchBOOLEANtrue
    trans_textSTRING
    translatorCOMBO3 options: Bing, Google, Alibaba
    source_languageCOMBO12 options: auto, 中文(zh), English(en), Español(es), عربية(ar), हिन्दी(hi), +6
    target_languageCOMBO11 options: English(en), 中文(zh), Español(es), عربية(ar), हिन्दी(hi), Русский(ru), +5

    Outputs (1)

    NameTypeDescription
    stringSTRING