Local Ollama Translator Multilingual
Translate your prompts locally with Ollama — no API key, no cloud, no censor
- translated_text
- source_text
- thinking_text
The name is the pitch: this is a prompt translator that runs entirely on your own machine, using an Ollama model you already have. The Local Ollama Translator Multilingual node takes text in one language, translates it into any of 30 target languages, and hands the result to your CLIP Text Encode node. No Google Translate, no DeepL, no ChatGPT, no API key - nothing leaves your box except a localhost HTTP call.
Why does that matter for image work? Because most checkpoints were trained on English prompts, and the LLM encoders on modern bases (Flux, Z-Image, Qwen-tagged) are pickier about phrasing than the old CLIP ever was. If you write in Chinese, Japanese, or Spanish, your workflow improves the moment the prompt reads like a native prompt-writer wrote it. And unlike a hosted translator, a local one doesn't filter. The same reasons the community runs abliterated local LLMs for prompt enhancement apply here: uncensored, offline, free per call. If your prompt is the kind a cloud API would refuse, this is the translator that won't.
How it works
It builds a "hardened" system prompt that tells the model to treat your text as inert data and return only the translation, then streams to Ollama's /api/chat endpoint using only the Python standard library. The stream is parsed for content and thinking separately, which is how you get the optional reasoning trace. Three defenses are built in:
- Refusal retry. If the first reply matches a refusal pattern (checked in thirteen languages, from "I'm sorry, but I can't" to 对不起 and извините), it automatically re-runs once with a retry-mode prompt.
- Final-only pass. If a thinking model burns its whole token budget reasoning without producing a translation, it re-runs with thinking off.
- Localhost guard. Remote endpoints are blocked unless you explicitly flip
allow_remote_endpointto true.
The inputs that matter
There are a lot of widgets. Most you'll never touch. The ones a beginner actually sets:
- text - what you're translating.
- source_language - defaults to Auto Detect, which works.
- target_language - pick from 30.
- style - keep it on Image Prompt. This one matters: it tells the model to preserve comma-separated fragments, weights, brackets, and emphasis syntax instead of flattening your prompt into prose.
- preserve_terms - model names, LoRA triggers, file paths, URLs, brand names. Tokens you don't want touched. The default list is decent; add your own.
- model - the Ollama model name. This is where the Model Selector node's
model_overrideoutput plugs in. - thinking_enabled - off by default, and leave it off. Translation doesn't need visible reasoning; the tooltip says exactly that.
The rest are sensible defaults: temperature 0, top_p 0.7, num_ctx 8192 (ample for a prompt and lighter on VRAM than 32768), timeout_seconds 180 (an inactivity window for the stream, not a hard total timer), max_output_tokens 4096 as a runaway-thinking ceiling. force_rerun forces execution even if nothing changed; debug_logging prints what the node is doing to the console when something's wrong.
Outputs and wiring
Three outputs, all STRING: translated_text (the one you want), source_text (an echo of your input), and thinking_text (the reasoning trace, populated only when thinking is on and the model returns one). The canonical wiring:
translated_text → CLIP Text Encode: text
And remember the thing everyone forgets: this node only produces text. The clip input on CLIP Text Encode still needs to come from your checkpoint's loader. A translator doesn't replace the model-specific text encoder, it just feeds it.
Installing
ComfyUI Manager, search Local Ollama Translator, install, restart. Or:
cd ComfyUI/custom_nodes
git clone https://github.com/InfernusIntraMe/ComfyUI-Local-Ollama-Translator.git
Restart and Ctrl+F5. No Python dependencies - stdlib only - which is rare and good. What you do need is Ollama running with a multilingual model:
ollama pull qwen3:8b
ollama list
Troubleshooting
The README's list is honest and matches what the code actually does. Connection refused means Ollama isn't running or the endpoint isn't http://127.0.0.1:11434. Model missing - check ollama list, then restart ComfyUI so the selector refreshes. Thinking run is slow - turn thinking off. Model reasons forever with no translation - the auto final-pass should kick in; if that also hits the ceiling, raise max_output_tokens.
One privacy note worth knowing: since v1.1.4 the preview text is session-only and excluded from workflow JSON, but the source text widget and settings still live in the workflow file. Clear private text before you share one. The local-only default is the security story here - and it's the right one.
Inputs (23)
| Name | Type | Default | Description |
|---|---|---|---|
| text | STRING | a masked warrior beneath a violet moon, black armor, rain, cinematic lighting | — |
| source_language | COMBO | Auto Detect | 31 options: Auto Detect, English (American), Chinese (Simplified), Chinese (Traditional), Japanese, Korean, +25 |
| target_language | COMBO | Chinese (Simplified) | 30 options: English (American), Chinese (Simplified), Chinese (Traditional), Japanese, Korean, Spanish, +24 |
| style | COMBO | Image Prompt | 4 options: Natural, Image Prompt, Literal, UI Text |
| preserve_terms | STRING | ComfyUI, LoRA, GGUF, Flux, Krea 2, Z-Image, Qwen, Wan, SDXL | — |
| system_prompt_mode | COMBO | Hardened Built-In | 3 options: Hardened Built-In, Built-In + External Rules, External Prompt + Runtime Language Directive |
| external_system_prompt | STRING | — | |
| model | STRING | qwen3:8b | — |
| thinking_enabled | BOOLEAN | false | Off by default for fast everyday translation. Enable only when you want a visible reasoning trace or extra deliberation. |
| retry_on_refusal | BOOLEAN | true | — |
| endpoint | STRING | http://127.0.0.1:11434 | — |
| keep_alive | STRING | 0 | — |
| num_ctx | INT | 81920–262144 | Context window. 8192 is ample for normal prompt translation and uses less VRAM than 32768. |
| temperature | FLOAT | 0.000–2 | — |
| top_p | FLOAT | 0.700–1 | — |
| timeout_seconds | INT | 18010–1200 | Streaming inactivity timeout. It is no longer a hard limit on total generation time. |
| allow_remote_endpoint | BOOLEAN | false | — |
| force_rerun | BOOLEAN | false | — |
| debug_logging | BOOLEAN | false | — |
| thinking_effort | COMBO | Low | Used only when thinking_enabled is true. Low is recommended for prompt translation. |
| max_output_tokens | INT | 4096128–32768 | Hard ceiling for generated tokens. This bounds runaway thinking before the final translation. |
| system_promptopt | STRING | — | |
| model_overrideopt | STRING | — |
Outputs (3)
| Name | Type | Description |
|---|---|---|
| translated_text | STRING | — |
| source_text | STRING | — |
| thinking_text | STRING | — |