Quantized Transformer in this repo: svdq-<precision>_r32-FLUX.2-klein-9B-Nunchaku.safetensors; use nunchaku.utils.get_precision() for <precision> (commonly fp4 or int4) so the file name matches your GPU and Nunchaku build
Diffusers bundle (VAE, text encoder, etc.): same Hugging Face repo root; use the same from_pretrained path when loading the pipeline
FLUX.2 [klein] 9B is BFL’s distilled flow model, supporting text-to-image and multi-reference editing; hardware and licensing details are on the official model card.
Quantization quality (excerpt from this repo)
Metric
Mean
Median p50
p90
PSNR
17.56
17.52
20.62
SSIM
0.735
0.741
0.837
LPIPS
0.212
0.194
0.300
Also: mean rel_l2 ≈ 0.0717, mean cosine ≈ 1.0006 (raw value in data.json is 1.000562; may include floating-point error). For fuller notes and updates, see the Hugging Face model page.
In practice, Base + TR + TE is the best-balanced option under MCO: for image editing, peak VRAM drops from 20.18 GB to 7.52 GB while throughput rises to about 3.05x the base model; for text-to-image, VRAM drops from 18.53 GB to 6.42 GB while throughput rises to about 3.15x. Under SCO, quantization still improves speed substantially, but peak VRAM does not necessarily keep decreasing because the base SCO path already minimizes VRAM aggressively.
Option 1 (for users comfortable with coding)
Engine: vitoom-nunchaku — community-maintained Nunchaku build with FLUX.2 Klein and Qwen3 text encoder support
Framework: Diffusers with Flux2KleinPipeline support (official examples install from source):
Upstream Nunchaku has not merged FLUX.2 Klein support for a long time (PR #926 still pending). Do not copy patch files manually. Install the prebuilt wheel from tonera/vitoom-nunchaku that matches your platform, Python, and CUDA.
Optional quantized text encoder: tonera/Qwen3-text-Nunchaku (svdq-int4-Qwen3-text-Nunchaku.safetensors).
Verify:
python -c "import nunchaku; from nunchaku import NunchakuFlux2Transformer2DModel; print(nunchaku.__version__)"
Minimal example (image-to-image + quantized Transformer)
Assumes vitoom-nunchaku is installed and weights are available locally or at tonera/FLUX.2-klein-9B-Nunchaku; set REPO to your directory or Hugging Face model id.
python
1import torch
2from diffusers import Flux2KleinPipeline
3from diffusers.utils import load_image
45from nunchaku import NunchakuFlux2Transformer2DModel
6from nunchaku.utils import get_precision
78REPO ="tonera/FLUX.2-klein-9B-Nunchaku"# or local absolute path9NAME ="FLUX.2-klein-9B-Nunchaku"1011transformer = NunchakuFlux2Transformer2DModel.from_pretrained(12f"{REPO}/svdq-{get_precision()}_r32-{NAME}.safetensors",13 torch_dtype=torch.bfloat16,14)15pipe = Flux2KleinPipeline.from_pretrained(16 REPO, torch_dtype=torch.bfloat16, transformer=transformer
17)1819pipe.to("cuda")20# transformer.set_offload(21# True, use_pin_memory=False, num_blocks_on_gpu=122# )23# pipeline._exclude_from_cpu_offload.append("transformer")24# pipeline.enable_sequential_cpu_offload()2526ref = load_image("https://example.com/your_ref.png").convert("RGB")27image = pipe(28 prompt="Describe your edit in English…",29 image=ref,30 guidance_scale=1.0,# matches official Klein examples; tune if needed31 num_inference_steps=4,# common for the distilled model; see Diffusers docs otherwise32 generator=torch.Generator("cpu").manual_seed(1),33).images[0]34image.save("flux2_klein_nunchaku.png")
For text-to-image, omit image (behavior per current Diffusers Flux2KleinPipeline docs). Use pipe.enable_model_cpu_offload() or similar if VRAM is tight.
If the steps above feel too difficult, install the vitoom platform instead (see below).
Option 2 (recommended: vitoom)
We recommend deploying via vitoom: it ships a complete vitoom-nunchaku runtime, Web UI, multi-reference editing, and LoRA management—no manual wheel install or file copying. See docker-usage-en.md.
These quantized weights are derived from FLUX.2-klein-9B. Use is subject to the FLUX Non-Commercial License and Black Forest Labs’ acceptable use policy; confirm commercial rights separately.
The model card YAML uses license: other because Hugging Face’s allowed license keys do not include the FLUX Non-Commercial License; binding terms are those linked above, not the generic other label alone.