Instructions to use MESHIVEAI/Qwen-Image-2512-NVFP4 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Diffusion Single File
How to use MESHIVEAI/Qwen-Image-2512-NVFP4 with Diffusion Single File:
# No code snippets available yet for this library. # To use this model, check the repository files and the library's documentation. # Want to help? PRs adding snippets are welcome at: # https://github.com/huggingface/huggingface.js
- Notebooks
- Google Colab
- Kaggle
Qwen-Image-2512 NVFP4 for ComfyUI β about 1.8Γ faster on Blackwell
NVFP4 build of Qwen-Image-2512 that runs on the FP4 tensor cores of RTX 50 / RTX PRO Blackwell GPUs. Drop-in replacement for qwen_image_2512_fp8_e4m3fn.safetensors in the official ComfyUI template. Same size class as the official FP8 (21.9 GB vs 20.4 GB): the point is speed, not VRAM.
Every number below was measured by us on the setup stated next to it. Raw CSVs and the scripts are in this repo.
Speed (measured)
RTX 5090 (600 W power limit, driver 580.105.08), ComfyUI 0.37.0, PyTorch 2.11.0+cu130, 1328Γ1328, official template settings. Time is ComfyUI's own execution timestamp for one image; run 0 (model load) is excluded and runs 1β4 are averaged. BF16 does not fit in 32 GB and runs through ComfyUI's dynamic VRAM offload from system RAM.
| GPU | Precision | 50 steps, cfg 4 | Lightning 4-step | Lightning 8-step | VRAM peak (nvidia-smi) |
|---|---|---|---|---|---|
| RTX 5090 (32 GB) | BF16 (40.9 GB, RAM offload) | 75.5 s | 8.6 s | 11.8 s | 31.3 GB |
| RTX 5090 (32 GB) | Official FP8 e4m3fn (20.4 GB) | 76.6 s | 3.6 s | 6.7 s | 29.4 GB |
| RTX 5090 (32 GB) | NVFP4 (this repo, 21.9 GB) | 42.5 s (1.80Γ FP8) | 2.3 s (1.57Γ FP8) | 4.0 s (1.69Γ FP8) | 30.8 GB |
VRAM peak is what nvidia-smi showed while ComfyUI's dynamic VRAM management was active; it fills the card and is not the minimum needed. Raw runs: bench/5090/*/timings.csv. Quality logs: bench/quality/.
Quality (measured)
20 held-out prompts (not used for tuning), identical seed, resolution, steps, text encoder and VAE. Metrics against the BF16 output.
| Precision | LPIPS β (mean, 20 imgs) | SSIM β (mean, 20 imgs) |
|---|---|---|
| Official FP8 e4m3fn | 0.248 | 0.749 |
| NVFP4 (this repo) | 0.437 | 0.610 |
Text rendering
9 text prompts (English, Chinese, Korean signs, covers, posters) Γ 5 seeds = 45 images per precision, read by a human. A hit means every requested word is spelled correctly.
| Precision | English + Chinese (35 imgs) | Korean (10 imgs) |
|---|---|---|
| BF16 | 35 / 35 | 4 / 10 |
| Official FP8 e4m3fn | 35 / 35 | 2 / 10 |
| NVFP4 (this repo) | 34 / 35 | 0 / 10 |
English and Chinese text is on par with FP8 (one British spelling "Harbour" in 35). Korean is where FP4 hurts: the base model already gets Korean right only 4 times in 10 at BF16, FP8 halves that, and this NVFP4 build got 0 of 10 β the syllables come out as near-misses (λ¬λΉ β λ¬λ²). If you need Korean text, use BF16 or FP8.
BF16 | FP8 | NVFP4, same seed:
What is quantized
Comfy-Org's official NVFP4 recipe for the original Qwen-Image, plus the first and last three blocks kept in BF16 (that fixed English typos in our tests):
| Layers | Format |
|---|---|
blocks 3β56: attn.to_q/k/v/out, img_mlp |
NVFP4 (16-block E4M3 scales + per-tensor scale) |
blocks 3β56: img_mod, txt_mod, txt_mlp |
FP8 e4m3fn |
blocks 0β2 and 57β59, attn.add_* (text stream), norms, embedders, proj_out |
BF16 (unchanged) |
Activations use ComfyUI's dynamic per-call scaling (no static input_scale). _quantization_metadata format 1.0; loads natively with no custom nodes.
Things we tried that did not help, so you don't have to: promoting attn.to_out.0 to FP8 breaks the model (attention outputs have outliers that per-tensor FP8 scaling cannot hold; block-scaled NVFP4 copes better), and MSE 4/6 rounding alone changed nothing visible.
Requirements
- NVIDIA Blackwell (compute capability 10+). Older GPUs load the file but fall back to dequantization and gain nothing.
- PyTorch built for CUDA 13 (
+cu130) for the FP4 tensor-core path. Tested: 2.11.0+cu130. - ComfyUI 0.31 or newer. Tested: 0.37.0.
Usage
Put qwen_image_2512_nvfp4.safetensors in ComfyUI/models/diffusion_models/, open the official Qwen-Image 2512 template and pick it in Load Diffusion Model. Text encoder qwen_2.5_vl_7b_fp8_scaled.safetensors and VAE qwen_image_vae.safetensors come from Comfy-Org/Qwen-Image_ComfyUI. Works with the lightx2v Lightning LoRAs.
Reproduce
reproduce/ has everything: the quantizer config (config-nvfp4mixed-v4.json), two one-line fixes for comfy-dit-quantizer @ b89c8a7 (an undefined name in the NVFP4 branch, and streaming the 41 GB source instead of loading it all into RAM), the prompts, and the generation, comparison, grid and bench scripts used for every number above.
python quantize.py -m 4/6 config-nvfp4mixed-v4.json qwen_image_2512_bf16.safetensors qwen_image_2512_nvfp4.safetensors
Run it on Meshive
Meshive is a task-first GPU cloud. This model was built and benchmarked on an RTX 5090 pod there: meshive.ai/pods.
License
Apache-2.0, same as the base model. LICENSE included.
- Downloads last month
- 31
Model tree for MESHIVEAI/Qwen-Image-2512-NVFP4
Base model
DiffSynth-Studio/Qwen-Image-Distill-Full



