Quantize Model
Turn your loaded model into an int8 or fp8 file without leaving ComfyUI
- model
- model
Quantization used to mean downloading somebody else's file and hoping they used a sane recipe. This node runs the recipe yourself, inside your graph: hand it a loaded diffusion model, pick a format, and it writes a quantized safetensors file and rebuilds the model from the result so you can sample it immediately. LoRAs applied before it get merged in at full precision first.
When it's actually worth it
Be honest about this one. If Comfy-Org already publishes an int8 convrot file for your model, download that - the node's like Comfy-Org option exists to reproduce it, not beat it. The genuine cases are narrower: you've stacked LoRAs on a base and want the merged result on disk, you're on a model nobody has quantized, or you want to shrink something without buying a bigger card.
The formats are the ones ComfyUI runs natively, which is what makes this useful rather than academic. int8 convrot is roughly half of bf16 with very little loss and it works on 20/30/40/50-series - including 30-series cards, which get no fp8 acceleration at all. fp8 e4m3fn wants a 40-series or newer. mxfp8 and nvfp4 are Blackwell territory and mostly interesting because NVFP4 is hardware-accelerated rather than emulated. w6a8 lands near 40% of the original size, w4a8 near 30% and is where you actually start seeing the loss.
What it does
It quantizes the model's linear layers, writes the state dict to a numbered safetensors in ComfyUI's output folder, then rebuilds a model from those weights via comfy.sd.load_diffusion_model_state_dict - that's how the model output is ready for a sampler straight away, and also why an unrecognisable result raises instead of failing later.
The layers, qkv, attention and scales menus are the "make it look like the official release" controls. layers picks which layers get quantized (repeated transformer blocks, or literally every linear layer for a smaller, slightly less faithful file). qkv matters if you use LoRAs: fused gives one combined projection as Comfy-Org ships it, separate gives three layers, which is what LoRAs for split projections expect. attention sets an attention kernel, and like Comfy-Org mirrors what their release does.
The inputs that matter
model - straight from Load Diffusion Model. Anything patched before this gets folded in, including LoRAs.
format - start with int8 convrot. It's the best quality-per-byte on hardware that isn't Blackwell.
filename_prefix - defaults to diffusion_models/quantized, written under ComfyUI's output folder as quantized_00001.safetensors. Empty this out to skip the file entirely and just get the in-memory model. To load the file later, move it into models/diffusion_models.
protect - the interesting one. Give it 0.1 and the worst tenth of layers by quantization error stay one step finer, which is a cheap way to stop w4a8 falling apart on a particular layer.
group_size and scales are advanced; leave them on defaults unless you're reproducing someone's published file exactly.
Output is model, quantized, plus the saved file. Note that the node is an output node - it will run and write even if nothing is wired downstream, and it caches like anything else, so changing nothing means no second file.
Installing it
ComfyUI Manager, search WAS Node Suite v3, restart. Or:
cd ComfyUI/custom_nodes
git clone https://github.com/WASasquatch/was-node-suite-comfyui.git
ComfyUI 0.14.0+ and Python 3.10+. No pip packages - the quantization formats are ComfyUI's own. That's a real change from the pack's 2024 reputation, where the install pulled in a couple of dozen dependencies and could take your whole ComfyUI setup down with it.
Where it goes wrong
It needs the whole model in memory. You're quantizing a model you had to load first, so a 20 GB bf16 checkpoint needs to fit somewhere before it gets smaller. Quantize on the machine that can hold it, then move the file.
could not build the quantized weights back into a model that ComfyUI recognises. Usually a LoRA stack that patched keys the quantizer couldn't map back. Wire the model directly from Load Diffusion Model and re-apply the LoRAs after quantization.
LoRAs stop working on the saved file. You quantized with fused projections and your LoRA expects separate ones, or the other way round. Pick separate if you plan to keep layering LoRAs on the result.
A layer silently came out int8. If group_size doesn't divide a layer's width, that layer falls back to int8 convrot. Harmless, but it explains a w4a8 file that's bigger than you calculated.
Quantizing a model that already fit. If your card holds the bf16 or fp8 model comfortably, you're trading fidelity for nothing. People routinely report the speedup they were chasing came from removing --lowvram flags, not from a lower quant.
Inputs (9)
| Name | Type | Default | Description |
|---|---|---|---|
| model | MODEL | The diffusion model to quantize; MODEL, such as from Load Diffusion Model. LoRAs applied before this node are merged in at full precision first. | |
| format | COMBO | int8 convrot | 'int8 convrot' = half of bf16, close to lossless, fast on RTX 20 series and newer; 'w6a8' = about 40%; 'w4a8' = about 30%, the most loss; 'fp8 e4m3fn' = RTX 40 and newer; 'mxfp8', 'nvfp4' = fast on RTX 50 only. |
| layers | COMBO | like Comfy-Org | 'like Comfy-Org' = the layers Comfy-Org's quantizer picks, or the layers and precision of Comfy-Org's own file for this model and format; 'transformer blocks' = every layer of the repeated blocks; 'every linear layer' = embeddings and final layer too, smaller, less faithful. |
| qkv | COMBO | as loaded | 'as loaded' = the model's own form; 'fused' = query, key and value in one layer, one matmul, as Comfy-Org ships its files; 'separate' = three layers, as LoRAs for split projections expect. Flux 3 and MOSS-Image have both. |
| attention | COMBO | as loaded | Kernel each attention layer is set to run. 'as loaded' = what the model already carries; 'like Comfy-Org' = int8 attention where Comfy-Org's own release sets it; 'int8 everywhere' = on every layer; 'clear' = none set. |
| protect | FLOAT | 0.000–0.5 | Share of the quantized layers with the largest error kept one step finer. 0 = none; 0.1 = the worst tenth. w6a8, w4a8, mxfp8 and nvfp4 layers go to int8 convrot; int8 and fp8 layers stay at the model's precision. |
| filename_prefix | STRING | diffusion_models/quantized | Where the quantized file is written in ComfyUI's output folder, such as `diffusion_models/flux3_int8`, numbered like `flux3_int8_00001.safetensors`. Empty = no file. Move it into models/diffusion_models to load it. |
| group_size | INT | 00–256 | Weights sharing one scale in w6a8 and w4a8. 0 = 32 for w6a8 and 16 for w4a8; 64 = smaller, a little less faithful. A layer it does not divide falls back to int8 convrot. |
| scales | COMBO | like Comfy-Org | How each int8 row's scale is set. 'row maximum' = its largest weight, nothing clipped; 'lowest error' = the clip of 55% to 100% with the least error, slower; 'like Comfy-Org' = what Comfy-Org's release of this model used, else row maximum. |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| model | MODEL | The quantized model; MODEL, ready for a sampler. |