Nodes/ComfyUI-Prompt-Translator/Prompt Text (Translate)
ComfyUI Node

Prompt Text (Translate)

A text node with the right label

By DrStone1971·Created about a year ago·Updated about a year ago· 4
Prompt Text (Translate)
    • prompt
    promptprompt
    source_languageauto - Auto-detect
    target_languageen - English

    Prompt Text (Translate) is the pack's second text-only translator, and honestly, it's near-identical to Text Translate - same translation engine, same language dropdowns, same "string in, translated string out" contract. The difference is cosmetic but real: the input is called prompt and the output is called prompt, and the default text is literally the word "prompt". It's the variant designed to sit in a prompt pipeline where downstream nodes expect a port named prompt.

    That naming matters more than it sounds in ComfyUI. Lots of prompt-building and LLM-driven nodes expose a prompt port, and having a translator that presents itself the same way means you can drop it into an existing chain - one node expects a prompt string, this node provides one - without rewiring or adapters. It's the version you reach for when the graph reads like a sentence and you want the translator to just be part of that sentence.

    How it works

    Identical machinery to the rest of the pack: langdetect (with a scripted character-range fallback) detects the source language, Argos Translate translates it - offline OpenNMT on CTranslate2, no API key, no cloud - and the translated string comes out the prompt port. No CLIP involved here; if you want the encoding done in the same node, use CLIP Text Encode (Translate) instead. This one hands you the string so you can route it anywhere.

    Inputs and output

    • prompt - multiline, default text "prompt". This is your input.
    • source_language - default auto - Auto-detect.
    • target_language - default en - English. If source and target match, the text passes through unchanged.

    One STRING output, also named prompt, feeding whatever expects a prompt string next - typically the text input of a CLIP Text Encode, or any text-to-text chain.

    Installing it

    Standard for the pack. ComfyUI Manager, search ComfyUI-Prompt-Translator, install, restart:

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

    Restart; if the nodes fail to import, pip install -r requirements.txt inside the cloned folder (argostranslate, ctranslate2, sentencepiece are the notable deps). It lives under 🌐 DrStone71.

    Choosing between the twins

    If you don't care about the label, just use whichever one you already have on screen - there's no functional difference worth switching for. The one thing to check is whether your downstream node reads by port name; if it does, grab Prompt Text (Translate) so the wire says prompt → prompt and stays self-documenting. And the usual pack caveat applies: the first translation of a new language pair triggers a one-time Argos model download that blocks the graph, so expect one slow run per pair (or pre-install with Language Package Manager). Output quality is prompt-grade, not literature-grade - fine for full sentences, occasionally clumsy on clipped tag lists.

    Category🌐 DrStone71

    Inputs (3)

    NameTypeDefaultDescription
    promptSTRINGprompt
    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
    promptSTRING