Nodes/AlekPet/ComfyUI_Custom_Nodes_AlekPet/Google Translate CLIP Text Encode Node
ComfyUI Node

Google Translate CLIP Text Encode Node

Translate and encode in one node

By AlekPet·Created 3 years ago·Updated 10 days ago· 1,520
Google Translate CLIP Text Encode Node
  • clip
  • CONDITIONING
  • STRING
from_translateauto
to_translateen
manual_translatefalse
text

If you've ever built a prompt-translation graph the manual way - a translate node, then a separate CLIP Text Encode node, wired one into the other - this node collapses that into a single box. GoogleTranslateCLIPTextEncodeNode takes your non-English prompt and your CLIP model, and hands back conditioning ready for the sampler, with the Google Translate step baked in.

Why you'd reach for it

It's the same job as pairing GoogleTranslateTextNode with a standard CLIP Text Encode, just fewer nodes cluttering your graph. If you're not fussy about seeing the intermediate translated string, or you're building a template workflow you want to keep visually simple, this is the tidier choice. If you do want to inspect what got translated before it hits the model - useful when you're debugging why an image came out wrong - you get that for free here too, since it exposes the intermediate string as a second output rather than hiding it.

How it works

Same mechanism as the standalone translator: googletrans, the free unofficial wrapper around Google Translate's web interface, converts your text to the target language (English, by default, since that's what most checkpoints were trained on). The translated string is then run through a standard CLIP text encode against whatever CLIP model you feed in, producing conditioning in one pass.

The inputs and outputs that matter

  • text - your prompt, in your own language, multiline.
  • clip (CLIP, required) - the CLIP model to encode against. Comes from your checkpoint loader same as any CLIP Text Encode node.
  • from_translate (default auto) / to_translate (default en) - source/target language, 108 and 107 choices respectively. Leave to_translate on en unless your checkpoint was specifically trained on non-English captions.
  • manual_translate (default false) - leave off for normal use.
  • Outputs: CONDITIONING - wire this straight into your sampler like any other positive/negative conditioning - and STRING, the translated text itself, handy for a PreviewTextNode while you're checking the translation actually did what you expected.

How to install it

Via ComfyUI Manager: search "ComfyUI Custom Nodes AlekPet" and install. Manually:

cd ComfyUI/custom_nodes
git clone https://github.com/AlekPet/ComfyUI_Custom_Nodes_AlekPet

Restart ComfyUI - googletrans installs automatically on first launch. No model downloads for this node itself; the CLIP model you feed in comes from wherever you already load checkpoints.

Common issues & troubleshooting

Translation errors or timeouts. Same root cause as the standalone GoogleTranslateTextNode: googletrans scrapes an unofficial Google web endpoint, and that endpoint occasionally breaks or rate-limits without warning. If Google Translate works fine in your browser but this node throws errors, that's the tell - it's the library, not your install.

Output image looks wrong and you can't tell if it's the translation or the prompt itself. This is exactly what the second STRING output is for - plug it into a PreviewTextNode so you can see the exact English text that actually got encoded, instead of guessing. It's a much faster debug loop than assuming the translation was fine and hunting elsewhere.

You need to reuse the same translated text for multiple encodes (say, a positive and a separate style-conditioning pass). This combined node encodes once per call - if you need the translated string feeding into more than one CLIP Text Encode, it's cleaner to use the standalone GoogleTranslateTextNode once and wire its output into multiple encode nodes, rather than duplicating this combined node and paying for the translation twice.

CategoryAlekPet Nodes/conditioning

Inputs (5)

NameTypeDefaultDescription
from_translateCOMBOauto108 options: auto, af, sq, am, ar, hy, +102
to_translateCOMBOen107 options: af, sq, am, ar, hy, az, +101
manual_translateBOOLEANfalse
textSTRING
clipCLIP

Outputs (2)

NameTypeDescription
CONDITIONINGCONDITIONING
STRINGSTRING