Converting a model to NVFP4 means running post-training quantization with Model Optimizer or llm-compressor for LLMs, or a comfy-kitchen based converter for diffusion checkpoints. The result is a new file with 4-bit weights. Running it fast still needs Blackwell cards.
Which tool converts a model to NVFP4?
The latest Model Optimizer release was v0.48.0, tagged in early November. The latest llm-compressor release was v0.15.0, tagged in late October. General background is on the quantization page.
| tool | models | calibration | output |
|---|---|---|---|
| hf_ptq.py | LLMs, VLMs | data-driven | checkpoint folder for vLLM or SGLang |
| quantize.py (diffusers) | FLUX, LTX-Video, image and video models | 128-256 prompts | --hf-ckpt-dir folder |
| oneshot() | LLMs, VLMs | 20-256 samples | compressed-tensors folder |
| comfy-dit-quantizer | ComfyUI checkpoints | optional scale pass | one .safetensors file |
How is an LLM converted to NVFP4?
In llm-compressor, a recipe of QuantizationModifier(targets="Linear", scheme="NVFP4", ignore=["lm_head"]) goes into oneshot(), and save_pretrained() writes the folder. The NVFP4 example calibrates on 20 samples.
In Model Optimizer, python hf_ptq.py --pyt_ckpt_path <model> --qformat nvfp4 --export_path <dir> does the same job. Its docs recommend nvfp4_mlp_only for better accuracy, since attention layers stay in higher precision.
How are diffusion models converted for ComfyUI?
The ComfyUI loader reads one file, so converters rewrite chosen layers inside it. comfy-dit-quantizer reads a JSON file of per-layer rules and runs python quantize.py config.json model.safetensors output.safetensors. NVFP4 layers then need an input-scale pass: generate images with COMFY_CALIB=1, then run add_input_scale.py.
The Starnodes converter wraps this as a node and also converts on CPU. Lower-precision alternatives are compared in GGUF versus FP8 speed.
Sources
- Model Optimizer README: hf_ptq.py flags, recipes, diffusers example, fetched 2026-11-28.
- llm-compressor NVFP4 example: recipe code, group size 16, calibration counts, SM100 caveat.
- comfy-kitchen: NVFP4 layout needs SM 10.0 or newer, plus the converter repos above.