ChatGLM-4 Translate Text Node
An LLM doing your prompt translation instead of a dictionary lookup
- text
The other translators in this pack - Google, Deep Translator, Argos - are all doing statistical or dictionary-style machine translation: solid for literal sentences, weaker on slang, idiom, or anything where word order needs to genuinely rearrange to sound natural. ChatGLM4TranslateTextNode takes a different approach: it hands your prompt to an actual LLM and asks it to translate. That gets you translation with more context awareness, at the cost of needing a paid API call instead of a free one.
Why you'd reach for it
If plain machine translation keeps mangling a specific phrase, an LLM will generally do better because it's not doing word-by-word substitution - it understands the sentence as a whole before restating it in the target language. This matters more than you'd think for prompt writing specifically, where slightly-off phrasing can shift what a diffusion model generates. The community's own framing of this trend is blunt: LLM-assisted prompt writing "stopped being a thing you did in a browser tab and became a node" - this is exactly that pattern, applied to translation instead of prompt expansion.
The model behind this node is one of the GLM family from Z.ai (formerly Zhipu AI) - a Tsinghua-spinout lab better known in this community for open-weight video and image models (CogVideoX, SCAIL) than for its LLM business, even though the LLM side is actually the larger one. Z.ai runs both an open-weight release line and a separate hosted API platform; this node calls the latter.
How it works
You send your text plus source/target language to a GLM model hosted on Z.ai's API. The model translates in context and returns plain text - no local model download, no GPU cost on your end, just an API round trip.
The inputs and outputs that matter
text- your prompt, multiline.from_translate(defaultru) /to_translate(defaulten) - 133 short language codes each. Unlike the Google-based nodes, note the default source here is Russian, notauto- set this explicitly for your actual source language.model(defaultglm-4.5-flash) - which GLM model handles the translation, 16 choices spanningglm-4-plusthroughglm-4.7and several-flash/-air/-xvariants. The-flashmodels are the cheap/fast tier; reach for a bigger one only if a flash model is mistranslating something subtle.max_tokens(default 1024),temperature(default 0.95),top_p(default 0.7) - standard LLM sampling controls. For translation specifically, a lowertemperature(closer to 0) will generally get you more literal, consistent output run to run; the high default here is inherited from general-purpose chat settings, not tuned for translation.
Output is a single text string, same shape as every other translator node in this pack - drop-in compatible with PreviewTextNode or a standard CLIP Text Encode.
How to install it
Via ComfyUI Manager: search "ComfyUI Custom Nodes AlekPet" and install. Manually:
cd ComfyUI/custom_nodes
git clone https://github.com/AlekPet/ComfyUI_Custom_Nodes_AlekPet
Restart ComfyUI. Beyond the node install itself, you'll need an API key from Z.ai's hosted platform (open.bigmodel.cn) - the top-level pack README doesn't cover per-node API setup, so check the ChatGLMNode subfolder in the repo for exactly where the key goes before your first run.
Common issues & troubleshooting
Authentication or "unauthorized" errors on first run. This is an unconfigured API key, not a broken install - unlike the Google/Deep/Argos translators, this node calls a paid hosted API and needs credentials before it'll do anything.
Output drifts or paraphrases instead of translating literally. That's the LLM being an LLM - it's optimizing for a natural-sounding result, not a word-for-word mapping. If you need strictly literal translation (e.g. preserving an exact technical term), drop temperature toward 0, or fall back to DeepTranslatorTextNode for that specific phrase.
Costs money per call, unlike the other translators in this pack. Budget for that if you're translating a lot of prompts in a batch - the Google/Deep Translator/Argos nodes are free (or offline) alternatives when API cost is a concern and translation nuance isn't critical.
Inputs (7)
| Name | Type | Default | Description |
|---|---|---|---|
| from_translate | COMBO | ru | Translation from |
| to_translate | COMBO | en | Translation to |
| model | COMBO | glm-4.5-flash | The model code to be called. Models with text 'flash' should be free! |
| max_tokens | INT | 1024 | The maximum number of tokens for model output, maximum output is 4095, default value is 1024. |
| temperature | FLOAT | 0.950–1 | Sampling temperature, controls the randomness of the output, must be a positive number within the range: [0.0, 1.0], default value is 0.95. |
| top_p | FLOAT | 0.700–1 | Another method of temperature sampling, value range is: [0.0, 1.0], default value is 0.7. |
| text | STRING | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| text | STRING | — |