Nodes/ComfyUI-FailSafe-Translate-Node/Prompt Translate (Google, Fail-safe)
ComfyUI Node

Prompt Translate (Google, Fail-safe)

Google Translate to English, right inside ComfyUI

By ah-kun·Created 9 months ago·Updated about a month ago· 1
Prompt Translate (Google, Fail-safe)
    • STRING
    text
    src_lang

    Ever paste a Japanese booru-tag prompt into a model that only listens to English and get pure mush out? The FailSafeTranslateSimple node (display name "Prompt Translate (Google, Fail-safe)") is the zero-config answer: two inputs, one output, nothing to tune. Drop your text in, pick the source language, and the English translation comes out the other end ready to wire into your CLIPTextEncode. It's the "I just want this to work" end of the same pack as the Advanced node.

    There's no API key and no account anywhere in this. It runs through deep-translator's GoogleTranslator, which talks to the free public translate.google.com endpoint - the same unofficial, scrape-the-website mechanism every no-key translate tool uses. That's why it can occasionally flake, and it's also why the node has retry and cache logic baked in: 3 retries with a 1-second wait, and if you feed it the same text twice on the same node, it returns the cached result without another network call. The [No Translation] option in the source-language list passes text straight through untouched, which is handy for prompt blocks you want left alone.

    The inputs

    • text (multiline STRING) - your prompt, tags, or raw text. Multiline matters: this is where a full prompt paragraph goes.
    • src_lang - the source language, with auto as the top choice and 24 others (en, ja, zh-CN, zh-TW, ko, fr, de, es, it, ru, pt, nl, pl, tr, ar, hi, bn, pa, jw, ms, vi, th, id) plus [No Translation]. auto does what it says - Google figures out the language. This is the one input you'll actually touch.

    Output is a single STRING holding the English translation. Wire it into anything that eats text - most commonly CLIPTextEncode for the positive prompt, or a concat/combine node if you want to merge it with other prompt fragments first.

    Install

    Via ComfyUI Manager, search "ComfyUI-FailSafe-Translate-Node" and install. By hand:

    cd ComfyUI/custom_nodes/
    git clone https://github.com/ah-kun/ComfyUI-FailSafe-Translate-Node.git
    pip install -r requirements.txt
    

    Then restart ComfyUI. Dependencies are exactly one package - deep-translator==1.11.4 - no model downloads, no GPU, no env setup. It's one of the lightest installs in the Manager catalog.

    The thing the name glosses over

    "Fail-safe" here is about retrying through flakiness, not never breaking your queue. Read the source and you'll find the Simple node hardcodes fail_mode="raise": if all 3 retries fail, the node raises an exception and the workflow stops with an error. The Advanced node is where you'd pick return_input (hand back the original text) or return_error (surface a [ERROR] string) instead.

    So the practical guidance: use Simple for quick interactive prompting where a visible error is fine, and if you're running long batches unattended - where one rate-limit hiccup from Google would kill the whole queue - swap in the Advanced sibling and set fail_mode to return_input. Same pack, same translator, one extra node for the guarantee.

    A couple of honest notes. The cache only lives in memory per node instance, so it resets on restart and won't dedupe across two separate nodes. And the translation quality is Google-quality - totally usable for prompt work, but if you're translating an English model card's carefully worded style guide for a Flux workflow, the community consensus is that DeepL or an LLM translator beats it. For "my Japanese tags, but English," this is genuinely the fastest thing in the graph.

    Categoryutils/text

    Inputs (2)

    NameTypeDefaultDescription
    textSTRING
    src_langCOMBO25 options: auto, en, ja, zh-CN, zh-TW, ko, +19

    Outputs (1)

    NameTypeDescription
    STRINGSTRING