Nodes/ComfyUI-Prompt-Translator/Universal Text Translate
ComfyUI Node

Universal Text Translate

Text, conditioning, or both

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

Universal Text Translate is the pack's swiss-army version of the translator. It can hand you just the translated string, just the CLIP conditioning, or both at once - controlled by a single output_type dropdown and whether you bother to wire in a CLIP model. If you're not sure which of the pack's translation nodes you need, this is a reasonable default: it covers the bases of Text Translate and CLIP Text Encode (Translate) in one node.

The catch, and it's a real one, is that "both" is only as good as the inputs you give it. The node is built so the CLIP half is optional, and it's honest about that - if you pick conditioning_only or both but leave the clip input empty, you'll get a None coming out of the conditioning port, which downstream nodes will cheerfully choke on. The trick is that conditioning is only generated when a clip is actually connected. It's a nice bit of flexibility, but it means the node's behavior depends on what you've wired up, and that's the kind of thing that bites you at 2am.

How it works

Exactly like the rest of the pack: langdetect (with a character-range fallback) figures out the source language, then Argos Translate - the offline OpenNMT-on-CTranslate2 engine, no API key, no cloud - translates to your target. The result gets tokenized and encoded through your CLIP model only if you asked for conditioning and provided a clip. Same first-run model download per language pair applies here as everywhere in this pack.

The inputs that matter

  • text - multiline, your prompt in whatever language.
  • source_language - default auto - Auto-detect. Pin it for short or weird text.
  • target_language - default en - English.
  • output_type - text_only, conditioning_only, or both (default). text_only doesn't need a clip at all.
  • clip (optional) - feed this to unlock the conditioning output.

Two outputs: translated_text (STRING) and conditioning (CONDITIONING). If you picked both, you can wire the string into a preview or a save node while the conditioning goes to your KSampler - handy for checking that the translation didn't mangle anything before a long render.

Installing it

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

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

Restart after cloning. The heavy deps to watch for are ctranslate2 and sentencepiece (compiled native libraries); the pack's requirements.txt lists those plus argostranslate, langdetect, pyarrow, requests, and tqdm. If the node errors on import, run pip install -r requirements.txt inside the cloned folder. It shows up under 🌐 DrStone71.

Where it gets fiddly

The None conditioning gotcha is the main one - double-check the clip wire if your KSampler suddenly complains. And remember the pack-wide first-run behavior: the first translation of any new language pair triggers a model download that freezes the graph until it's done, so pre-install the pairs you use with the Language Package Manager node, or accept one slow first run. One more honest note: with the default both and a connected clip, the node re-encodes on every queue run, so if you're only after the string, text_only skips the CLIP work entirely and is faster.

Category🌐 DrStone71

Inputs (5)

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
output_typeCOMBOboth3 options: text_only, conditioning_only, both
clipoptCLIP

Outputs (2)

NameTypeDescription
translated_textSTRING
conditioningCONDITIONING