π Text Translate
Translate prompts locally with Helsinki-NLP β no API key, first run is the catch
- STRING
If you generate prompts in one language and your model understands another - or you collect prompts from non-English sources and want to normalize them - you need a translator in the graph. The Ace Nodes pack gives you two, and they couldn't be more different. ACE_TextTranslate is the privacy-friendly one: it downloads a real open-source translation model (Helsinki-NLP's opus-mt) and runs it entirely on your machine. No API key, no network per request, no prompts leaving your box.
It's part of π
Ace Nodes (hay86/ComfyUI_AceNodes), a one-author grab-bag with no big community footprint. The implementation is straightforward but has a couple of sharp edges you should know about before building a workflow on it.
How it works
The node maps your language codes to a model id like Helsinki-NLP/opus-mt-<from>-<to> and, on first use, downloads it via Hugging Face into ComfyUI/models/prompt_generator/. It then runs the seq2seq model with transformers and returns the translation. Three things to internalize:
- The first run downloads a model. Each language pair is a separate download, and opus-mt models run from a few hundred MB to over a gigabyte. Your first translation of a new pair can look like ComfyUI is frozen while it pulls weights. It's cached after that, so subsequent runs are instant.
- Not every pair exists. opus-mt covers the 28 languages in the dropdown, but not all 28Γ28 combinations are trained.
enβzhexists; some rarer directions don't, and the download will fail on Hugging Face. If you hit that, you need the pair that actually shipped, or the other translator. - It drops trailing periods. The output strips trailing
.from each line. Harmless for prompts, mildly annoying if you're translating prose.
Device handling is automatic (CUDA β MPS β CPU), and if from_lang equals to_lang it just passes the text through.
The inputs
text- multiline, one sentence per line works best; it translates line by line and reassembles.from_lang/to_lang- the 28-language dropdown, both defaulting toen. Watch that: like its siblingACE_TextGoogleTranslate, the defaults are enβen, so if you forget to setto_langyou'll get your input back unchanged.
Output is a single STRING, ready for a CLIP encoder.
Installing
ComfyUI Manager β search ComfyUI_AceNodes, or:
cd ComfyUI/custom_nodes
git clone https://github.com/hay86/ComfyUI_AceNodes
Then restart. This node specifically needs transformers and huggingface_hub, both in the pack's requirements.txt - which also drags in rembg, insightface, soundfile and the rest, the usual grab-bag tax.
Which translator to pick
The pack's ACE_TextGoogleTranslate is instant, free, and scrapes Google's mobile page - no downloads, but it breaks if Google changes markup and it sends your prompts to Google. This one is the opposite: heavier setup, fully local, and as reliable as the model is. If you're translating prompts in bulk or unattended, or you care about privacy, this is the better tool despite the first-run download. Just verify your language pair exists before you commit the workflow to it.
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| text | STRING | β | |
| from_lang | COMBO | en | 28 options: en, zh, es, hi, ar, pt, +22 |
| to_lang | COMBO | en | 28 options: en, zh, es, hi, ar, pt, +22 |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| STRING | STRING | β |