Nodes/comfyui_Niutonian_GLM_4_6V/Niutonian GLM-4.6V Image Describer
ComfyUI Node

Niutonian GLM-4.6V Image Describer

A vision model that reads your image back to you

By Niutonian·Created 8 months ago·Updated 8 months ago· 0
Niutonian GLM-4.6V Image Describer
  • glm_model
  • image
  • output_text
  • raw_output
user_promptDescribe this image in detail.
max_tokens1024
temperature0.7

The Describer is the workhorse of the GLM-4.6V pack: you give it an image, it gives you back a written description. No API key, no separate subscription - it's the locally-running ~9B GLM-4.6V-Flash vision model that the pack's Loader downloads once. If you've ever wished ComfyUI had eyes, this is that node.

Where does it earn its keep? Two places. First, captioning: batch-describing images for dataset or LoRA training work, or just getting a proper text record of what a generation actually produced. Second, as the front half of an automation - the string it emits can be wired into other nodes, and it pairs naturally with this pack's Prompt Generator. It's also the engine inside the Agentic Sampler, so understanding it means understanding the whole pack.

How it works

The mechanism is straightforward. The node takes your image tensor, saves it as a temporary PNG in ComfyUI's temp directory, builds a chat message - image plus your prompt - and runs it through GLM's processor, which applies the chat template and tokenizes. The model generates up to max_tokens new tokens and the result comes back as text. The GLM family is a "thinking" model, so it often emits a <think> block of reasoning before its answer. That's why there are two outputs:

  • output_text - the answer with thinking tags stripped. This is the one you actually use.
  • raw_output - the raw generation including the <think>...</think> block. Mostly useful when you're debugging why the model said something weird.

The inputs that matter

  • image - any IMAGE tensor. Honest caveat from the source: it processes image[0] only, so a batch of frames gets you one description per run, not one per frame.
  • user_prompt - the whole game. The default "Describe this image in detail." is a weak prompt and the model will give you a weak, generic paragraph in return. Ask for what you actually want: "Describe the subject, composition, lighting, color palette, and any text visible in the image." The difference is night and day.
  • max_tokens (default 1024, 64–4096) - the description budget. Crank it for detailed captions, drop it when you're just tagging.
  • temperature (default 0.7, 0–2) - set it near 0 for consistent, repeatable captions across a dataset; raise it if you want the model to vary its phrasing. Note the code only samples when temperature is above 0, so exactly 0 gives you deterministic greedy output.

Installing it

It shares the pack's install: ComfyUI Manager → search "comfyui_Niutonian_GLM_4_6V" → install → restart, or:

cd ComfyUI/custom_nodes
git clone https://github.com/Niutonian/comfyui_Niutonian_GLM_4_6V
cd comfyui_Niutonian_GLM_4_6V
pip install -r requirements.txt

The one heavy lift is the first-run model download (~9GB from HuggingFace) and the transformers>=5.0.0rc0 prerelease the pack pins. That upgrade can collide with other node packs, so if stuff breaks elsewhere after installing, that's your first suspect.

Common issues

  • CUDA OOM during a run - the node catches it and returns an error string instead of crashing, but the fix is the same: lower max_tokens, make sure the Loader is running 4-bit, and leave ComfyUI's memory alone while it works.
  • Descriptions that read like a lazy intern - you're probably using the default prompt. Be specific; a 9B model with 128K context will reward a real instruction.
  • Temp files piling up - it cleans its own PNGs in a finally block, so you don't have to babysit them. If you've ever used a node that leaked temp files, you'll appreciate this one.

One more thing worth knowing: this is a 9B model doing vision+language inference per image, so it's not instant. A 1024-token description takes a few seconds on a decent card. That's the price of not sending your images anywhere.

CategoryNiutonian GLM-4.6V

Inputs (5)

NameTypeDefaultDescription
glm_modelGLM_MODEL
imageIMAGE
user_promptSTRINGDescribe this image in detail.
max_tokensINT102464–4096
temperatureFLOAT0.70–2

Outputs (2)

NameTypeDescription
output_textSTRING
raw_outputSTRING