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

MinusZone - ChatGLM3TextEncode

The legacy ChatGLM3 encoder that expects a TorchLinear on the side

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

MZ_ChatGLM3 (display name "MinusZone - ChatGLM3TextEncode") is the original V1 text encoder for this pack, and the thing that dates it is right there in the required inputs: alongside the chatglm3_model and your text, it demands a hid_proj - a TorchLinear object that the legacy MZ_KolorsUNETLoader hands you. If you're looking at this node because a 2024 workflow references it, that's the graph you're reconstructing. If you're starting fresh, skip it and use MZ_ChatGLM3_V2 instead; this whole category is marked Legacy for a reason.

How it works

Kolors' ChatGLM3 text encoder outputs 4096-dimensional embeddings, but the UNet's cross-attention expects 2048. In the V1 pipeline, the projection layer (encoder_hid_proj) lives outside the model - the legacy UNet loader pulls it out of the weights and hands it to you as a TorchLinear. This node takes that layer, runs your prompt through ChatGLM3 to get the embeddings, then projects them down through hid_proj before packaging everything into a conditioning object. It even guards the dtype: if the projection weights are fp16/bf16, it wraps the projection in an autocast so the math doesn't explode.

So the V1 graph is: MZ_KolorsUNETLoader → model + hid_proj; MZ_ChatGLM3Loader → chatglm3_model; then this node combines chatglm3_model + text + hid_proj → CONDITIONING → KSampler. Every piece has a V1/V2 pairing, and mixing them is where beginners get burned - this node will error out if you feed it a TorchLinear that isn't there (or nothing at all), because it's a required input, not an optional one.

Inputs and outputs

  • chatglm3_model - CHATGLM3MODEL from MZ_ChatGLM3Loader.
  • text - multiline prompt, same LLM-friendly encoding as the V2 node (256-token padding, Chinese works great).
  • hid_proj - the TorchLinear from MZ_KolorsUNETLoader. Non-negotiable.
  • Output: CONDITIONING → KSampler positive.

Install

Same as the whole pack: ComfyUI Manager (search "ComfyUI-Kolors-MZ") or cd ComfyUI/custom_nodes && git clone https://github.com/MinusZoneAI/ComfyUI-Kolors-MZ and restart. Needs the ChatGLM3 model in models/LLM/ and the UNet in models/unet/.

When you'd actually use this

Honestly? Only to keep an old workflow alive. If you've cloned someone's July-2024 Kolors workflow and it references "ChatGLM3TextEncode", this is what it means, and knowing the hid_proj wiring is the difference between a working graph and an error. But if you're wiring a fresh graph, the V2 loader + MZ_ChatGLM3_V2 produces the same result with two fewer loose ends. Treat this node as documentation of how the pack used to work, unless you specifically need it.

CategoryMinusZone - Kolors/Legacy

Inputs (3)

NameTypeDefaultDescription
chatglm3_modelCHATGLM3MODEL
textSTRING
hid_projTorchLinear

Outputs (1)

NameTypeDescription
CONDITIONINGCONDITIONING