ComfyUI-GGUF-Next
GGUF quantization support for native ComfyUI models - extended model/quant coverage and faster dequantization (fork of city96/ComfyUI-GGUF).
ComfyUI-GGUF-Next
<div align="center">English · Русский · Docs · Документация
<br>Custom Bot & Web Development • Data Parsing • Isolated Docker Hosting — zrn59.me
</div><p align="center"> <img src="docs/screenshot-identical.png" alt="Anima generated with city96/ComfyUI-GGUF and with GGUF-Next" width="720"><br> Anima Q4_K_M, same workflow and seed. Left: city96/ComfyUI-GGUF. Middle: GGUF-Next. Right: the difference, 0 values differ. </p>
GGUF loader nodes for ComfyUI. This is a fork of city96/ComfyUI-GGUF with more quant types, more diffusion models and more text encoders. Node IDs, inputs and the category are the same, so existing workflows open unchanged. All 35 ggml storage types, 26 of them quantized, are handled in torch, on the GPU.
| | city96/ComfyUI-GGUF | ComfyUI-GGUF-Next |
| --- | --- | --- |
| Storage types handled in torch | 15, of them 12 quantized | 35 (all ggml storage types), of them 26 quantized |
| IQ1/IQ2/IQ3, TQ (Unsloth "UD" files) | numpy on the CPU, every layer, every step | torch, bit-exact with gguf-py |
| Diffusion architectures | whitelist of 12 | whatever your ComfyUI detects |
| Text encoders | T5, Llama, Qwen2.5-VL, Qwen3, Gemma 3 | + Gemma 2, Qwen2, Mistral 3, Qwen3-VL incl. 32B, ComfyUI-layout GGUFs |
| Quantized scale_shift_table, modulation | raw blocks copied into the weight | dequantized on load |
| Conv1d, Conv3d, ConvTranspose, RMSNorm | not quantized | quantized |
| Embedding lookup | whole table dequantized per call | only the looked-up rows |
| Model bigger than free RAM | copied into RAM on first load, ends up in swap | stays memory-mapped, read from the file |
| convert.py / lcpp.patch architectures | 11 | about 30 |
In the comparisons with upstream the output is the same bit for bit: the Anima image, with and without a LoRA, and the Qwen2.5-VL-7B text encoding. CLIPLoader (GGUF) gives the same image as the stock CLIPLoader.
Checked on real files
Each file was loaded with six GGUF packs on the same ComfyUI: RTX 3050 Laptop 4 GB, 15 GB RAM.
| File | city96 | leejet | Nif00 | molbal | ChrisColeTech | GGUF-Next |
| --- | --- | --- | --- | --- | --- | --- |
| Anima turbo Q4_K_M | ✅ | ✅ | ✅ | ✅ image differs from city96 | ✅ bit-identical to city96 | ✅ full generation, bit-identical to city96 |
| LTX-2.5 Distilled Q4_K_M | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ full generation |
| MiniMax H3 Q4_K (sd.cpp, no metadata) | ❌ unknown architecture | ✅ | ❌ unknown architecture | ✅ | ✅ | ✅ full generation |
| Qwen2.5-VL-7B Q4_K_M | ✅ | ✅ | ✅ | ✅ bit-identical to city96 | ❌ CUDA OOM | ✅ encoding bit-identical to city96 |
| Gemma 4 12B Q5_K_M (LTX-2.5 encoder) | ❌ gemma4 rejected | ❌ gemma4 rejected | ❌ KeyError | ✅ same encoding as GGUF-Next | ❌ I16 not supported | ✅ |
| Qwen3-VL-32B UD-Q2_K_XL (MiniMax H3 encoder) | ❌ TypeError | ❌ wrong keys | ❌ CUDA OOM | ❌ CUDA OOM | ❌ wrong layer sizes | ✅ |
leejet is leejet/ComfyUI-GGUF, Nif00 is Nif00/ComfyUI-GGUF, molbal is molbal/ComfyUI-GGUF at 3ae2b68, ChrisColeTech is ChrisColeTech/ComfyUI-GGUF-Loader at 109a281.
- CUDA OOM means the encoder did not fit on this 4 GB card. GGUF-Next encodes the same files on it.
- molbal's Anima image differs from city96 with a PSNR of 25.9 dB. With its Triton backend turned off the image is the same, so the difference comes from elsewhere. On a 6-step turbo model small rounding differences already show up this much.
- ChrisColeTech imports OpenCV at startup, and neither its
requirements.txtnor ComfyUI installs it. Without it the whole pack fails to load. It was installed for this test.
Only GGUF-Next and molbal load the Gemma 4 encoder of LTX-2.5, and only GGUF-Next runs the Qwen3-VL-32B encoder of MiniMax H3 on 4 GB. In GGUF-Next both models run end to end:
<p align="center"> <img src="docs/ltx25.webp" alt="LTX-2.5 video made from GGUF files" width="720"><br> LTX-2.5 Distilled Q4_K_M + Gemma 4 12B Q5_K_M. 1280×704, 97 frames, the two-stage workflow from ComfyUI's LTX-2.5 template. <a href="docs/ltx25.mp4">MP4 with sound</a> </p> <p align="center"> <img src="docs/minimax-h3.webp" alt="MiniMax H3 video made from GGUF files" width="720"><br> MiniMax H3 Q4_K + Qwen3-VL-32B UD-Q2_K_XL. 960×544, 73 frames, 20 steps. <a href="docs/minimax-h3.mp4">MP4 with sound</a> </p>Both videos were generated by Claude (Anthropic's AI agent) while it tested the pack: one seed each, not picked or edited. They show that the models run, not the best these models can do. The previews are 12 fps and 720 px wide; the MP4 files are the full 24 fps output. On 4 GB VRAM and 15 GB RAM the transformers ran on the GPU: LTX-2.5 took 25 minutes, MiniMax H3 took 18. The text encoders ran on the CPU (--novram), because ComfyUI's Gemma 4 encoder does not fit in 4 GB, see models. Prompt for both: "A red fox walks through a snowy pine forest at sunrise, golden light between the trees, snowflakes drifting in the air, cinematic tracking shot. Snow crunches under its paws, a soft wind moves through the pines."
Install
You need a working ComfyUI with Python 3.9 or newer. Remove or disable the original ComfyUI-GGUF first: both packs register the same node names, and the one loaded last wins. To disable it, rename its folder to ComfyUI-GGUF.disabled. GGUF-Next prints a warning at startup if it finds another copy.
cd ComfyUI/custom_nodes
git clone https://github.com/Zrn59/ComfyUI-GGUF-Next
pip install -r ComfyUI-GGUF-Next/requirements.txt
That installs the current main. Changes are in CHANGELOG.md.
requirements.txt lists gguf>=0.13.0, sentencepiece and protobuf. Nothing is pinned. torch, numpy and transformers are not listed. A package that is already installed is not upgraded or downgraded. MXFP4, NVFP4 and Q1_0 files need pip install -U gguf.
Windows portable
Run from the folder that holds run_nvidia_gpu.bat:
git clone https://github.com/Zrn59/ComfyUI-GGUF-Next ComfyUI\custom_nodes\ComfyUI-GGUF-Next
.\python_embeded\python.exe -s -m pip install -r .\ComfyUI\custom_nodes\ComfyUI-GGUF-Next\requirements.txt
Usage
The nodes are in the bootleg category, as in upstream:
| Node | Replaces |
| --- | --- |
| Unet Loader (GGUF) | Load Diffusion Model |
| Unet Loader (GGUF/Advanced) | the same, plus dequant_dtype, patch_dtype, patch_on_device, compile_dequant |
| CLIPLoader (GGUF), Dual/Triple/QuadrupleCLIPLoader (GGUF) | the stock CLIP loaders, for .gguf and .safetensors |
- Diffusion models go in
models/unetormodels/diffusion_models. Text encoders go inmodels/text_encodersormodels/clip. - Qwen2.5-VL and Qwen3-VL need their
mmproj-*.ggufin the same folder. The loader matches it by file name without the quant suffix. A singlemmprojin the folder is used only if its projector type fits the encoder. compile_dequant(orGGUF_COMPILE_DEQUANT=1) compiles the dequant kernels withtorch.compile. It needstriton. The first steps are slower while it compiles. fp16/bf16 values are rounded differently from the regular path; the compiled path is closer to fp32 on every tensor. On few-step models this changes small details of the image, as ComfyUI's own TorchCompileModel does (comparison). It works together with the TorchCompileModel node.- LoRAs work with the stock LoRA loaders.
- A model bigger than free RAM is not copied into RAM. Its weights stay memory-mapped and are read from the file.
GGUF_RELEASE_MMAP=1always copies, as upstream does.GGUF_RELEASE_MMAP=0never copies.
Model list, quant types and speed: docs/en/models.md, docs/en/quants.md.
Speed
RTX 3050 Laptop, 4 GB. One 3072×12288 weight to fp16:
| Type | upstream | Next | Next + compile_dequant |
| --- | --- | --- | --- |
| Q4_K | 4.5 ms | 4.5 ms | 0.8 ms |
| Q6_K | 6.3 ms | 6.3 ms | 2.8 ms |
| IQ2_XS | 638 ms | 21.7 ms | 0.6 ms |
| IQ3_XXS | 735 ms | 11.6 ms | 1.0 ms |
A full Anima 2B Q4_K_M step at a 64×64 latent takes 639 ms instead of 724 ms. Peak VRAM is not higher.
LTX-2.5 Q4_K_M is a 15.7 GB file, on a machine with 15 GB RAM, in ComfyUI's automatic memory mode, at 640×352 and 97 frames. Both packs put the same 2.3 GB of weights in VRAM and stream the rest. A step takes 547–580 s with upstream, which copies the weights into RAM and so into swap, and 114–129 s with GGUF-Next, which reads them from the file. Two alternating runs each.
What it does not do
- Qwen3.5, GPT-OSS and Gemma 4 in llama.cpp tensor layout are not converted. They load only from GGUFs with ComfyUI tensor names.
- Large text-encoder token embeddings are dequantized to fp16 on load, as in upstream.
- With a LoRA, a quantized weight is dequantized and patched on every step, as in upstream. This saves VRAM.
compile_dequantis one switch for the whole process.- A model bigger than RAM is read from disk on every step, so its speed depends on the disk.
More: docs/en/README.md. Suggestions: Discussions.
Tests
| Check | Result |
| --- | --- |
| pytest: 22 cases for kernels, layers and the loader. CPU and CUDA, with and without torch.compile, gguf 0.13.0, 0.17.1, 0.19.0 and master | all pass |
| Every dequant kernel that gguf-py 0.19 has a reference for (24 types), synthetic data, fp32 output, CPU and CUDA. Q1_0 and Q8_K have their own tests | bit for bit |
| Anima image against city96: Unet Loader (GGUF), the Advanced loader, with a LoRA, GGUF_RELEASE_MMAP=0 and 1 | bit-identical |
| Qwen2.5-VL-7B text encoding against city96 and leejet | bit-identical |
| compile_dequant on every quantized tensor of the Anima file | never further from fp32 than the regular path |
| Six real GGUF files in six packs | table above |
| LTX-2.5 and MiniMax H3 text-to-video with sound, GGUF files only | videos above |
| pip install -r requirements.txt in a ComfyUI venv | adds only gguf and protobuf, pip check is clean |
CI runs the pytest suite on every push. How to run it and the full list of checks: docs/en/testing.md. Every change is listed in CHANGELOG.md.
Authors
- Zrn59, lead developer. Started the fork and decided what it had to do: which models, quant types and text encoders to support, which packs to compare against, what counts as done. Wrote code together with Claude, tested the changes on real models and found most of the bugs fixed here, reviewed every result and decided what went into the release.
- Claude (Opus 5.5, Anthropic's AI agent, in Claude Code), co-developer. Wrote code together with Zrn59: the dequant kernels, the loader and layer changes, the tests and the docs. Ran the comparisons with the other packs and the benchmarks, and generated the example videos.
Commits are authored by Zrn59, with Claude as co-author.
License
Apache-2.0. See LICENSE, NOTICE and THIRD_PARTY_NOTICES.md.
- Original project: © city96 and the ComfyUI-GGUF contributors.
- The Qwen3-VL mmproj mapping and the Ideogram4, Krea2, MiniMax and Qwen-Image 2.1 fingerprints come from leejet/ComfyUI-GGUF.
- The dequant kernels are ports of the gguf-py / ggml reference code from llama.cpp (MIT).