ComfyUI Node

Text Translate

The pack's plain text-to-text node

By DrStone1971·Created about a year ago·Updated about a year ago· 4
Text Translate
    • translated_text
    text
    source_languageauto - Auto-detect
    target_languageen - English

    Some of the prompt-translation tools in this pack bundle the CLIP encode in with the translation. Text Translate doesn't. It's the plain, honest one: text goes in, translated text comes out as a plain STRING, and nothing else happens. That's its whole job, and it's exactly what you want when you need to see the translation, save it, or hand it to something that isn't a CLIP encoder.

    Why would you want that instead of the all-in-one nodes? A few reasons. You might be feeding a translated prompt into a Flux setup where CLIP-L and T5 want different text. You might want to eyeball the output once before committing it to a 50-step batch. Or you might be building a workflow where one translation feeds multiple encoders and you don't want the pack to re-translate (and re-download, and re-block) on every branch. Run Text Translate once, wire the translated_text string into everything downstream.

    How it works

    Same machinery as the rest of the pack: your text gets language-detected (via langdetect, with a scripted character-range fallback), then run through Argos Translate - an offline neural translation engine (OpenNMT on CTranslate2) that needs no API key and no internet after its per-pair models are downloaded. The whole pack is built on this one engine, so if you've already used CLIP Text Encode (Translate) once for a language pair, Text Translate for that same pair is instant - the model's already installed.

    Inputs and output

    • text - multiline, whatever you want translated.
    • source_language - default auto - Auto-detect. It guesses; if your text is very short or mixed-language it can guess wrong, so pin it if you see garbage.
    • target_language - default en - English. If it matches the detected source, you get your text back verbatim.

    One STRING output named translated_text. Wire it into a text display node, a save node, or into the text input of any normal prompt encoder.

    Installing

    ComfyUI Manager: search ComfyUI-Prompt-Translator, install, restart. Or:

    cd ComfyUI/custom_nodes
    git clone https://github.com/DrStone71/ComfyUI-Prompt-Translator
    

    Then restart ComfyUI. The pack needs argostranslate, langdetect, ctranslate2, and sentencepiece (plus a few smaller ones in requirements.txt). ctranslate2 and sentencepiece are the compiled native deps - if the node shows up but errors on import, install the requirements manually with pip install -r requirements.txt from inside the cloned folder. The node lives under 🌐 DrStone71.

    Gotchas worth knowing

    The big one is the first-run model download: the first time you translate a pair, Argos downloads that pair's model on the spot, and ComfyUI freezes until it's done. It prints progress in the console. It's one-time per pair, but it's a genuinely annoying surprise mid-workflow - consider using the pack's Language Package Manager node once to pre-install the pairs you actually use.

    Also worth being honest about: Argos is prompt-grade, not human-grade. For full sentences it's solid; for clipped tag soup it can mangle word order. If you're translating "1girl, standing, sunset" style prompts, check the output - you may find the English translation is actually worse than just writing the tags in English. Translation shines when your prompts are real sentences, which is exactly what the newer LLM-style encoders reward.

    Category🌐 DrStone71

    Inputs (3)

    NameTypeDefaultDescription
    textSTRING
    source_languageCOMBOauto - Auto-detect39 options: auto - Auto-detect, en - English, ar - Arabic (العربية), az - Azerbaijani (Azərbaycan), ca - Catalan (Català), zh - Chinese (中文), +33
    target_languageCOMBOen - English39 options: auto - Auto-detect, en - English, ar - Arabic (العربية), az - Azerbaijani (Azərbaycan), ca - Catalan (Català), zh - Chinese (中文), +33

    Outputs (1)

    NameTypeDescription
    translated_textSTRING