FLUX.2 [klein] 9B-KV is an optimized variant of FLUX.2 [klein] 9B with KV-cache support for accelerated multi-reference editing. This variant caches key-value pairs from reference images during the first denoising step, eliminating redundant computation in subsequent steps for significantly faster multi-image editing workflows.
For more information about FLUX.2 [klein], please read our blog post.
Key Features
KV-Cache Optimization: Reference image KV pairs are computed once and cached, reducing computation and speeding up inference by up to 2.5 times for multi-reference editing tasks.
All capabilities of FLUX.2 [klein] 9B: sub-second generation, text-to-image, and multi-reference editing in a single unified model.
Ideal for interactive applications and real-time editing pipelines where the same reference images are used across multiple generations.
9B flow model with 8B Qwen3 text embedder, step-distilled to 4 inference steps.
Available for non-commercial use.
How KV-Caching Works
In standard image editing, reference image tokens are processed at every denoising step. With KV-caching:
Step 0: Full forward pass processes reference tokens and extracts their key-value pairs into a cache.
Then you can use Flux2KleinKVPipeline to run the model:
python
1import torch
2from diffusers import Flux2KleinKVPipeline
34device ="cuda"5dtype = torch.bfloat16
6model_path ="black-forest-labs/FLUX.2-klein-9b-kv"78pipe = Flux2KleinKVPipeline.from_pretrained(model_path, torch_dtype=dtype)9pipe.to(device)1011# Text-to-image (no reference image)12print("Generating text-to-image...")13image = pipe(14 prompt="A cat holding a sign that says hello world",15 height=1024,16 width=1024,17 num_inference_steps=4,18 generator=torch.Generator(device=device).manual_seed(0),19).images[0]20image.save("t2i_output.png")21print("Saved t2i_output.png")2223# Image-to-image with KV cache (using the generated image as reference)24print("Generating image-to-image with KV cache...")25image_kv = pipe(26 prompt="A cat dressed like a wizard",27 image=image,28 height=1024,29 width=1024,30 num_inference_steps=4,31 generator=torch.Generator(device=device).manual_seed(0),32).images[0]33image_kv.save("kv_output.png")34print("Saved kv_output.png")
Limitations
This model is not intended or able to provide factual information.
While the model can output text, text rendered may be inaccurate or subject to distortion.
As a statistical model, this checkpoint may represent or amplify biases observed in the training data.
The model may fail to generate output that matches the prompts.
Prompt following is heavily influenced by the prompting style.
Out-of-Scope Use
This model and its derivatives may not be used outside the scope of the license, including for unlawful, fraudulent, defamatory, abusive, or otherwise violative purposes as further explained in our Usage Policies.
Hardware
The FLUX.2 [klein] 9B-KV model fits in ~29GB VRAM and is accessible on NVIDIA RTX 5090 and above.
Responsible AI Development
Black Forest Labs is committed to responsible model development and deployment. Prior to releasing FLUX.2 [klein] 9B-KV, we evaluated and mitigated a number of risks, including child sexual abuse material (CSAM) and nonconsensual intimate imagery (NCII). For detailed information about our mitigations, evaluation processes, content provenance features, and policies, please see our post: Capable, Open, and Safe: Combating AI
Misuse.
This project may contain trademarks or logos for projects, products, or services. Use of Black Forest Labs and FLUX trademarks or logos in modified versions of this project must not cause confusion or imply sponsorship or endorsement. Any use of third-party trademarks, intellectual property or logos are subject to those third-party's policies.