Nodes/comfyui-local-ollama-translator/Local Ollama Translator Multilingual
ComfyUI Node

Local Ollama Translator Multilingual

Translate your prompts locally with Ollama — no API key, no cloud, no censor

By InfernusIntraMe·Created 2 months ago·Updated a day ago· 2
Local Ollama Translator Multilingual
    • translated_text
    • source_text
    • thinking_text
    texta masked warrior beneath a violet moon, black armor, rain, cinematic lighting
    source_languageAuto Detect
    target_languageChinese (Simplified)
    styleImage Prompt
    preserve_termsComfyUI, LoRA, GGUF, Flux, Krea 2, Z-Image, Qwen, Wan, SDXL
    system_prompt_modeHardened Built-In
    external_system_prompt
    modelqwen3:8b
    thinking_enabledfalse
    retry_on_refusaltrue
    endpointhttp://127.0.0.1:11434
    keep_alive0
    num_ctx8192
    temperature0.00
    top_p0.70
    timeout_seconds180
    allow_remote_endpointfalse
    force_rerunfalse
    debug_loggingfalse
    thinking_effortLow
    max_output_tokens4096
    system_prompt
    model_override

    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_endpoint to 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_override output 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.

    CategoryLocal/Ollama

    Inputs (23)

    NameTypeDefaultDescription
    textSTRINGa masked warrior beneath a violet moon, black armor, rain, cinematic lighting
    source_languageCOMBOAuto Detect31 options: Auto Detect, English (American), Chinese (Simplified), Chinese (Traditional), Japanese, Korean, +25
    target_languageCOMBOChinese (Simplified)30 options: English (American), Chinese (Simplified), Chinese (Traditional), Japanese, Korean, Spanish, +24
    styleCOMBOImage Prompt4 options: Natural, Image Prompt, Literal, UI Text
    preserve_termsSTRINGComfyUI, LoRA, GGUF, Flux, Krea 2, Z-Image, Qwen, Wan, SDXL
    system_prompt_modeCOMBOHardened Built-In3 options: Hardened Built-In, Built-In + External Rules, External Prompt + Runtime Language Directive
    external_system_promptSTRING
    modelSTRINGqwen3:8b
    thinking_enabledBOOLEANfalseOff by default for fast everyday translation. Enable only when you want a visible reasoning trace or extra deliberation.
    retry_on_refusalBOOLEANtrue
    endpointSTRINGhttp://127.0.0.1:11434
    keep_aliveSTRING0
    num_ctxINT81920–262144Context window. 8192 is ample for normal prompt translation and uses less VRAM than 32768.
    temperatureFLOAT0.000–2
    top_pFLOAT0.700–1
    timeout_secondsINT18010–1200Streaming inactivity timeout. It is no longer a hard limit on total generation time.
    allow_remote_endpointBOOLEANfalse
    force_rerunBOOLEANfalse
    debug_loggingBOOLEANfalse
    thinking_effortCOMBOLowUsed only when thinking_enabled is true. Low is recommended for prompt translation.
    max_output_tokensINT4096128–32768Hard ceiling for generated tokens. This bounds runaway thinking before the final translation.
    system_promptoptSTRING
    model_overrideoptSTRING

    Outputs (3)

    NameTypeDescription
    translated_textSTRING
    source_textSTRING
    thinking_textSTRING