r/StableDiffusion • u/zrn59 • 3d ago
Resource - Update ComfyUI-GGUF-Next: a drop-in fork of city96's ComfyUI-GGUF with no model whitelist and better handling of models bigger than RAM
TL;DR: ComfyUI-GGUF-Next is a drop-in fork of city96's ComfyUI-GGUF, the pack that made GGUF models usable in ComfyUI in the first place. Same nodes, so old workflows open as they are. Models have changed a lot since it was written, so Next adapts it to them:
- More models load. No architecture whitelist: whatever your ComfyUI recognises loads, plus newer text encoders (Gemma 4, Qwen3-VL up to 32B, Mistral 3 and more).
- Memory handling for models bigger than free RAM. Weights stay memory-mapped instead of being copied into RAM, which helps when a model doesn't fit.
- IQ quants dequantized on the GPU, which matters now that Unsloth "UD" text encoders mix IQ layers in.
On regular quants the output is identical to the original in 268 of 269 pairs (the full benchmark: 2481 jobs across 11 packs and 119 model files). Current version: 0.1.1.

Why
city96's pack is what made all of this possible, and for the models it was built around it works great. But newer models kept arriving faster than any whitelist could follow, and I kept switching between forks depending on what I was running. Many of the new models are also bigger than the RAM on my laptop. I wanted one pack that loads whatever ComfyUI supports and copes with that. Next started from city96's code, and the original stays the reference: the benchmark checks Next against it, image for image.
Why a fork and not a PR: the dequantization, the loader, the layers and the nodes have all been reworked, so it wouldn't fit as a PR, and Next is going to develop on its own and get updated more often. It's all Apache-2.0, so anyone is free to take parts of it.
All testing was done on my laptop: RTX 3050, 4 GB VRAM, 15 GB RAM, Linux.
More models
- No whitelist. The original accepts 12 diffusion architectures. Next takes whatever ComfyUI recognises, so when ComfyUI adds a model, its GGUFs should load without a node update. Of 16 newer models from the official ComfyUI templates, 0.1.0 ran 15 on my 4 GB card (three with
--reserve-vram 1); the remaining one, ERNIE-Image, is fixed in 0.1.1. - sd.cpp GGUFs without metadata load too (MiniMax H3, for example).
- New text encoders: Gemma 4, Qwen3-VL up to 32B, Gemma 2, Qwen2, Mistral 3. Gemma 4 needs a GGUF with ComfyUI tensor names, the kind made for LTX-2.5. The Qwen3-VL-32B UD-Q2_K_XL encoder runs on 4 GB in 20 s, using 1.8 GB VRAM.
Memory
The original copies the whole model into RAM on first load, which is the fastest option when it fits. When it doesn't, it ends up in swap. Next keeps a model that's bigger than free RAM memory-mapped and reads it straight from the file, and the OS page cache does the rest.
| Model bigger than free RAM | original | Next |
|---|---|---|
| Flux schnell Q8_0 on 8 GB RAM, no swap | out of memory | 65 s |
| Flux schnell Q8_0 on 8 GB RAM, with swap | 609 s | 303 s |
| LTX-2.5 Q4_K_M (15.7 GB) on 15 GB RAM, 8-step sampling | 435–482 s | 129–229 s |
| Wan 2.2 14B, two 7.2 GB models | 299 s | 257 s |
| Six model switches in one server | 707 s | 495 s |
| Qwen-Image 20B Q3_K_M, 8 steps | 193 s | 225 s |
| HunyuanVideo 1.5, 4 steps | 310 s | 380 s |
| Flux schnell Q8_0 from a 5400 rpm HDD | 294 s | 598 s in 0.1.0, 291 s with the 0.1.1 fix |
With few steps, copying once beats re-reading from the file, so the original's approach wins there; GGUF_RELEASE_MMAP=1 switches to it. When a model fits in RAM, both are about the same, or Next is a few percent faster.
IQ quants
The original dequantizes IQ1/IQ2/IQ3 and TQ with numpy on the CPU, which was fine when hardly any GGUFs used them. Now Unsloth "UD" text encoders (Qwen3, Qwen3-VL) mix IQ layers in, so every prompt pays for that; a diffusion model with IQ layers would pay on every layer, every step. Next does it on the GPU.
| Time to dequantize one tensor to fp16 | original | Next | Next + compile_dequant¹ |
|---|---|---|---|
| IQ3_XXS | 888 ms | 10.5 ms (~85×) | 3.1 ms |
| IQ2_XXS | 505 ms | 14.1 ms (~36×) | 1.7 ms |
| IQ1_S | 426 ms | 11.4 ms (~37×) | 0.4 ms |
| Q4_K | 4.4 ms | 3.9 ms | 1.1 ms |
¹ optional torch.compile of the kernels, off by default. Needs Triton; images change in small details, as with ComfyUI's TorchCompileModel.
End to end: a Qwen3-4B UD-IQ1_S text encoder went from 43.8 to 10.8 s, and a synthetic Anima IQ3_XXS file (built for the test, speed only) from 49.7 to 2.0 s per step. With K-quants only, the difference is small (0.68 → 0.62 s per step on Anima Q4_K_M), because the step is bound by matrix multiplies.
Also: torch kernels for every GGUF quant type, including MXFP4, NVFP4 and TQ (checked against gguf-py's reference on synthetic data only, not yet in a real model), embeddings that dequantize only the rows a prompt uses, more quantizable layer types, a convert.py for about 30 architectures.
Old workflows give the same images
Same node IDs, same bootleg category, and the stock LoRA loaders work. Across the benchmark Next gave the same image or latent as the original in 268 of 269 pairs, and 91 of 91 in a second round. The one other pair differed once and matched in all three reruns; its cause wasn't found. That covers 5 architectures, two versions of torch and of ComfyUI, six sets of launch flags, LoRAs and CPU mode.
The exception is IQ1/IQ2/IQ3. Next computes them in fp16 on the GPU, the original in fp32 on the CPU. Small differences in the weights get amplified through the model, so the final images end up 20–40 dB PSNR apart. Both are about equally far from the full-precision model, within a few tenths of a dB:

Install
ComfyUI Manager: search for ComfyUI-GGUF-Next.
Or by hand:
cd ComfyUI/custom_nodes
git clone https://github.com/Zrn59/ComfyUI-GGUF-Next
pip install -r ComfyUI-GGUF-Next/requirements.txt⚠️ Disable the original ComfyUI-GGUF first (rename its folder to ComfyUI-GGUF.disabled, for example). Both register the same node names, and whichever loads last wins. Next warns at startup if it finds another copy. The requirements are minimal and unpinned. Windows portable commands are in the README.
Fixed in 0.1.1, still open
Fixed in 0.1.1, all found by the benchmark:
- The Mistral 3 / Ministral-3 text encoder (ERNIE-Image) didn't load on ComfyUI 0.42 and newer.
- From a slow disk, a model bigger than free RAM was 2–3× slower than the original. Now, when ComfyUI reports the disk as slow, the model is copied into RAM and swap if they can hold it, otherwise it stays memory-mapped; the HDD runs in the benchmark came out level with the original. ComfyUI can't detect the disk type everywhere (on btrfs it reports "unknown"); there, set
GGUF_RELEASE_MMAP=1for a model on a slow disk. - The compiled path no longer tries to compile F8_E4M3, which failed on RTX 30xx.
Still open:
- With few steps, memory-mapping can be slower than copying (see Memory above).
- On 4 GB, Ideogram 4 and Qwen-Image 2.1 run out of VRAM while dequantizing the first step. Start ComfyUI with
--reserve-vram 1. - Qwen3.5, GPT-OSS and Gemma 4 in llama.cpp tensor layout aren't converted.
- It has only run on Linux with an NVIDIA card. Reports from AMD (ROCm), Mac (MPS), Windows and RTX 50xx would help a lot.
Benchmark
The goal wasn't to prove Next is the best pack. It was to find where it falls short and what to work on next; the fixes above come from it. It ran for 3 days: 2481 jobs, 119 model files, Next against the original and nine other packs. Every pack got a clean ComfyUI and the same workflows, models, seeds and launch flags.
Everything is public: the report, harness, workflow and logs of every job on GitHub, and every image, latent and video (6.7 GB) on Hugging Face. bash verify/run_all.sh recomputes every table from the raw outputs, with no GPU and no models.
Other GGUF packs
They're all good projects, each with its own focus, and a couple of fixes in Next come from leejet's fork (credited in the repo). Six files, each pack in its own process on the same ComfyUI 0.42.1:
| File | city96 | leejet | Nif00 | molbal | ChrisColeTech | Next |
|---|---|---|---|---|---|---|
| Anima turbo Q4_K_M | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
| LTX-2.5 Distilled Q4_K_M | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
| MiniMax H3 Q4_K (sd.cpp) | ❌ | ✅ | ❌ | ✅ | ✅ | ✅ |
| Qwen2.5-VL-7B Q4_K_M | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
| Gemma 4 12B (LTX-2.5 encoder) | ❌ | ❌ | ❌ | ✅ | ❌ | ✅ |
| Qwen3-VL-32B UD-Q2_K_XL (MiniMax H3 encoder) | ❌ | ❌ | ✅ 50 s | ✅ 101 s | ❌ | ✅ 20 s |
These six files are about encoder and format coverage. For speed, Nif00 has the fastest warm steps (up to 1.7× faster than city96, though its images differ from city96's), and molbal also handles both new encoders. Full results for all eleven packs are in the benchmark report.
About Claude
I made this with Claude (Anthropic's coding agent, in Claude Code). Claude wrote most of the code: the dequant kernels, the loader, tests and docs. For the benchmark it wrote the harness and ran it for three days, watching the jobs, logs and results. I decided what to support and what to benchmark, corrected how things were measured, said which runs to add, tested on real models, found most of the bugs and reviewed everything before it went in.
If AI-written code makes you wary: every dequant kernel that gguf-py has a reference decoder for (24 types in gguf 0.19) is checked against it bit for bit in CI on every push, and the benchmark above can be re-checked from its raw data.
It's 0.1.1 and has only run on one laptop, so there will be bugs. If something doesn't load or looks off, please open an issue with the file name. Questions and feature requests go to GitHub Discussions.
Huge thanks to city96 for the original pack and everything built on it, to leejet for the Qwen3-VL mapping and fingerprints, and to llama.cpp, whose reference code the kernels are ported from.
Also posted in r/comfyui.
View all comments
2
u/Full-Belt3640 3d ago
Do Qwen Image 2.1's image editing capabilities work with this fork?