ComfyUI Node

LLM Translator

One node, one job — and it does it well

By ComfyUI-Kelin·Created 2 years ago·Updated 4 months ago· 27
LLM Translator
  • llm_config
  • translated_text
provider
model
text
target_languageEnglish
glossary

The translation node that's exactly as boring as it should be

ComfyUI's normal flow is prompts in, images out - but the moment you're working with non-English checkpoints, Chinese model cards, or a batch of Japanese captions you want to localize, you need translation in the middle of a graph. LLM Translator is the pack's "do one thing and do it well" node: paste text, pick a target language, get translated text back. It's deliberately not a chat node, not a prompt enhancer, not a rewrite tool - just translation, with a glossary knob for keeping your domain terms consistent.

It's part of ComfyUI-LLMs-Toolkit, the HuangYuChuh pack that wires DeepSeek/Qwen/GPT-style APIs into ComfyUI. That means no local model: this node burns API tokens, and it's cheap to run because it's a single short call per invocation. Where I reach for it: translating prompt templates before feeding them to a KSampler, converting an English workflow's text nodes for a Chinese-speaking friend, or batch-subtitling workflows that process scripts.

How it works

The node builds a system instruction - "You are a professional translator. Translate the following text into [language]. Maintain the original tone, style, and formatting. Output ONLY the translated text, no explanations." - and sends your text as the user message with a fixed temperature of 0.3 (low, so it stays literal) and up to 4096 tokens. The model is picked from your configured providers, so whatever's enabled in the LLMs_Manager panel is what's available.

The interesting extra is glossary. It's an optional multiline field where you pin down terms line by line: LoRA = LoRA, Checkpoint = 检查点, Workflow = 工作流. Those get appended to the system instruction as "strictly follow" rules, which fixes the classic translation failure where a model decides "LoRA" should become a weird paraphrase. If you're translating technical content, this is the difference between usable output and output you'll re-edit.

Inputs and output

  • text (required, multiline) - the content to translate. Empty text is skipped entirely and returns an empty string, so a node feeding this can be dry without breaking the graph.
  • target_language - a 13-language dropdown (English, both Chineses, Japanese, Korean, French, German, Spanish, Russian, Italian, Portuguese, Dutch, Arabic), default English.
  • provider and model - dropdowns populated from your enabled providers. If nothing's configured they show "None", which is your cue to set up the LLMs_Manager first.
  • llm_config (optional) - connect an LLMs Loader node here and it overrides the dropdowns entirely.
  • glossary (optional) - the term-mapping field above.
  • Output: translated_text (STRING).

Installing

Same pack, same one-time install. ComfyUI Manager → search ComfyUI-LLMs-Toolkit → Install → restart, or:

cd ComfyUI/custom_nodes
git clone https://github.com/HuangYuChuh/ComfyUI-LLMs-Toolkit
cd ComfyUI-LLMs-Toolkit
pip install -r requirements.txt

Dependencies are just Pillow and aiohttp; nothing heavy, no models to download.

Gotchas

Two things bite people here. First, this node reads provider config at dropdown-build time - so if you add a provider in the LLMs_Manager and the translator's dropdown still says "None" or looks stale, refresh the browser. Second, failure handling: if the API call fails you get a [Translation Error] string in the output rather than a crash - which is nice, but it means downstream nodes will happily consume an error message as if it were translated text. If you're chaining this into a filename or a prompt, check the output for that prefix or you'll generate a workflow titled [Translation Error] ....

One more honest note: quality tracks the model you feed it. DeepSeek or Qwen on a general task is fine for prompts and captions, but for literary text or highly technical docs, you'll want a stronger model configured in the manager - the node itself treats all models the same.

Category🚦ComfyUI_LLMs_Toolkit/Utility

Inputs (6)

NameTypeDefaultDescription
providerCOMBO1 options: None
modelCOMBO1 options: None
textSTRING
target_languageCOMBOEnglish13 options: English, Chinese (Simplified), Chinese (Traditional), Japanese, Korean, French, +7
llm_configoptLLM_CONFIG
glossaryoptSTRING

Outputs (1)

NameTypeDescription
translated_textSTRING