Google Translate (CLIP Text Encode)
Prompt in any language, conditioning out
- clip
- CONDITIONING
- STRING
The name is a lie, in the good way: this node doesn't call any official API and needs no key. It leans on googletrans, the Python library that scrapes Google Translate's free web endpoint. You type a prompt in Russian (or Italian, or anything), pick a target language, and the node translates it, then CLIP-encodes the result and hands you ready-to-use conditioning. If your first language isn't English - and a huge share of this pack's users are Russian-speaking, since the author's README is in Russian - this is the node that stops you from writing prompts in English with your fingers crossed.
It's forked from AlekPet's popular ComfyUI_Custom_Nodes_AlekPet set, which is where the translate-then-encode pattern comes from, and it's a fixture of prompt-engineering practice: models like SDXL and Flux respond best to prompts in the language they were trained to encode, and for most people that's English.
How it works
The flow is: your text → googletrans async translation (src = from_translate, dest = to_translate) → clip.tokenize() + clip.encode_from_tokens() → CONDITIONING. It also returns the translated string so you can see (and reuse) what it actually sent to the encoder. The translation runs async so the node doesn't stall the graph waiting on Google.
Inputs:
- from_translate - language dropdown, default
auto(auto-detect). ~245 language codes. - to_translate - target, default
en. - text - your prompt, multiline.
- clip - the CLIP model from your checkpoint loader.
Outputs: CONDITIONING (wire into the sampler's positive or negative) and STRING (the translated text).
The honest caveats
Free means fragile. googletrans scrapes a public endpoint Google didn't build for automation, so it gets rate-limited, and it's a known-flaky dependency across the Python ecosystem - if translations silently come back empty or error out, that's the library, not your graph. It also needs a live network connection on every run. And there's a subtle one: Google Translate is a mechanical translator, so model-specific prompt syntax - weight parentheses like (word:1.2), tag commas, exotic tokens - gets mangled in translation. If your workflow depends on weighted syntax, translate a clean-language version instead, or do the translating and then hand-edit the weights.
Install
ComfyUI Manager: search ComfyUI_Gayrat. By hand:
cd ComfyUI/custom_nodes
git clone https://github.com/gayratv/ComfyUI_Gayrat
cd ComfyUI_Gayrat
pip install -r requirements.txt
The pack's requirements.txt includes googletrans, so it installs with the pack. Restart ComfyUI and you'll find it under Gayrat/translate. It's part of a small personal grab-bag pack - fork of a well-known node, lightly modified - so if you already have AlekPet's pack installed, you may have this exact node under a different menu and can skip the duplicate.
Inputs (4)
| Name | Type | Default | Description |
|---|---|---|---|
| from_translate | COMBO | auto | 246 options: auto, abk, ace, ach, aar, af, +240 |
| to_translate | COMBO | en | 245 options: abk, ace, ach, aar, af, sq, +239 |
| text | STRING | — | |
| clip | CLIP | — |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| CONDITIONING | CONDITIONING | — |
| STRING | STRING | — |