Local Translator
Translate your Japanese prompt to English on your own GPU — no API key, just ~10GB of Phi-4
- STRING
So you write prompts in Japanese and your checkpoint wants English - or you've been burned one too many times by a translator node that hits Google's rate limit mid-batch. The Local Translator node from the ComfyUI-Local-Translator pack answers that by doing what few translation nodes bother with: it loads a real 14.7B language model (Microsoft Phi-4, 4-bit quantized) onto your GPU and translates entirely on your machine. No API key, no per-call quota, no telemetry. The README even boasts "no censorship" with a little (笑) - which, for prompt writers, is often the whole point.
Set expectations first
This is not a polished beginner pack. The README opens with "CURRENTLY INTENDED FOR DEVELOPERS. NOT RECOMMENDED FOR BEGINNERS." The repo has about two stars, and the author's own last commit notes an incomplete fix for ComfyUI v0.3.56. You are the beta tester. If you just want a quick JP→EN prompt and don't care about local or uncensored, an API translator node or an Ollama-backed one is ten times easier. Reach for this one when offline matters, rate limits have bit you, or you need its trigger-keyword trick (below) to pin exact booru tags and trademarks.
How it works
On first run a prestartup script downloads unsloth/phi-4-unsloth-bnb-4bit from Hugging Face - about 10GB - into the node's own models/ folder. From then on it loads local_files_only=True. The node runs a standard transformers text-generation pipeline with a system prompt that says, plainly, "translate the message from the user into English." Decoding is greedy with num_beams=4, not sampling, so the same input gives the same output - which is the right call for a translator. The output is cached (an LRU of 10 entries), so re-running a workflow doesn't re-pay the generation cost.
The clever bit is ProxyForLM. The model is wrapped in a class that implements ComfyUI's model-management interface, so the graph treats the 14.7B LLM like any other text encoder: it loads to the GPU when the node runs and offloads back to CPU RAM (your text_encoder_offload_device) between calls. It won't hold both Phi-4 and your checkpoint resident - but expect a swap hiccup each time.
Inputs and outputs
Three inputs, and really only two you'll touch:
string(required) - the text to translate.optional(optional) - a template string that must contain%TRANSLATE%. The translated text is inserted at that spot and the whole template is returned. Leave it empty and you just get the raw translation.max_tokens(optional, default 512, range 1–2048) - generation budget. Default is plenty for a prompt; raise it for long prose.
One output: a plain STRING. Wire it straight into CLIPTextEncode's text input (or a save-text node) and your translated prompt feeds conditioning like any other string.
The distinctive feature is the keyword-pinning syntax baked into the system prompt. Put [pigtails hair] after a sentence and the model must express that sentence using your exact term; use [THE IDOLM@STER|アイドルマスター] and it keeps the trademark verbatim. That's the booru-tag/trademark precision a generic translator will never give you, and it's the main reason to pick this node over a plain one.
Installing
The README shrugs and says "same as other custom nodes," so:
cd ComfyUI/custom_nodes
git clone https://github.com/love2hina-net/ComfyUI-Local-Translator
# restart ComfyUI, then wait through the ~10GB model download on first use
ComfyUI Manager may find it if you search "Local-Translator," but this pack is small enough that the manual clone is the dependable route. Dependencies (transformers, bitsandbytes, accelerate, huggingface-hub) install automatically with the node.
Where people get burned
- The first run is a 10GB download followed by a slow first translation while the model loads. This is a batch-before-you-generate node, not a per-frame thing.
- VRAM. Phi-4 at 4-bit is ~9.4GB of weights. Budget for it.
- Windows. The 4-bit load path runs through
bitsandbytes, the eternal Windows/CUDA pain point. If it refuses to load, that's your first suspect. - The
optionalfield rejects any template without exactly one%TRANSLATE%- the node tells you in a validation error, but it's a stumble on the way in. - Output is always English. The target language is hardcoded in the system prompt; this node is a one-way street.
Honest verdict: overkill for most, genuinely right for a few. If you have the VRAM, want offline uncensored JP→EN prompt translation, and don't mind a bit of DIY on the bleeding edge - this is a neat, self-contained version of that.
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| string | STRING | — | |
| optionalopt | STRING | — | |
| max_tokensopt | INT | 5121–2048 | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| STRING | STRING | — |