FLUX.2 [klein] 9B-KV: KV-cache optimized variant for accelerated multi-reference editing
FLUX.2-klein-9b-kv is a KV-cache-optimized variant of the 4-step
distilled FLUX.2 [klein] 9B image-editing flow model. In standard
multi-reference image editing, reference-image tokens are reprocessed
through every denoising step; this variant computes them once on
step 0, caches the per-layer key-value pairs, and on steps 1–3
attends to the cached KVs without recomputing the reference token
representations. Reported speedup is up to 2.5× on multi-reference
editing while retaining all capabilities of the standard Klein 9B
(sub-second T2I and editing in 4 steps). Distributed as a separate
HF checkpoint under the FLUX Non-Commercial License with bf16 / FP8
variants, a reference Diffusers pipeline (Flux2KleinKVPipeline), a
reference GitHub implementation, and API availability via bfl.ai.
Key claims
Section titled “Key claims”- KV-caching is applied to the reference-image tokens in a flow-based image-editing DiT: step 0 runs a full forward pass on the reference tokens and stores per-layer K, V; subsequent steps (1–3) read those K, V from cache rather than recomputing them [§How it works].
- Up to 2.5× faster inference for multi-reference editing relative to the standard Klein 9B baseline [§Performance].
- All capabilities of the standard FLUX.2 [klein] 9B are retained: sub-second T2I, advanced editing in 4 inference steps, 9B flow transformer with 8B Qwen3 text embedder [§Model description].
- The variant is shipped as a separate checkpoint (
black-forest-labs/FLUX.2-klein-9b-kv), distinct fromFLUX.2-klein-9B, with both bf16 and FP8 forms, a reference Diffusers pipelineFlux2KleinKVPipeline, a reference GitHub implementation, and API availability via bfl.ai [§Usage, §Availability]. - The acceleration is structural — it exploits the fact that reference tokens carry information that does not need to be refined across denoising steps, while latent (noisy generation) tokens still go through the full DiT every step [§How it works].
- License is unchanged from the rest of the FLUX.2 [klein] 9B family: FLUX Non-Commercial License [§License].
Method
Section titled “Method”In a standard flow-/diffusion-based image-editing DiT, the network attends jointly over (a) the noisy latent tokens being denoised and (b) reference-image tokens supplied as conditioning. At each denoising step, both sets are projected to Q, K, V and the full attention is computed. Because the reference tokens do not change across steps, their K and V are also unchanged — they are recomputed redundantly.
The KV-cache variant exploits this. On step 0 it runs a full forward pass that includes the reference tokens, capturing per-layer K and V for the reference-token positions into a cache. On steps 1, 2, 3 the forward pass processes only the noisy latent tokens; when each attention layer needs K, V at reference positions, it reads them from the cache rather than re-projecting them through the network. The distilled student already runs in only 4 steps, so caching across the remaining 3 steps captures most of the available redundancy.
The packaging is the standard Klein 9B-family release: a separate HF
checkpoint, a reference inference repo on GitHub, a Diffusers
Flux2KleinKVPipeline, bf16 and FP8 weights, and bfl.ai API access.
A community GGUF quantization (Q2–Q8) and ComfyUI workflows appeared
shortly after release.
Results
Section titled “Results”The model card reports:
- Up to 2.5× faster inference on multi-reference editing relative to standard Klein 9B [§Performance, §How it works].
- All capabilities of the standard Klein 9B retained — no quality degradation is reported on the card [§Model description].
- Particularly beneficial for: editing with multiple reference images, generating variations with the same references, and interactive editing applications where reference images are held constant across many user iterations [§Use cases].
No FID / CLIP / Elo numbers, no plots, no per-task latency breakdowns on the model card itself.
Why it’s interesting
Section titled “Why it’s interesting”This is the simplest possible “KV-cache transplant” from autoregressive
LM inference to flow-/diffusion-based image editing, applied to the
sub-population of tokens (reference images) whose representations are
invariant across denoising steps. It pairs directly with two threads
the wiki has been tracking: it sits on top of step-distillation (the
underlying Klein 9B is the 4-step distilled checkpoint covered in
FLUX.2 [klein]: Towards Interactive Visual Intelligence), and it
contrasts with activation-reuse approaches like TEACache / First Block
Caching / DeepCache (under the candidate concept
approximate-step-caching, see
Run FLUX.1-dev three times faster) — Klein-KV reuses exact
KVs for a partition of tokens across all steps, rather than reusing
approximate full-network activations across adjacent steps.
The use case the originating Slack note flags — applicability to omni — is well-posed: any Luma model that consumes multi-image
reference conditioning (omni-style identity / control inputs) where
the references stay fixed across denoising or AR-rollout steps has the
same redundancy, and the same fix should drop in.
See also
Section titled “See also”- FLUX.2 [klein]: Towards Interactive Visual Intelligence — the base 4-step distilled Klein 9B this variant is built on; Klein-KV is a serving-time optimization on top of the same checkpoint family
- Open foundation-model releases — separate-checkpoint, multi-quantization, multi-backend release pattern; Klein-KV is shipped as a distinct HF model id alongside bf16/FP8/GGUF variants and a reference Diffusers pipeline
- Diffusion Distillation — Klein 9B is itself step-distilled to 4 NFE; Klein-KV is the orthogonal axis of which tokens are recomputed per step, composable with any distilled few-step student
- Run FLUX.1-dev three times faster — the related but distinct family of activation-reuse diffusion acceleration (TEACache, First Block Caching, DeepCache) on FLUX.1-dev; Klein-KV is exact KV reuse on a token partition rather than approximate activation reuse across steps
- Reference Diffusers PR / repo — https://github.com/huggingface/diffusers
- BFL inference repo — https://github.com/black-forest-labs/flux2
- HF FP8 variant — https://huggingface.co/black-forest-labs/FLUX.2-klein-9b-kv-fp8