black-forest-labs/FLUX.2-small-decoder
178206k
1---2license: apache-2.03language:4- en5pipeline_tag: image-to-image6tags:7- text-to-image8- image-editing9- flux10- diffusion-single-file11---12 1314 15`FLUX.2 Small Decoder` is a distilled VAE decoder that serves as a **drop-in replacement** for the standard FLUX.2 decoder. It delivers faster decoding and lower VRAM usage with minimal to zero quality loss. The encoder remains unchanged.16 17# **Key Features**18 19 1. **~1.4x faster decoding** compared to the full decoder.20 2. **~1.4x less VRAM** at decode time, enabling higher resolutions without running out of memory.21 3. **~28M decoder parameters** (vs ~50M in the full decoder) thanks to narrower channel widths (`[96, 192, 384, 384]` vs `[128, 256, 512, 512]`).22 4. **Minimal quality loss** — images are almost identical.23 5. Available under the Apache 2.0 license.24 25Compatible with all open FLUX.2 models:26- [FLUX.2-klein-4B](https://huggingface.co/black-forest-labs/FLUX.2-klein-4B)27- [FLUX.2-klein-9B](https://huggingface.co/black-forest-labs/FLUX.2-klein-9B)28- [FLUX.2-klein-9b-kv](https://huggingface.co/black-forest-labs/FLUX.2-klein-9b-kv)29- [FLUX.2-dev](https://huggingface.co/black-forest-labs/FLUX.2-dev)30 31# **Comparison**32 33| Full Decoder | Small Decoder |34|:---:|:---:|35|  |  |36 37# **Usage**38 39```shell40pip install git+https://github.com/huggingface/diffusers.git41```42 43```python44import torch45from diffusers import Flux2KleinPipeline, AutoencoderKLFlux246 47device = "cuda"48dtype = torch.bfloat1649 50vae = AutoencoderKLFlux2.from_pretrained("black-forest-labs/FLUX.2-small-decoder", torch_dtype=dtype)51pipe = Flux2KleinPipeline.from_pretrained("black-forest-labs/FLUX.2-klein-4B", vae=vae, torch_dtype=dtype)52pipe.enable_model_cpu_offload()53 54prompt = "A black cat holding a sign that says 'hello world' in typewriter font"55image = pipe(56 prompt=prompt,57 height=1024,58 width=1024,59 guidance_scale=1.0,60 num_inference_steps=4,61 generator=torch.Generator(device=device).manual_seed(0)62).images[0]63image.save("flux-klein-small-decoder.png")64```65 66 67---68# Limitations69 70- This model is not intended or able to provide factual information.71- While the model can output text, text rendered may be inaccurate or subject to distortion.72- As a statistical model, this checkpoint may represent or amplify biases observed in the training data.73- The model may fail to generate output that matches the prompts.74- Prompt following is heavily influenced by the prompting style.75 76# Out-of-Scope Use77 78This 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.79 80---81# Responsible AI Development82 83Black 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 AI84Misuse](https://bfl.ai/blog/capable-open-and-safe-combating-ai-misuse).85 86To report safety concerns, contact safety@blackforestlabs.ai.87 88---89 90# License91 92This model is licensed under the https://www.apache.org/licenses/LICENSE-2.0.93 94# Trademarks & IP95 96This 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.97 