Nodes/ComfyUI_Zwng_Nodes/Simple Google Translater
ComfyUI Node

Simple Google Translater

Translate your prompt to English before it hits CLIP

By za-wa-n-go·Created 2 years ago·Updated about a year ago· 7
Simple Google Translater
    • text
    from_translateauto
    to_translateen
    manual_translatefalse
    text

    Most diffusion models were trained overwhelmingly on English captions and tags. If you naturally think and write in another language, typing your prompt straight into CLIP Text Encode in that language tends to underperform, even on models that technically handle some multilingual input. The community's standard workaround is to translate first and encode second. ZwngSimpleGoogleTranslater puts that step inside the graph instead of making you alt-tab to a translation site and paste the result back in.

    How it works

    It runs on googletrans, an unofficial Python library that wraps Google Translate's own web endpoint rather than the paid Cloud Translation API. That's the whole appeal: it's free and needs no API key, unlike a fair number of "translator node" packs that quietly expect you to bring your own OpenAI or DeepL key. It's also the whole catch. Since it's scraping a web frontend and not calling a supported, versioned API, it inherits that frontend's instability, and the pack's own README is upfront about it: low stability, and a hard 15,000-character cap per call. That's baked into how googletrans works, not something specific to how this node wraps it.

    The inputs and outputs that matter

    text is your multiline prompt going in. from_translate picks the source language out of a very long list (108 options), defaulting sensibly to auto so it detects the source language for you. to_translate picks the target, defaulting to en, which is the setting most people will actually leave alone since English is what most encoders expect.

    There's also a manual_translate toggle, off by default. Reading the name straight: leave it off and the node translates automatically every time the graph runs; flip it on if you want to stop it firing on its own, useful once you're happy with a translation and don't want every unrelated queue also re-hitting Google's endpoint.

    The single output is text, the translated result. Wire that directly into your CLIP Text Encode node instead of your original-language prompt.

    How to install it

    Via ComfyUI Manager: search "ComfyUI_Zwng_Nodes" or "Zwng", install, restart. Manually:

    cd ComfyUI/custom_nodes
    git clone https://github.com/za-wa-n-go/ComfyUI_Zwng_Nodes
    

    then restart. If ComfyUI Manager doesn't pull googletrans in for you automatically, install it by hand (pip install googletrans in your ComfyUI Python environment) so the import doesn't silently fail at startup. No model downloads involved, just the one Python package.

    Common issues & troubleshooting

    Translation comes back empty or the node errors out. This is the unofficial-scraper trade-off showing up. googletrans talks to a web endpoint that isn't a stable, documented API, so occasional failures and timeouts are expected, especially if you're calling it repeatedly in a short window. Retrying usually clears it; if it doesn't clear for a while, that's Google's side changing something underneath the library, not your workflow.

    Long prompts get cut off or fail outright. You're over the roughly 15k-character limit. This is rarely an issue for a single image prompt, but it'll bite if you're piping in a big block of concatenated text, like a batch of captions, rather than one prompt at a time.

    Output looks garbled or mistranslated. auto source detection works well on longer, clearer text but can guess wrong on very short or ambiguous input. If results look off, set from_translate explicitly instead of trusting auto-detect.

    Nothing changes downstream. Make sure this node's text output is actually wired into your CLIP Text Encode's text input, and not the other way around. Easy to get backwards when you're wiring a chain quickly by hand.

    CategoryZWNG

    Inputs (4)

    NameTypeDefaultDescription
    from_translateCOMBOauto108 options: auto, af, sq, am, ar, hy, +102
    to_translateCOMBOen107 options: af, sq, am, ar, hy, az, +101
    manual_translateCOMBOfalse2 options: true, false
    textSTRING

    Outputs (1)

    NameTypeDescription
    textSTRING