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

CLIP Text Encode (Translate)

The translate-then-encode prompt node

By DrStone1971·Created about a year ago·Updated about a year ago· 4
CLIP Text Encode (Translate)
  • clip
  • CONDITIONING
text
source_languageauto - Auto-detect
target_languageen - English

Every SD1.5, SDXL and Flux checkpoint you've ever loaded was trained on English captions. That's not a style preference - it's how the text encoder was taught to map words to image features, and it's why a prompt in French or Japanese quietly makes your renders worse in ways you can't always see. This node is the fix: a drop-in replacement for ComfyUI's stock CLIP Text Encode that translates your prompt to English before it's tokenized, so the box in front of you can be written in whatever language you actually think in.

It's the flagship of a small, quiet pack called ComfyUI-Prompt-Translator by DrStone71. The name "Translate" in the title isn't marketing - the translation is genuinely built in. There's no API key, no cloud call, nothing to sign up for. More on that below, because it's the part people don't believe.

How it works

The pipeline is: type prompt → detect its language → translate to your target language → hand the result to CLIP. Detection uses langdetect, with a fallback that reads character ranges and common stopwords when the detector chokes on short text. Translation is done by Argos Translate, an offline neural machine translation engine (OpenNMT models running on CTranslate2) - the same family of tools you might know from the argos-translate pip package. It's fully local: after the one-time model download, nothing touches the network and nothing costs money.

The "LLM" in the pack's tagline is really your text encoder. The pack's own line is "translate your prompt directly into the language used by your LLM" - for CLIP, SDXL's dual encoders, or Flux's T5, that language is English. This node is aimed squarely at the non-English speaker who's tired of writing prompts in a language they don't dream in.

The inputs that matter

  • text - your prompt, multiline. Write it in Italian, Russian, Japanese, whatever.
  • clip - wire your checkpoint's CLIP output here, same as any CLIP Text Encode.
  • source_language - default auto - Auto-detect, which is what you want 95% of the time. Pick a specific language if auto-detection keeps guessing wrong on short or mixed prompts.
  • target_language - default en - English. If source and target end up the same, the text passes through untouched - no wasted translation.

Output is a single CONDITIONING that plugs straight into the positive/negative inputs of a KSampler, exactly like the built-in node it replaces.

Installing it

ComfyUI Manager is the easy road: search ComfyUI-Prompt-Translator in Install Custom Nodes, install, restart. Or do it by hand:

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

Then restart ComfyUI. The pack's requirements.txt pulls argostranslate, langdetect, ctranslate2, sentencepiece, pyarrow, requests, and tqdm. The first two native builds (ctranslate2 and sentencepiece) are the ones pip occasionally grumbles about; if Manager doesn't auto-install deps, run pip install -r requirements.txt inside the cloned folder. You'll see the nodes under the 🌐 DrStone71 category.

Where people get burned

The first time you translate a given language pair, Argos has to download that pair's model package on the fly (roughly tens of megabytes, and it blocks until done). The console will print something like "Downloading translation package: it -> en". That's normal - it only happens once per pair. Do it once on a wired connection before you rely on the node for a batch. And remember: Argos quality is "good enough for prompts," not "literary translation." For short, tag-heavy anime prompts the output can feel stiff, but for real sentences - which is exactly what the natural-language checkpoints of the last couple years want - it's genuinely useful. If you want to preview the translation before it hits the sampler, run the sibling Text Translate node first and look at the string.

Category🌐 DrStone71

Inputs (4)

NameTypeDefaultDescription
textSTRING
clipCLIP
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
CONDITIONINGCONDITIONING