Nodes/ComfyUI-Kolors-MZ/MinusZone - ChatGLM3TextEncodeV2
ComfyUI Node Runs on cloud

MinusZone - ChatGLM3TextEncodeV2

Turning your prompt into Kolors conditioning, the V2 way

By MinusZoneAI·Created 2 years ago·Updated about a year ago· 579
MinusZone - ChatGLM3TextEncodeV2
  • chatglm3_model
  • CONDITIONING
text

MZ_ChatGLM3_V2 is the text encode node for the current Kolors pipeline: you feed it the loaded chatglm3_model from MZ_ChatGLM3Loader plus a prompt, and it returns the CONDITIONING that goes into your KSampler's positive slot. It's the "V2" version of the pack's original MZ_ChatGLM3 encode node, and the difference is invisible on the surface but changes your whole graph: V1 needed a separate hid_proj layer routed in from the old UNet loader; V2 doesn't, because the projection moved inside the model. If you load Kolors with MZ_KolorsUNETLoaderV2, this is the text encoder you pair it with.

How it works

The node tokenizes your prompt (padded to 256 tokens - double CLIP's 77, so long natural-language prompts actually fit), runs it through ChatGLM3, and pulls out two things: the penultimate hidden state as the main prompt embeddings, and the final token's hidden state as the "pooled" output that carries global meaning. Both go into a conditioning object the UNet can read. Because it's an LLM encoder, the same prompt that produces "meh" on a CLIP model tends to keep its nuance here - and Chinese prompts work as well as English, which is the model's whole selling point. The text field also supports ComfyUI dynamic prompts and the {option1|option2} random-choice syntax, handled by the node's own regex pass.

Inputs and outputs

  • chatglm3_model - CHATGLM3MODEL from MZ_ChatGLM3Loader.
  • text - your prompt, multiline. That's the whole interface.
  • Output: CONDITIONING → positive slot of KSampler (and you'll usually build a negative from a second encode with an empty or negative prompt).

Install and models

Same pack install as everything else: ComfyUI Manager search "ComfyUI-Kolors-MZ", or git clone https://github.com/MinusZoneAI/ComfyUI-Kolors-MZ into custom_nodes and restart. No extra pip packages; you do need the ChatGLM3 model in models/LLM/ (the fp16 safetensors from Kijai/ChatGLM3-safetensors) or this node has nothing to encode with.

Where it fits

The common gotcha with this node is pairing it wrong: it outputs the raw 4096-dim ChatGLM3 conditioning, and only the V2 UNet loader (or the newer MZ_KolorsCheckpointLoaderSimple) knows to project that down to the UNet's 2048 internally. If you wire it into the legacy V1 UNet graph, your KSampler will scream about shapes. Use MZ_ChatGLM3_V2 with MZ_KolorsUNETLoaderV2, and the legacy MZ_ChatGLM3 only with the legacy loader. Also note this node takes no width/height - if you're building 2048-resolution workflows that need crop/target geometry in the conditioning, reach for MZ_ChatGLM3_Advance_V2 instead.

CategoryMinusZone - Kolors

Inputs (2)

NameTypeDefaultDescription
chatglm3_modelCHATGLM3MODEL
textSTRING

Outputs (1)

NameTypeDescription
CONDITIONINGCONDITIONING