Extensions/Universal FP8 / NVFP4 Quantizer
ComfyUI Extension

Universal FP8 / NVFP4 Quantizer

Mixed FP8 and NVFP4 quantization for SDXL, Wan 2.2, Qwen Image, Z-Image, FLUX, and FLUX.2 diffusion models in ComfyUI

By thepororo·Created 2 months ago·Updated 2 months ago· 0
thepororo/ComfyUI-NVFP4-Quantizer
Nodes
On cloudLocal install
Stars0
Updated2 months ago
Readme

ComfyUI Universal FP8 / NVFP4 Quantizer

English | 简体中文 | 한국어

ComfyUI Sponsor

A self-contained ComfyUI output node for mixed FP8/NVFP4 quantization of diffusion-model .safetensors files.

Supported architectures

  • SDXL
  • Wan 2.2
  • Qwen Image and Qwen Image Edit
  • Z-Image
  • FLUX and FLUX.2
  • Generic transformer fallback

Installation

cd ComfyUI/custom_nodes
git clone https://github.com/thepororo/ComfyUI-NVFP4-Quantizer.git

Restart ComfyUI. The node appears under model/quantization as Universal FP8 / NVFP4 Quantizer.

Usage

  1. Select a model from ComfyUI's models/diffusion_models list.
  2. Use architecture=auto, preset=balanced, and estimate_only=true.
  3. Review the detected architecture and estimated output size in log.
  4. Disable estimate_only to create the quantized model.

The output is written beside the selected source model. Leave output_filename empty to use <source_name>_nvfp4.safetensors.

Presets

  • balanced: attention FP8, FFN NVFP4, other large Linear layers FP8.
  • quality: attention FP8, FFN NVFP4, miscellaneous Linear layers BF16.
  • aggressive: attention and FFN NVFP4.
  • fp8_all: large eligible Linear layers FP8.
  • custom: use the individual format controls.

Sensitive layers, small matrices, convolution weights, norms, and biases are protected according to the selected settings. SDXL convolution weights cannot use NVFP4 because this implementation supports 2D Linear weights only.

Requirements and warnings

  • NVFP4 conversion requires CUDA and a ComfyUI/comfy-kitchen build containing TensorCoreNVFP4Layout.
  • Start from an original BF16/FP16 model, not an already quantized file.
  • Quantization is lossy. Keep the source model.
  • Test model quality before production use.

Support development

If this node saves GPU storage or experimentation time, you can support compatibility testing, documentation, bug fixes, and new architecture support through GitHub Sponsors.

Sponsorship is optional. It never unlocks required node functionality and the node does not display donation pop-ups or open external pages while running. See SUPPORT.md for the maintainer's story, sponsorship details, and separate paid implementation support.

Development note

Designed and maintained by thepororo with implementation assistance from OpenAI Codex. AI-assisted changes are reviewed and validated locally before publication.