Nodes/ComfyUI-Kolors-MZ/MinusZone - Kolors UNET Loader
ComfyUI Node Runs on cloud

MinusZone - Kolors UNET Loader

The original Kolors UNet loader, and the TorchLinear it hands you

By MinusZoneAI·Created 2 years ago·Updated about a year ago· 579
MinusZone - Kolors UNET Loader
    • model
    • hid_proj
    unet_name

    MZ_KolorsUNETLoader is the original loader for Kolors' diffusion model, and "original" is doing a lot of work here - it's the V1, legacy version of the loader, sitting in the Legacy category because the pack moved on. You load the Kolors UNet from models/unet/, and unlike the V2 loader it hands you back two things: the model, and a raw TorchLinear layer you have to do something with. That second output is the whole story of why V1 is V1.

    Why there are two loaders

    Kolors pairs its UNet with a ChatGLM3 text encoder that outputs 4096-dimensional embeddings, while the UNet's cross-attention expects 2048. The bridge is encoder_hid_proj, a linear projection layer stored inside the model weights. V1's loader pulls that layer out of the weights and hands it to you as the hid_proj TorchLinear output, on the assumption that you'll pass it into the legacy MZ_ChatGLM3TextEncode node, which needs it to project the text embeddings before conditioning. V2 (the MZ_KolorsUNETLoaderV2 node) folds that projection back inside the model, so you never see it. If you're starting fresh, use V2. If you're reviving an old July-2024 workflow, this is the node it references, and its output graph is: loader → MZ_ChatGLM3TextEncode (legacy, with hid_proj wired in) → conditioning → KSampler.

    How it loads

    Under the hood it loads the safetensors, then converts the diffusers-format checkpoint into ComfyUI's UNet format, popping encoder_hid_proj.weight and .bias out into a fresh nn.Linear along the way. It also registers a custom model folder so ComfyUI knows models/unet/ is where Kolors UNets live.

    Inputs and outputs

    • unet_name - dropdown of everything in models/unet/. That's the entire interface.
    • Outputs: model (MODEL, into KSampler) and hid_proj (TorchLinear, into the legacy text encode node).

    Install and models

    Via ComfyUI Manager (search "ComfyUI-Kolors-MZ") or cd ComfyUI/custom_nodes && git clone https://github.com/MinusZoneAI/ComfyUI-Kolors-MZ then restart. No pip dependencies - the heavy part is the model:

    • diffusion_pytorch_model.fp16.safetensors from Kwai-Kolors/Kolorsmodels/unet/

    The README's FAQ is worth quoting here because it applies directly: Kolors ships in two flavors - a UNet type and a checkpoint type - and if your file isn't loading, try the other loader (MZ_KolorsCheckpointLoaderSimple). If the error mentions unet_prefix_from_state_dict, your ComfyUI core is too old; update it. And use the fp16 UNet on consumer GPUs - the fp32 original is a memory hog and the gradient-related crashes in the FAQ point at fp32.

    Common issues

    Beyond the two-loader confusion, most V1 problems are environmental: a stale ComfyUI core (the loader leans on model_detection helpers that change between versions), or a model that's actually the checkpoint flavor. If you're hitting either, upgrade ComfyUI, then try the V2 loader - it's strictly less fiddly and this whole class is superseded.

    CategoryMinusZone - Kolors/Legacy

    Inputs (1)

    NameTypeDefaultDescription
    unet_nameCOMBO0 options:

    Outputs (2)

    NameTypeDescription
    modelMODEL
    hid_projTorchLinear