Save Weight As Kolors Unet
Exporting a Real Kolors UNet from ComfyUI
- model
Kolors doesn't get much love in the western community anymore - it launched in the same window as Flux and basically got talked over. But Kuaishou's model is still quietly alive in the Chinese ecosystem, and if you're one of the people merging it, this node is the piece that's almost impossible to find anywhere else. It takes a MODEL and writes it out as a genuine Kolors-format UNet .safetensors, complete with the exact key layout and architecture metadata the Kolors tooling expects.
ComfyUI has a built-in "Save Checkpoint" that will happily dump a merged model to disk. What it won't do is write a file in the specific Kolors diffusers-style layout that loaders like ComfyUI-Kolors-MZ expect. That's this node's entire job, and it does it without any extra Python dependencies - it's built on ComfyUI's own comfy.sd, comfy.utils and safetensors.
How it works
Under the hood it's a key-renaming exercise. The node loads a hardcoded Kolors UNet config (SDXL-style UNet geometry with context_dim: 2048 - that's the hidden size of Kolors's ChatGLM3 text encoder, not CLIP) and asks comfy.utils.unet_to_diffusers() for the mapping between ComfyUI's internal model.diffusion_model.* names and the diffusers-style names Kolors uses.
Then comes the clever part. The repo ships a ~16 MB file called missing_tensors.safetensors - not a model, just a skeleton tensor set with every Kolors key at its correct shape. The node loads that skeleton, overwrites each entry with the real weight from your MODEL where the key matches kolors_keys.json, and saves the result. Any key that isn't in that list gets skipped with a not in ori_keys line in the console. It's a diffusers-style Kolors UNet when it comes out the other side.
The important consequence: what you get is UNet-only. No VAE, no text encoder, no sampler config. It will not run standalone. You drop the file into models/unet and load it through ComfyUI-Kolors-MZ, which supplies the ChatGLM3 text encoder and VAE separately.
The inputs that matter
There are only two, and neither is hard:
- model (MODEL) - the merged (or plain) UNet you want to export. The usual shape here is: load your Kolors UNet with the MZ loader, run it through a ModelMergeSimple / ModelMergeBlockNumber graph against another model, then feed the merged output in.
- filename (STRING) - defaults to
checkpoints/ComfyUI, which tells you where it goes: the file is written to ComfyUI's output folder (ComfyUI/output/checkpoints/ComfyUI.safetensors), not intomodels/unet. Move or copy it there yourself.
No VAE input, no outputs, and it's marked as an output node - you run it and it does its thing.
Installing it
The pack is just two output nodes and has no requirements.txt, so installation is trivial:
cd ComfyUI/custom_nodes
git clone https://github.com/lrzjason/Comfyui-Kolors-Utils.git
Restart ComfyUI and search for "Save Weight As Kolors Unet". ComfyUI Manager can try the same pack, but the git clone is the path the README documents. Nothing heavy gets pulled in - the missing_tensors.safetensors skeleton is already in the repo, so there are no model downloads from this pack itself. You do still need a Kolors model (the official weights or via the MZ loader) to have anything to export.
Where people get burned
The two traps are both about expectations. First, this node will happily export any MODEL you feed it as a "Kolors UNet" - it doesn't validate that the model is actually Kolors-derived. Merge an SDXL UNet into the graph and the output will look structurally right but generate nonsense, because the keys and architecture metadata won't match Kolors's actual training. Use it on Kolors-or-Kolors-derived merges only.
Second, remember the output lands in output/, not models/unet. If the MZ loader can't find your fresh export, that's almost always why. And if the file comes out smaller than expected, check the console for skipped keys - that's the node telling you some weights didn't map.
Inputs (2)
| Name | Type | Default | Description |
|---|---|---|---|
| model | MODEL | — | |
| filename | STRING | checkpoints/ComfyUI | — |
Outputs (0)
No outputs