Nodes/ComfyUI_TranslateLocally/Translate Locally (Offline)
ComfyUI Node

Translate Locally (Offline)

Translate Text Offline in ComfyUI, No API Key or GPU Needed

By Fictiverse·Created 7 months ago·Updated 7 months ago· 0
Translate Locally (Offline)
    • STRING
    text
    modelen-fr-tiny

    The name is honest: this node translates text on your machine, fully offline, and it never calls an API or asks for a key. Translate Locally (Offline) is the answer for anyone who keeps pasting prompts into DeepL or Google Translate between ComfyUI and the text encoder.

    Why bother? Prompt quality follows the language the model actually understands. Most checkpoints were trained on English prompt data, so a German or French prompt gets you a worse result than the same sentence translated first. This node puts the translation step directly in your graph - no browser tab, no copy-paste, no rate limits. It works just as well in reverse, taking a workflow's English output and localizing it.

    How it works

    Under the hood this pack is a wrapper. The heavy lifting is done by translateLocally.exe, a standalone CLI built by XapaJIaMnu - the node itself is maybe fifty lines of Python that shells out to the binary. It pipes your text in on stdin, runs translateLocally.exe -m <model>, and returns whatever comes back on stdout. The models are small CPU-friendly neural translation models (the tiny and base in the model codes), so there's no GPU and no VRAM pressure - this runs on the same box as ComfyUI, usually in a blink.

    One thing worth knowing: the model files aren't bundled. The first time you use a model code, it has to be downloaded - that's the job of the sibling Download and select Translate Model node.

    Inputs and output

    Only two inputs, and you'll touch both:

    • text (STRING, multiline) - the text to translate. Paste your prompt here or wire in a string from another node.
    • model (STRING, default en-fr-tiny) - the model code, like en-fr-tiny or de-en-base. It's a free-text field, which is exactly where typos happen. Wire the STRING output of SelectOrDownloadTranslateModel into this input and the code gets filled in for you - that's how the pack's example workflow is wired.

    The output is a single STRING with the translated text. Plug it into a Preview text node, a save node, or anything that accepts a string. If something goes wrong, the node returns an error message as the string output rather than crashing - so when output looks wrong, check the preview node's content, not just your console.

    Installing it

    The install has a manual step the package manager can't do for you. The repo has no requirements.txt - zero Python dependencies, which is refreshingly rare in this ecosystem. What it needs is the binary:

    cd ComfyUI/custom_nodes
    git clone https://github.com/Fictiverse/ComfyUI_TranslateLocally
    

    Then grab translateLocally.exe from the translateLocally releases page, rename it exactly to translateLocally.exe, and drop it into ComfyUI/custom_nodes/ComfyUI_TranslateLocally/. Restart ComfyUI. ComfyUI Manager can install the node code if it's in the registry, but it can't fetch the .exe - you're doing that part by hand either way.

    Gotchas

    • Windows only, effectively. The node globs for translateLocally*.exe, and the README says only Windows is tested. On Linux or Mac the glob finds nothing and you get the "not found" error string.
    • The first run needs the model downloaded. TranslateLocally itself only runs -m <model>; it doesn't fetch. Missing model → run Download and select Translate Model once with that code, then translate.
    • Trust matters more than usual here. You're downloading a binary and letting a custom node execute it with your full user permissions. The author says it plainly in the README: install only if you trust the upstream repo. Same rule of thumb that applies to every custom node in this ecosystem, just turned up a notch.

    Short version: if you translate prompts regularly and you're on Windows, this is the one I'd reach for - no keys, no API bills, and it sits quietly in your graph doing its one job.

    CategoryText / Translation

    Inputs (2)

    NameTypeDefaultDescription
    textSTRING
    modelSTRINGen-fr-tiny

    Outputs (1)

    NameTypeDescription
    STRINGSTRING