Prompt Translate (Google, Fail-safe, Advanced)
Google Translate inside your graph — without an API key, and without it killing the run
- STRING
Most of the prompts that actually make good images are not in English. Japanese booru tags, Chinese model cards, a LoRA trigger word documented in French - you've either got a browser tab open or you're retyping garbage translations into CLIPTextEncode. The FailSafeTranslateAdvanced node (display name "Prompt Translate (Google, Fail-safe, Advanced)") puts a translator directly in your workflow: feed it a string, get a translated string back, wire that into your positive prompt. No API key, no account, no model download - it costs you nothing but a network call.
Here's the honest part about why this pack exists. The translation runs through deep-translator's GoogleTranslator, which scrapes the free public translate.google.com web endpoint. That's not an official API, it's the same page you use in a browser, and it's exactly as reliable as that implies - rate limits, captchas, and upstream breakage are a real Tuesday. The entire point of this node is that it treats translation as a flaky network dependency instead of pretending otherwise. It retries, it waits, and it lets you decide what happens when everything falls over.
What you actually set
The node only has a handful of knobs, and only a couple matter on day one:
- text (multiline STRING) - the prompt, tags, or text to translate.
- src_lang - source language. Quirk alert: this one has 24 choices and no
auto- the README saysautowas deliberately removed, so you have to name the source or use[No Translation]to pass text through untouched. - dest_lang - 25 choices including
auto, plusen, ja, zh-CN, zh-TW, ko, fr, de, es, it, ruand more. This is the field you'll actually change. - fail_mode - the interesting one, four ways to fail:
return_input- hand back the original text. The safe default for keeping a queue alive.return_cached- return the last successful translation this node produced. Heads-up from the source: that's the most recent success, not necessarily a translation of this text. If the previous prompt was a hit, you'll silently get its translation. Read the output before trusting it.return_error- return a[ERROR] ...string. Useful when you want to see it fail, but a poisoned string can end up inside your prompt if you wire it straight toCLIPTextEncode.raise- stop the workflow with an error. Loud and honest, but it takes down the whole run.
- retries (default 3, max 10) and retry_wait_sec (default 1.0, max 30) - how hard it fights the flaky endpoint before giving up.
The output is a single STRING. That's it - one wire, and it plugs into anything that takes text: CLIPTextEncode, CLIP Text Encode (Prompt), or another text node upstream of the encoder.
Install
ComfyUI Manager is the easy path - search "ComfyUI-FailSafe-Translate-Node" and hit install, restart, done. Or do it by hand:
cd ComfyUI/custom_nodes/
git clone https://github.com/ah-kun/ComfyUI-FailSafe-Translate-Node.git
pip install -r requirements.txt
The dependency list is exactly one package: deep-translator==1.11.4. No model files, no GPU requirement, no env vars. This is about as light as a custom node gets.
Where people get burned
- The endpoint flakes. If your translations randomly fail mid-run, that's the free Google endpoint, not your setup. Bump
retriesto 4–5 and setfail_modetoreturn_inputso a hiccup degrades to "original prompt" instead of a dead queue. In a bigger graph this is the difference between "one weird batch" and "I lost the whole generation." - The cache is per-node and in-memory. If you run the same request twice on the same node, it short-circuits and returns the cached string - great for repeat runs, but it resets when ComfyUI restarts, and it's shared across nothing else.
- Quality is Google quality. It's fine for prompts, but the community's standard advice when you care about the wording (say, for an English model card's style) is to use DeepL or an LLM instead. This node is for "good enough, in the graph," not literature.
- Silent pollution. Any
fail_modethat returns a string (all butraise) can inject an error message or a stale translation into your prompt. If your images suddenly look weird after a network hiccup, check what the node actually output.
Inputs (6)
| Name | Type | Default | Description |
|---|---|---|---|
| text | STRING | — | |
| src_lang | COMBO | en | 24 options: en, ja, zh-CN, zh-TW, ko, fr, +18 |
| dest_lang | COMBO | 25 options: auto, en, ja, zh-CN, zh-TW, ko, +19 | |
| fail_mode | COMBO | 4 options: return_input, return_cached, return_error, raise | |
| retries | INT | 30–10 | — |
| retry_wait_sec | FLOAT | 1.000–30 | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| STRING | STRING | — |