Local Ollama Translator
The prompt translator that calls no API and needs no key
- translated_text
- source_text
If you've ever pulled a workflow off Civitai or grabbed a Chinese creator's graph (Qwen, Wan, and a big chunk of the video-community workflows ship with prompts in Simplified Chinese), you know the moment where you paste the prompt into some free translator, get machine-garbled text, and give up. Local Ollama Translator is the fix: an English ↔ Simplified Chinese translation node that runs entirely against the Ollama server on your own machine.
The name is a lie in the best way. It doesn't call Google Translate, DeepL, ChatGPT, or any external API, and it needs no key. By default it only talks to http://127.0.0.1:11434, and the code refuses to touch anything else unless you flip allow_remote_endpoint. Leave that off - your prompts never leave the box.
Also worth saying up front: this is a translator, not a prompt enhancer. It won't add detail or restructure your prompt the way an LLM enhancer does. It takes text in, translates it, and hands you back the same prompt in another language. That's a genuinely useful niche once you're running a multilingual-model workflow - Qwen, Wan, and Z-Image are all prompt-hungry and prompt-translation-aware - and for people working across the English and Chinese communities, it removes a real wall.
How it works
The node is a small, careful client for Ollama's /api/chat endpoint. It builds a strict system prompt from your settings - direction, style, and the preserve_terms list - sends your text as a chat message with stream: false, and reads back the model's reply. It then strips the usual LLM junk: <think> tags, "Translation:" preambles, code fences, and stray quotes. The whole thing runs on Python's standard library - no requests, no transformers, no heavy deps. requirements.txt is literally "no external Python dependencies," which for an LLM node is almost suspiciously clean - and it's the exact property the ecosystem's security lessons tell you to check for before installing any node that talks to a model.
The inputs that matter
You can ignore most of the fifteen inputs. These are the ones you'll actually touch:
- direction - Auto, English → Simplified Chinese, or Chinese → American English. Auto guesses the way to go, which is fine for one-off text.
- style - Natural, Image Prompt, Literal, or UI Text. Image Prompt is the default and the one you want: it preserves the comma-separated prompt structure and keeps proper nouns, model names, and LoRA trigger words untranslated.
- preserve_terms - the safety net for exactly those tokens. Defaults to
ComfyUI, LoRA, GGUF, Flux, Krea 2, Z-Image, Qwen, Wan, SDXL; add your own model names and trigger words so they don't get translated into gibberish. - model - defaults to
qwen2.5:7b, which is a sensible pick: small, multilingual, fits on a consumer card alongside the diffusion model. Whatever you set has to exist in Ollama. - num_ctx - the Ollama context window, not a seed. Default
32768is generous; drop to8192for short prompt work. The README is explicit about this because people keep mistaking it for a seed.
The outputs are translated_text and source_text, both STRING. Wire translated_text into a CLIP Text Encode's text input - and keep your own text encoder feeding the clip input, because this node only translates; it does not replace the encoder. There's also a GUI preview on the node itself (a DOM widget, not just a console log), so you can eyeball the translation before anything gets queued.
Installing
Ollama has to be installed and running first - this node is a client, not a server:
ollama pull qwen2.5:7b
Then install the pack itself, either via ComfyUI Manager (search "comfyui-local-ollama-translator") or:
cd ComfyUI/custom_nodes
git clone https://github.com/InfernusIntraMe/ComfyUI-Local-Ollama-Translator.git
Restart ComfyUI and it appears under Local/Ollama/Local Ollama Translator. No pip step, no model download into ComfyUI - the only moving part is Ollama.
Gotchas
- "Could not reach Ollama at …" - that's the node's own error, and it means Ollama isn't running, or the
modelfield names something you haven't pulled. Checkollama list. - "Remote Ollama endpoint blocked" - the privacy guard doing its job. If you genuinely have Ollama on another machine, flip
allow_remote_endpoint; don't be surprised it defaults to off. - Sharing workflows - ComfyUI bakes widget values into the JSON, so your prompt and the translation preview get saved with the file. The README tells you to clear them before uploading a public workflow, and that's not paranoia.
The honest caveat: a 7B chat model is not a frontier translation engine, so idiomatic phrasing will occasionally come back stiffer than DeepL would give you. What you trade for that is a translation that's private, offline, and free per call - and for prompt work, that's usually a good deal.
Inputs (15)
| Name | Type | Default | Description |
|---|---|---|---|
| text | STRING | a cinematic mountain landscape, storm clouds, dramatic lighting | — |
| direction | COMBO | English → Simplified Chinese | 3 options: Auto, English → Simplified Chinese, Chinese → American English |
| 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 | — |
| extra_instruction | STRING | — | |
| model | STRING | qwen2.5:7b | — |
| endpoint | STRING | http://127.0.0.1:11434 | — |
| keep_alive | STRING | 0 | — |
| num_ctx | INT | 327680–262144 | — |
| temperature | FLOAT | 0.000–2 | — |
| top_p | FLOAT | 0.700–1 | — |
| timeout_seconds | INT | 12010–600 | — |
| allow_remote_endpoint | BOOLEAN | false | — |
| force_rerun | BOOLEAN | false | — |
| debug_logging | BOOLEAN | false | — |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| translated_text | STRING | — |
| source_text | STRING | — |