Instructions to use BennyDaBall/flux-3-image-klein-base-NVFP4 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Diffusion Single File
How to use BennyDaBall/flux-3-image-klein-base-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
The NVFP4 BFL Should Have Released!
FLUX 3 Image Klein Base, NVFP4 (BennyDaBall build)
A mixed-precision NVFP4 build of FLUX 3 Image Klein Base for ComfyUI: NVFP4 + 8-bit + bf16. The NVFP4 weights are solved with GPTQ plus a Schur Replay block-scale search that includes the Four Over Six scale points, and the sensitive layers stay 8-bit, re-quantized from BF16 with GPTQ.
On my RTX 5090 it renders 2.2% faster than BFL's INT8 ConvRot file and 7.0% faster than BFL's own NVFP4 file, and it lands 2.8x closer to the BF16 model than BFL's NVFP4. INT8 ConvRot is still a little closer to BF16 on a typical image; all numbers are below.
Numbers (RTX 5090, stock ComfyUI, same graph, same captions and seeds)
| File | Size | LPIPS vs BF16 (mean / median, lower = closer) | SSIM | s/img |
|---|---|---|---|---|
| BF16 (BFL) | 11.08 GB | reference | 1 | 20.13 |
| INT8 ConvRot (BFL) | 5.81 GB | 0.034 / 0.021 | 0.958 | 8.76 |
| NVFP4 (BFL) | 5.26 GB | 0.136 / 0.114 | 0.845 | 9.21 |
| NVFP4 (this repo) | 5.71 GB | 0.049 / 0.023 | 0.940 | 8.57 |
- 16 hand-written captions x 6 seeds = 96 renders per file, each compared to the BF16 render with the same caption and seed. LPIPS (AlexNet), SSIM and mean absolute difference on the full 1024x1024 renders. BF16 re-render noise floor: 0.
- This build is closer to BF16 than BFL's NVFP4 on 91 of 96 images (2.8x lower mean LPIPS, 5.0x lower median). INT8 ConvRot is closer to BF16 than this build on most images (65 of 96).
- Speed: warm median of 5 runs after a cold run, all four files back to back in one sitting (1024x1024). This build is 2.2% faster than INT8 ConvRot and 7.0% faster than BFL's NVFP4, which is 5.2% slower than INT8 on this setup.
- Text: 26 quoted strings x 3 seeds, read letter by letter by blind readers, with the hardest strings re-read for every file by the same two readers: BF16 75/78, INT8 76/78, this build 76/78, BFL NVFP4 78/78. This build's two misses are a stylized chalk "i" that BF16 and INT8 also paint, and one missing space.
- Peak VRAM (whole GPU, includes about 3 GiB of desktop use): this build 16.3 GiB, INT8 16.4 GiB, BFL NVFP4 16.1 GiB, BF16 20.9 GiB.
The sheet shows three extra showcase captions rendered at 1936x1088 (16:9) on every file, same seed per row, seeds picked on looks rather than on scores. The number under each image is that image's LPIPS vs BF16; the header means are the 96-render gold set. The terrier image drifts further from BF16 on every quantized file, which is why all three of its scores are higher.
Use it in ComfyUI
- Put
flux3-image-klein-base-nvfp4-bdb.safetensorsinComfyUI/models/diffusion_models/. - In the stock Klein Base text-to-image workflow, pick it in the Load Diffusion Model node (
weight_dtypedefault). Nothing else changes: same text encoder (qwen3vl_4b_bf16), same VAE, same sampler settings. - NVFP4 layers need an NVIDIA Blackwell GPU (RTX 50 series / RTX PRO Blackwell) for the FP4 speed-up.
The only difference between the four workflows used for the table is the diffusion model filename:
"class_type": "UNETLoader",
"inputs": {
- "unet_name": "flux3-image-klein-base-bf16.safetensors",
+ "unet_name": "flux3-image-klein-base-nvfp4-bdb.safetensors",
"weight_dtype": "default"
}
Test setup: ComfyUI 0.42.3, comfy-kitchen 0.2.40, torch 2.14.0 + CUDA 13.0, launched with --use-ck-attention (Comfy
Kitchen int8 attention for every file in the table). Klein Base, 1024x1024 (showcase sheet 1936x1088), 50 steps, CFG
3.5, euler / simple, empty negative prompt, prompt upsampler off. BFL recommends their prompt upsampler and 2K output for
the best-looking images; it was left off here so every file gets the identical caption.
How it was made
- Mixed precision: NVFP4 (W4A4, static activation scales calibrated on Klein's own trajectories) + 8-bit in BFL's INT8 ConvRot format (with its int8 attention markers) + bf16 for the small embedding and modulation layers. Which layers stay 8-bit was chosen by measured damage per millisecond, from per-layer sensitivity scans on held-out captions.
- NVFP4 weights: GPTQ (Frantar et al., 2022) with the block scale chosen inside the GPTQ loop by Schur Replay (arXiv 2609.36654), whose candidate set includes the Four Over Six points (arXiv 2512.02010, MIT Han Lab and NVIDIA) under the 4/6 global scale. Both papers evaluate language models; applying them to a DiT is my own integration.
- 8-bit weights: re-quantized from BF16 with GPTQ in the rotated ConvRot basis, with each row's scale picked the same way Schur Replay picks block scales: every candidate replays the row's full GPTQ update and the lowest GPTQ loss wins. That cuts the 8-bit layers' own weight error about 10x versus round-to-nearest (which is what BFL's INT8 file uses). Most of INT8's error comes from its 8-bit activations, so the end-to-end gain is small. A few 8-bit layers that text-to-image never runs, so calibration can't reach them, keep BFL's bytes.
- Calibration: 24 captions x 11 of the 50 sampler steps, both CFG branches, at 1024x1024. The gold captions used for the numbers above were never used for calibration.
- Every NVFP4 tensor is bit-exact to what ComfyUI's loader decodes, and every layer's bytes were read back after writing.
Per-layer formats are in the file's
comfy_quantmetadata.
Files
| File | Size | sha256 |
|---|---|---|
flux3-image-klein-base-nvfp4-bdb.safetensors |
5,712,184,969 bytes (5.71 GB) | 5102bde319527c5b46ebac0257a3c6063a31f8770fb1c2bc6016daef7484a79e |
bdb = BennyDaBall, so the file can sit next to BFL's flux3-image-klein-base-nvfp4.safetensors without a mix-up.
License and credits
FLUX 3 Image Klein Base is made by Black Forest Labs and released under the FLUX Kommunity License (LICENSE.md). This repository is a modified (quantized) derivative; see NOTICE.txt. It is not an official Black Forest Labs product and is not endorsed by Black Forest Labs. Use is limited to what the FLUX Kommunity License allows (non-commercial use, plus commercial use of outputs for Qualifying Users as defined there).
This FLUX Model is licensed by Black Forest Labs Inc. under the FLUX Kommunity License. Copyright Black Forest Labs Inc. IN NO EVENT SHALL BLACK FOREST LABS INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH USE OF THIS MODEL.
Thanks to Comfy-Org and comfy-kitchen for the NVFP4 and INT8 ConvRot runtime this file is built for.
- Downloads last month
- 28
Model tree for BennyDaBall/flux-3-image-klein-base-NVFP4
Base model
black-forest-labs/flux-3-image-klein-base
