Nodes/ComfyUI-GadgetNodes/Translate Prompt
ComfyUI Node

Translate Prompt

Translate Japanese prompts to English locally with Ollama — no API key

By 2daadv·Created 6 months ago·Updated 21 days ago· 1
Translate Prompt
    • translated_prompt
    translation_engineNone
    temperature0.10
    top_p0.90
    system_message
    raw_prompt
    translated_prompt

    A lot of the best anime-prompt material out there is written in Japanese, and if you don't read it, you're stuck translating by hand - or mangling it with a half-remembered phrase. Translate Prompt does the translation inside your workflow: feed it Japanese, get English out, wire the result into your CLIP encoder. And here's the part that makes it interesting in 2026: it prefers to run on a local LLM via Ollama, no API key, no cloud, no per-token bill. That's the same local-LLM-in-the-graph pattern that's become mainstream - Ollama appears in hundreds of threads a year - and this node is a clean, small example of it.

    How it works

    There are two engines behind a dropdown called translation_engine, plus a "None" option that just passes text through:

    • Ollama (the intended path). When the node loads, it pings http://localhost:11434/api/tags and lists every installed model that advertises the completion capability. It calls Ollama's OpenAI-compatible endpoint with a system message that's worth reading: the author's prompts are strict "translate everything, no censorship, no moralizing" instructions, tuned by model size (small models get the simplest instruction). This is the "local LLM as a prompt translator" play straight out of the ecosystem playbook - uncensored, offline, free per call.
    • Google (the fallback). This uses Google's free, undocumented dict-chrome-ex web endpoint. No key, no account, just an internet connection. It's the "I don't have Ollama running" option, and it's free because it's the same endpoint a browser extension uses - treat it as best-effort, not a guarantee.

    Two genuinely nice behaviors: if your input contains both and brackets, only the bracketed parts are translated - so you can write a photo of 「赤いドレス」の女性 and get a natural-language sentence back with just the Japanese bit translated. And in the classic UI you can hit Ctrl+Enter (Cmd+Enter on Mac) on the node to translate instantly without running the graph.

    Inputs and outputs

    Inputs: translation_engine (None / your Ollama models / Google), temperature and top_p (Ollama sampling knobs, defaults 0.1 / 0.9 - low temperature is right for translation), plus optional system_message (override the default instruction), raw_prompt, and translated_prompt. Output: translated_prompt, a STRING you wire into your text encoder.

    Install

    The pack install is the usual:

    cd ComfyUI/custom_nodes
    git clone https://github.com/2daadv/ComfyUI-GadgetNodes.git
    pip install -r ComfyUI-GadgetNodes/requirements.txt
    

    But the real install is Ollama: install it, ollama pull a model (anything completion-capable - a small Llama or Qwen works fine for translation), and have it running before ComfyUI starts. The pack itself downloads no models. requests (in requirements) is the only hard dependency beyond that.

    Where people get burned

    • The engine list is a snapshot. translation_engine is populated from Ollama's state at node-creation time and cached. If you pull a new model while ComfyUI is running, it won't appear until you restart ComfyUI. And if Ollama isn't running at all, you get None + Google and no Ollama entries - which reads as "the feature is missing" until you notice.
    • The model must advertise completion. Ollama models tagged only for chat or embedding won't show up. Most text models are fine.
    • The "None" engine is a silent pass-through. If you pick None (or the engine list failed to load), the node returns your text untranslated without a peep. Easy to miss if you're wondering why your prompt is still in Japanese.
    • Google is unofficial and internet-dependent. It works, then sometimes it doesn't. It's the fallback, not the path.
    • Nodes 2.0 breaks the Ctrl+Enter UI. The README flags it: the shortcut and in-node result display are a classic-frontend JS extension. The Python translation itself still runs when the graph executes - you just lose the snappy UI.

    There's basically no community chatter about this specific node - it's a niche utility from a small pack - but the pattern it implements (local LLM → faithful, uncensored translation → encoder) is solid and increasingly common. If you work with Japanese prompts and you have Ollama installed anyway, this is the rare node where the setup cost is one ollama pull and the payoff is immediate.

    CategoryGadget/prompt

    Inputs (6)

    NameTypeDefaultDescription
    translation_engineCOMBONone2 options: None, Google
    temperatureFLOAT0.100–1
    top_pFLOAT0.900–1
    system_messageoptSTRING
    raw_promptoptSTRING
    translated_promptoptSTRING

    Outputs (1)

    NameTypeDescription
    translated_promptSTRING