Nodes/comfyui_Niutonian_GLM_4_6V/Niutonian GLM-4.6V Prompt Generator
ComfyUI Node

Niutonian GLM-4.6V Prompt Generator

Let a vision model write your prompt (then check which model it's for)

By Niutonian·Created 8 months ago·Updated 8 months ago· 0
Niutonian GLM-4.6V Prompt Generator
  • glm_model
  • reference_image
  • positive_prompt
  • negative_prompt
  • analysis
modecreate_from_image
base_prompt
stylephotorealistic
detail_leveldetailed
creativity0.7
max_tokens512
negative_elements

The Prompt Generator is the pack's writer: it uses the locally-loaded GLM-4.6V vision model to turn a rough idea - or a whole image - into a structured positive prompt, a negative prompt, and a short analysis of why it chose what it chose. It's the node that makes "I don't know how to prompt this" into "paste the image and take what it gives you."

But here's the thing you need to decide before you use it: what model are you prompting for? GLM generates full, natural-language sentences - instructions, not tag lists. That's exactly what the current generation of LLM-encoded diffusion models (Z-Image, Flux 2's Klein line, Anima) want, because their text encoder reads your prompt as a message rather than a bag of tokens. On those models, this node's output is gold. On SDXL-lineage models like Illustrious or Pony, which still want Danbooru-style tags, a flowing paragraph is less effective - usable, but you're translating from one dialect to another. The KB's prompt-engineering doc makes this split the whole story of 2026 prompting: check what encoder your checkpoint uses, not the release date.

How it works

It builds a system prompt from your choices - one of four modes, a style guide, and a detail level - then generates with creativity as the sampling temperature. If you pass a reference_image, it first asks GLM to analyze the image in detail (a separate, low-temperature generation capped at 300 tokens) and feeds that analysis into the prompt-building. Anything in negative_elements gets appended as "AVOID THESE ELEMENTS." Then it parses the output by scanning for section markers like "positive prompt," "negative prompt," and "analysis," and - if the model didn't follow the format - dumps the whole thing into the positive output rather than returning nothing.

The inputs that matter

  • mode - create_from_image (analyze a reference and write a matching prompt), refine_prompt (improve your base_prompt), creative_variations (remix the base concept), or style_transfer (recast the base into a chosen style). The mode is the whole personality of the node.
  • style (default photorealistic) - ten presets from anime to sci-fi to custom, each with its own vocabulary guide baked into the system prompt.
  • detail_level - basic to ultra_detailed; controls how much descriptive fat goes in.
  • creativity (default 0.7, 0–1) - the temperature knob. Drop toward 0 when you want conservative, faithful rewrites; raise it when you want the model to get weird.
  • reference_image and negative_elements (optional) - image-in, and a list of things to explicitly avoid.

The three outputs - positive_prompt, negative_prompt, analysis - are all STRINGs, so wire them into your CLIP Text Encode nodes and preview the analysis to see the reasoning.

Installing it

Shared with the pack, unsurprisingly: 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

First run pulls ~9GB of GLM weights from HuggingFace, and the pinned transformers>=5.0.0rc0 prerelease is the pack's one dependency landmine - it can break other packs that pinned 4.x.

Common issues

  • Output ignores your style/detail settings - the settings shape the system prompt, and a 9B model sometimes wanders. Bump detail_level and be explicit in base_prompt; the analysis output will show you where it drifted.
  • negative_prompt comes back empty or thin - common, and honestly not always a loss. On LLM-encoded and heavily distilled models negatives barely register, and negative embeddings are effectively dead in 2026. On SDXL-lineage it still earns its keep, so don't throw it away - just know it matters less the newer your checkpoint is.
  • Everything lands in positive_prompt - the parser's fallback when GLM didn't label sections. Re-run with a lower creativity and it usually formats itself.

For the workflow where you keep typing "I want a picture of..." and getting garbage, this node is the fastest way to stop being the bottleneck. Just match it to a model that reads instructions.

CategoryNiutonian GLM-4.6V

Inputs (9)

NameTypeDefaultDescription
glm_modelGLM_MODEL
modeCOMBOcreate_from_image4 options: create_from_image, refine_prompt, creative_variations, style_transfer
base_promptSTRING
styleCOMBOphotorealistic10 options: photorealistic, artistic, cinematic, anime, fantasy, sci-fi, +4
detail_levelCOMBOdetailed4 options: basic, detailed, very_detailed, ultra_detailed
creativityFLOAT0.70–1
max_tokensINT51264–2048
reference_imageoptIMAGE
negative_elementsoptSTRING

Outputs (3)

NameTypeDescription
positive_promptSTRING
negative_promptSTRING
analysisSTRING