Quantized Transformer in this repo: svdq-<precision>_r32-FLUX.2-klein-9B-kv-Nunchaku.safetensors; fill <precision> with nunchaku.utils.get_precision() based on your environment and Nunchaku build, commonly fp4 or int4
Diffusers-side companion files (VAE, text encoder, etc.): kept consistent with the Hugging Face repo root, so you can load the pipeline from the same from_pretrained path
FLUX.2 [klein] 9B-KV is a KV-cache optimized variant of FLUX.2 [klein] 9B, mainly targeting multi-reference image editing and interactive workflows that reuse the same reference image repeatedly. It caches the key-value pairs of reference-image tokens in the first denoising step and reuses them in later steps, avoiding redundant computation. According to the upstream model card, this can provide up to 2.5x speedup in multi-reference editing scenarios.
Key Points From The Upstream Model Card
Capability scope: preserves the core capabilities of FLUX.2 klein 9B, including text-to-image, image-to-image, and multi-reference editing
KV-cache mechanism:
Step 0: run the full forward pass, process reference-image tokens, and extract the KV cache
Steps 1-3: reuse the cached KV pairs and skip repeated reference-image computation
Best-fit scenarios: multi-reference editing, generating multiple variants from the same reference image, and low-latency interactive image editing applications
Model shape: 9B flow model with an 8B Qwen3 text embedder, distilled for the common 4-step inference setup
Official inference stack: uses Flux2KleinKVPipeline in Diffusers
API availability: the upstream model card states that the model is available through the BFL API
Compared with the non-KV variant, the main difference is not a different task type, but reduced redundant computation when the same reference image participates in multiple denoising steps. If your workflow repeatedly reuses the same reference image, the KV variant is usually the better fit.
Quantization Quality (Excerpt From Internal Evaluation)
Under MCO, Base + TR + TE remains the best-balanced option for speed and VRAM: for image editing, peak VRAM drops from 20.18 GB to 7.52 GB while throughput increases 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 compresses memory usage very 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: a Diffusers build that supports Flux2KleinKVPipeline is required; the upstream example installs it 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.
python -c "import nunchaku; from nunchaku import NunchakuFlux2Transformer2DModel; print(nunchaku.__version__)"
Minimal example (KV Pipeline + quantized Transformer)
The example below assumes vitoom-nunchaku is installed and weights are available locally or via tonera/FLUX.2-klein-9B-kv-Nunchaku. Replace REPO with your local path or Hugging Face model ID.
python
1import torch
2from diffusers import Flux2KleinKVPipeline
3from diffusers.utils import load_image
45from nunchaku import NunchakuFlux2Transformer2DModel
6from nunchaku.utils import get_precision
78REPO ="tonera/FLUX.2-klein-9B-kv-Nunchaku"# or a local absolute path9NAME ="FLUX.2-klein-9B-kv-Nunchaku"1011transformer = NunchakuFlux2Transformer2DModel.from_pretrained(12f"{REPO}/svdq-{get_precision()}_r32-{NAME}.safetensors",13 torch_dtype=torch.bfloat16,14)15pipe = Flux2KleinKVPipeline.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()2526# Text-to-image (without passing image)27image = pipe(28 prompt="A cat holding a sign that says hello world",29 height=1024,30 width=1024,31 num_inference_steps=4,32 generator=torch.Generator(device="cuda").manual_seed(0),33).images[0]34image.save("t2i_output.png")3536# Image editing / reference-image use case where KV cache is most relevant37ref = load_image("https://example.com/your_ref.png").convert("RGB")38image_kv = pipe(39 prompt="A cat dressed like a wizard",40 image=ref,41 height=1024,42 width=1024,43 num_inference_steps=4,44 generator=torch.Generator(device="cuda").manual_seed(0),45).images[0]46image_kv.save("kv_output.png")
If you generate multiple variants from the same reference image, the KV variant usually shows a clearer advantage. If memory is tight, you can also use strategies such as pipe.enable_model_cpu_offload().
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, and multi-reference editing—no manual wheel install or file copying. See docker-usage-en.md.
In the Web UI: Models → download and activate tonera/FLUX.2-klein-9B-kv-Nunchaku → run in Image workspace.
Limitations, Hardware, And Compliance
Limitations: the upstream model card notes that the model is not intended to provide factual information; rendered text may be distorted; outputs may reflect biases in the training data; and prompt following is influenced by prompting style
Out-of-scope use: the model must not be used for unlawful, fraudulent, defamatory, harassing, or otherwise policy-violating scenarios
Hardware reference: the upstream model card lists about 29GB VRAM for the original KV version and targets RTX 5090 or above; after quantization, practical memory usage is about 17GB. If used together with tonera/Qwen3-text-Nunchaku, VRAM usage can be reduced substantially further
Responsible AI: Black Forest Labs states that it evaluated and mitigated risks including CSAM and NCII before release; see its safety materials for details. Safety issues can be reported to safety@blackforestlabs.ai
License And Notes
These quantized weights are derived from FLUX.2-klein-9b-kv. Usage must comply with the FLUX Non-Commercial License and Black Forest Labs acceptable-use policies. Please confirm licensing separately if you need commercial use.
The model card YAML uses license: other only because Hugging Face metadata fields are limited to a fixed enum and do not include a dedicated FLUX non-commercial option. The legally binding terms are the linked license above, not the placeholder value other itself.