ComfyUI Node

Translate Text

Translate Text

By Acly·Created 3 years ago·Updated about a month ago· 668
Translate Text
    • translation
    text

    Most diffusion models were trained overwhelmingly on English captions, so if you prompt in German or Japanese you tend to get mush. Translate Text is the fix: it takes a string in another language and hands back English, which you then feed to your text encoder. The genuinely nice part - and the thing that separates it from the "just call the DeepL API" nodes - is that it runs entirely locally. No API key, no account, no data leaving your machine, no per-request cost. It's powered by argos-translate, an offline translation engine, and once the language models are downloaded it works with no network at all.

    The clever bit is the language directive syntax, which lets you mix languages in one prompt. You mark a language switch with lang:xx, where xx is a two-letter code, and everything after it gets translated from that language until the next directive. lang:en (the default) passes text through untouched, which is perfect for the parts of a prompt you don't want mangled - booru tags, LoRA trigger words, style keywords, artist names. So you can write origami paperwork, lang:zh 狐狸和鹤, lang:en mountain view and get origami paperwork, Fox and crane, mountain view - the Chinese fragment translated, the English keywords left alone. For anyone who prompts in a non-English language but relies on English tags, that selective control is the whole value.

    The node is as simple as it gets on the surface:

    • text (STRING, multiline) - your input, directives and all. The multiline field means you can paste a full prompt.
    • translation (STRING) - the English result, ready to wire straight into a CLIP Text Encode.

    Under the hood it's a normal string in, string out, so it drops neatly in front of whatever encoder your model uses.

    Now the part that actually matters for getting it working: this node has a dependency the rest of the pack doesn't. Argos-translate isn't bundled. Per the README you need to pip install argostranslate (or run pip install -r requirements.txt from the pack folder) into the same Python environment ComfyUI uses. Get the environment wrong - installing into system Python while ComfyUI runs in a venv or an embedded portable build - and the node will fail to import or won't appear at all. That's the single most common way this one bites. Beyond that, the actual language models download automatically the first time you translate a given language, so the first run for each language needs internet and will pause while it fetches; after that it's fully offline.

    Installing the pack itself is the usual: "ComfyUI Nodes for External Tooling" in ComfyUI Manager, or cd custom_nodes && git clone https://github.com/Acly/comfyui-tooling-nodes.git from your ComfyUI directory, then restart. Just remember the pip step is separate and required for this specific node.

    A couple of honest expectations. Argos is a solid offline translator, not a large language model - it handles straightforward descriptive prompts well but won't nail idioms or heavy slang the way a cloud model might. For prompt text, where you mostly want the nouns and adjectives carried across faithfully, that's plenty. If a translation comes out oddly literal, that's the tradeoff for keeping it local and free, and it's usually the right trade. If the node throws an error mid-run rather than at load, it's typically the first-use model download failing on a flaky connection - retry with a working network and let it finish fetching.

    There's also a matching HTTP endpoint (/api/etn/translate/...) that external tools can hit for instant translation in their own UI, which is a hint at the pack's real purpose: it's backend plumbing for tools driving ComfyUI. But as a plain node in your graph, it's a clean, quiet way to prompt in your own language without shipping your text off to a third party.

    Categoryexternal_tooling

    Inputs (1)

    NameTypeDefaultDescription
    textSTRING

    Outputs (1)

    NameTypeDescription
    translationSTRING