Diffusion Safetensors -> GGUF (city96)
Stop waiting for someone else to quantize your model
- gguf_path
- log
- help
Every big release since Flux has had the same beat: the model drops, and within a day the GGUF packs appear. Usually they appear fast enough that you never think about making your own. But the moment you want a specific quant - a Q5_K_S where everyone uploaded Q4_K_M, a model that's gated, a checkpoint you just merged - you're stuck waiting on strangers. This node is the "fine, I'll do it myself" answer, and it automates the whole pipeline so you don't have to touch a terminal.
What it actually does
Diffusion Safetensors -> GGUF (city96) converts a diffusion model to .gguf and optionally quantizes it, all inside ComfyUI. It's the diffusion counterpart to the pack's Safetensors -> GGUF (llama.cpp) node, and it's a wrapper around the tool the community already converged on: city96's tools/convert.py from the ComfyUI-GGUF pack. That's the same script people were running by hand in the "do your own GGUF" threads back in late 2024, minus the venv setup.
The pipeline is three steps, and the node handles them in order:
- Convert.
convert.py --src model.safetensors --dst model.ggufwrites an F16/BF16 gguf. This alone is a valid, if large, model - the "blazing fast loading" people rave about comes from the single mmap-friendly file, not from quantization. - Quantize (optional). If you pick a
Qvalue in thequantizedropdown, it runsllama-quantizeto shrink the F16 file down the Q ladder. This is where people get burned: diffusion tensor shapes need the patchedllama-quantizefrom city96's llama.cpp fork. The stock llama.cpp binary won't work. It's not bundled - you build it per ComfyUI-GGUF'stools/README.mdand pointquantize_binary_pathat it, or drop it inComfyUI/models/llmto auto-detect. - Fix 5-D tensors (Wan/HunyuanVideo only). Quantization drops 5-D tensors, which Wan 2.1 and HunyuanVideo need.
fix_5d_tensors = autoreads the architecture from the gguf and runs the fix pass only forwan/hyvidarches, so you don't have to think about it.
The inputs that matter
The model dropdown is searchable and lists everything in ComfyUI/models/diffusion_models and /unet. Leave it on the placeholder and type into model_path instead if your file is elsewhere - a local path, a HuggingFace file URL (…/resolve/main/model.safetensors), or owner/name::file.safetensors. Note the tooltip's warning: give it the single diffusion model file, not a diffusers folder layout.
output_name defaults to deriving from the source file; the quant tag and .gguf get appended for you. For the quantization ladder, the KB's rule of thumb applies: Q8 is basically fp16 at half the size, Q5 is the last stop before you can see loss, Q4_K_M is the accepted compromise for 12GB cards. If you just want a smaller file without thinking, Q8_0 or Q4_K_S are the sane defaults - none keeps the F16.
Two switches worth knowing: force = false returns an already-existing output instead of redoing hours of conversion, and keep_intermediate decides whether the F16 file survives a quantization pass (off deletes it - usually what you want, since the F16 is the bigger file).
Outputs
gguf_path is the file you wire into ComfyUI-GGUF's Unet Loader (GGUF) - which you'll want installed anyway, since it's what loads the result. log streams conversion progress to any text preview, and help prints the author's cheat-sheet.
Install
Grab the pack via ComfyUI Manager (search "Kinburg-Nodes") or cd ComfyUI/custom_nodes && git clone https://github.com/Kinburg/Kinburg-Nodes then restart. The converter itself needs nothing extra - it uses huggingface_hub, gguf, torch and safetensors, which all ship with ComfyUI, and fetches the conversion script itself (auto_clone git-clones ComfyUI-GGUF into custom_nodes if it's missing, which needs git on PATH). Only the optional quantization step needs the external llama-quantize binary, and quantize = none needs none of it.
Where people get burned
The single most common failure is the stock llama-quantize - it errors on diffusion tensors and the fix isn't obvious if you didn't read the README. Next is pointing model_path at a full pipeline folder instead of the single UNet/DiT file. And the classic: conversion runs in ComfyUI's own Python, so if it complains about a missing package, install it there, not in your system environment. If the run errors, the log output and the ComfyUI console are where the real message goes.
Inputs (13)
| Name | Type | Default | Description |
|---|---|---|---|
| model | COMBO | Diffusion model from ComfyUI/models/diffusion_models or /unet. Choose the placeholder to type a path/URL in model_path. The dropdown is searchable. | |
| model_path | STRING | Used when 'model' is the placeholder: a local .safetensors/.ckpt path, a HF file URL (…/resolve/main/model.safetensors), or 'owner/name::model.safetensors'. Give the single diffusion model file, not a folder. | |
| output_dir | STRING | Folder for the .gguf. Created if missing. Blank -> ComfyUI/models/diffusion_models. | |
| output_name | STRING | Base filename without extension. Blank -> derived from the source file. The precision/quant tag and .gguf are added automatically. | |
| quantize | COMBO | none | Optional 2nd pass to shrink the model (e.g. Q4_K_S, Q8_0). none = keep the F16 gguf. Needs the PATCHED llama-quantize from city96's llama.cpp fork. |
| quantize_binary | COMBO | Patched llama-quantize executable (auto-listed from ComfyUI/models/llm). Choose the placeholder to type a path in quantize_binary_path. Only used when quantize != none. | |
| quantize_binary_path | STRING | Full path to the patched llama-quantize(.exe), used when the dropdown is the placeholder. | |
| fix_5d_tensorsopt | COMBO | auto | Wan 2.1 / HunyuanVideo need a post-quantize pass to re-add 5-D tensors. auto = run it only when the gguf's arch is wan/hyvid. Ignored when quantize = none. |
| tool_diropt | STRING | Path to a ComfyUI-GGUF checkout (holds tools/convert.py). Blank -> use an installed custom_nodes/ComfyUI-GGUF or auto-clone it there. | |
| auto_cloneopt | BOOLEAN | true | If ComfyUI-GGUF isn't found, git clone it into custom_nodes. Needs git on PATH. (You'll want it installed anyway — its Unet Loader (GGUF) loads the output.) |
| hf_tokenopt | STRING | HuggingFace token for gated/private files. Leave blank for public models. | |
| keep_intermediateopt | BOOLEAN | false | When quantizing, keep the intermediate F16 gguf (and the pre-fix file) as well. Off -> delete them after. |
| forceopt | BOOLEAN | false | Re-run even if the target .gguf exists. Off -> return the existing file without redoing the work. |
Outputs (3)
| Name | Type | Description |
|---|---|---|
| gguf_path | STRING | — |
| log | STRING | — |
| help | STRING | — |