MinusZone - ChatGLM3Loader
The 10GB Chinese-language text encoder Kolors can't live without
- chatglm3_model
Kolors is unusual among diffusion models because its text encoder isn't CLIP and isn't T5 - it's ChatGLM3, a full Chinese-English LLM from Tsinghua's Zhipu team. That's a genuinely different way to turn your prompt into numbers, and MZ_ChatGLM3Loader is what loads that encoder into ComfyUI. It's the node that makes Kolors understand Chinese prompts properly, and it's also the single heaviest piece of this pack: the model is a ~10GB safetensors that lives in models/LLM/.
Why does it matter that it's an LLM? Because Kolors was an early example of the trend that later took over - using a general-purpose language model as the text encoder instead of a frozen CLIP. The practical payoff: it reads long, natural-language prompts well, and it handles Chinese natively. The community quickly noticed that feeding Kolors Chinese prompts (or having another Chinese-capable LLM draft them) often beats English. That's the whole reason this loader exists rather than a standard CLIP loader.
How it works
The loader reads your chosen safetensors, builds a ChatGLMConfig from a config bundled inside the pack, and constructs the model with the bundled tokenizer. Two details matter:
- It tries to use
accelerate'sinit_empty_weightsto load the ~10GB file without ballooning VRAM, falling back to a plainload_state_dictif accelerate isn't installed (you'll see a warning). - If the filename contains
4bitor8bit, it quantizes the model accordingly. The 4bit path tries topip install cpm_kernelson the spot - that package is needed for quantized ChatGLM, and it's the source of one of the FAQ's most common errors (see below).
The output, chatglm3_model, is a CHATGLM3MODEL object - a dict holding the text encoder plus tokenizer. It feeds the MZ_ChatGLM3_V2 (or legacy MZ_ChatGLM3) text encode nodes, never a KSampler directly.
Inputs and outputs
chatglm3_checkpoint- dropdown of.safetensorsfiles inmodels/LLM/. The README's FAQ error'ChatGLMModel' object has no attribute 'transformer'is this dropdown pointing at the wrong file, so double-check what you downloaded.- Output:
chatglm3_model(CHATGLM3MODEL) → text encode node.
Install and models
Install via ComfyUI Manager (search "ComfyUI-Kolors-MZ") or git clone https://github.com/MinusZoneAI/ComfyUI-Kolors-MZ into custom_nodes, then restart. The heavy dependency is the download:
# from Kijai/ChatGLM3-safetensors
# chatglm3-fp16.safetensors -> models/LLM/
Use the fp16 build. The README FAQ is blunt about it: RuntimeError: Only Tensors of floating point dtype can require gradients is fixed by switching to chatglm3-fp16.safetensors. fp32 loads if you insist, but on a consumer card it's a bad time.
Common issues
Three errors from the README's FAQ cover most of what people hit. name 'round_up' is not defined means cpm_kernels is missing - pip install cpm_kernels (only matters if you're on a quantized checkpoint). The gradient dtype error above means you grabbed the wrong model file. And a transformer attribute error means the file in the dropdown isn't actually the right ChatGLM3. Also worth knowing: Mac users should use the yiwangsimple fork of this pack, per the README - the original leans on CUDA assumptions in places.
Inputs (1)
| Name | Type | Default | Description |
|---|---|---|---|
| chatglm3_checkpoint | COMBO | 0 options: |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| chatglm3_model | CHATGLM3MODEL | — |