Instructions to use BennyDaBall/Qwen-Image-2.1-NVFP4 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Diffusion Single File
How to use BennyDaBall/Qwen-Image-2.1-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 2.1 β NVFP4 for ComfyUI
This is an independent NVFP4 quantization of Qwen Image 2.1. The Qwen team created the original model. The original model and architecture are Qwen's work. I converted the official Comfy-Org/Qwen-Image-2.1 BF16 checkpoint package and packaged the quantized weights, workflows, and validation here. This is not a new base model or an official Qwen release.
The image model AND the text encoder. 12.42 GB for the complete package.
I converted Qwen Image 2.1's image transformer and Qwen3-VL 8B language encoder directly from the official BF16 weights into native ComfyUI NVFP4. The vision tower, embeddings, output head, critical image-model tensors, and VAE stay BF16. Real Blackwell FP4 kernels in both denoising and text conditioning, with an included small runtime patch for the latter. No new nodes.
Built with Qwen. Research/evaluation use only under the included license.
RTX 5090: 6.746 s median for a complete 1024Γ1024, 40-step run versus 15.629 s with BF16 and 7.553 s with official INT8. Three warm runs per variant, every node executed, including text encoding. This one-prompt benchmark used the encoder patch; full method and limits.
π¦ Download once, wire nothing
Tested with ComfyUI 0.36.0, PyTorch 2.14.0+cu130, comfy-kitchen 0.2.35,
and an RTX 5090. Use a ComfyUI build with TextEncodeQwenImage21 and native
NVFP4 support. Older builds without the Qwen Image 2.1 integration will not work.
| File | Where it goes | Size |
|---|---|---|
| qwen_image_2.1_nvfp4.safetensors | ComfyUI/models/diffusion_models/ |
4.20 GB |
| qwen3vl_8b_nvfp4.safetensors | ComfyUI/models/text_encoders/ |
7.55 GB |
| qwen_image_2.1_vae_bf16.safetensors | ComfyUI/models/vae/ |
0.68 GB |
The original BF16 set is 32.44 GB. This package is 61.7% smaller on disk. File sizes are decimal GB, not a VRAM requirement. Keep your existing identical VAE if you already have it.
- Put the three files in the folders above and refresh ComfyUI's model list.
- For accelerated NVFP4 text conditioning, apply the runtime patch and restart. Without it, the same models and nodes work, but text conditioning uses dequantized weights and FP32 activations. Denoising still uses NVFP4.
- Import one of the workflows below using Ctrl+O, then click Run.
- For editing, use Upload in Load Image to select the included reference image, or your own image.
| Working workflow | Purpose |
|---|---|
| 01 β Text to image | 1024Γ1024 product example; change the prompt and latent size |
| 02 β Image editing | One reference, coherent material/color/object changes |
| 03 β Transparent RGBA | Native alpha output; no background-removal node |
| 04 β 2K typography | 2048Γ2048 poster with exact requested lettering |
The workflows use core UNETLoader, CLIPLoader (type qwen_image),
TextEncodeQwenImage21, KSampler, and VAE nodes. Leave diffusion weight dtype
at default. Defaults are 40 steps, Euler, simple scheduler, CFG 1, denoise 1.
The encoder node's resolution controls reference resizing; text-to-image output
size comes from Empty Latent Image. API equivalents are in workflows/api.
π Same prompts, same seeds
All 24 matched pairs are in COMPARISONS.md. Download
gallery.html and its assets folder together for the offline comparison slider.
See PROMPTING.md for text, editing, lettering and transparency tips.
See VALIDATION.md for the test set, measured results, precision tradeoffs, and execution requirements. The comparisons use BF16 source weights against this complete accelerated NVFP4 package. Quantization changes results; this is not a promise of pixel-identical output or a universal quality ranking.
π§ What's actually quantized?
| Component | Policy |
|---|---|
| Image transformer | 192 attention Q/K/V/output and fused MLP gate/up/output matrices: NVFP4 |
| Qwen3-VL language backbone | 252 attention and MLP matrices: NVFP4 |
| Vision tower, token embeddings, language head | Original BF16 tensors retained |
| Image-model input/output, timestep, modulation, normalization | Original BF16 tensors retained |
| VAE | Original BF16 file, unchanged |
| Scales | E4M3 FP8 blocks of 16, FP32 tensor scales |
Native packed E2M1 FP4, native scale layout, and per-layer comfy_quant metadata.
This is a mixed-precision NVFP4 stack, not every parameter forced into four bits.
No GGUF loader, no requantization of the INT8 release, no dropped vision tower.
No calibration or fine-tuning was used for this conversion.
π§ Reproduce it
Source repository: Comfy-Org/Qwen-Image-2.1,
revision ace0edeb3791a594ddfa36ed5f41a178a394e921.
Use the Python environment of the tested ComfyUI installation:
python tools/convert.py path/to/qwen_image_2.1_bf16.safetensors diffusion_models/qwen_image_2.1_nvfp4.safetensors --component dit --comfy-root path/to/ComfyUI
python tools/convert.py path/to/qwen3vl_8b_bf16.safetensors text_encoders/qwen3vl_8b_nvfp4.safetensors --component encoder --comfy-root path/to/ComfyUI
The converter uses installed Comfy Kitchen operations, validates matrix alignment,
and emits tensor manifests with source/output hashes and reconstruction error.
tools/verify.py SOURCE CONVERTED checks the stored format, checkpoint hash, and
exact equality of every protected tensor. Final file checksums are in SHA256SUMS.
βοΈ License & credits
Qwen created the base model; Comfy-Org provided the native BF16 checkpoint package; ComfyUI and Comfy Kitchen provide loading and GPU execution. Independent conversion, workflow packaging, and RTX 5090 validation by BennyDaBall_OG.
The Qwen Research License limits use to non-commercial research and evaluation; commercial use requires a separate license from Qwen. Read the full license and NOTICE. The included ComfyUI patch remains GPL-3.0. This repo is not affiliated with Qwen or Comfy-Org.
- Downloads last month
- 5,533


