Run this model with HF Jobs
Run InsecureErasure/FLUX.2-small-decoder-BF16 on Hugging Face's managed compute, monitor its progress, and retrieve the results when it's done.
Paste one of these prompts into your coding agent:
Fine-tune on my dataset
Use HF Jobs to fine-tune https://huggingface.co/InsecureErasure/FLUX.2-small-decoder-BF16. Ask me which dataset to train on, then push the fine-tuned model to a new model repo. Run `hf jobs --help` first to learn the CLI.
Run batch inference
Use HF Jobs to run batch inference with https://huggingface.co/InsecureErasure/FLUX.2-small-decoder-BF16 on the inputs in a mounted HF Bucket. Ask me which Bucket to use, then write the outputs back to it and keep each input ID. Run `hf jobs --help` first to learn the CLI.
Instructions to use InsecureErasure/FLUX.2-small-decoder-BF16 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Diffusion Single File
How to use InsecureErasure/FLUX.2-small-decoder-BF16 with Diffusion Single File:
# No code snippets available yet for this library. # To use this model, check the repository files and the library's documentation. # Want to help? PRs adding snippets are welcome at: # https://github.com/huggingface/huggingface.js
- Notebooks
- Google Colab
- Kaggle
Update README.md
Browse files13 unmodified lines141516171819202122232425262728293031323334353637388 unmodified lines474849313233343536373839404142434445464748495051525354555657585950515213 unmodified lines
`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.
Both images below have been generated using FLUX.2 Klein NVFP4 with BF16 VAEs.
<table style="width:auto"> <tr> <td align="center"><img src="./images/flux2-vae-small.png" style="width:45%"/></td> <td align="center"><img src="./images/flux2-vae.png" style="width:45%"/></td> </tr> <tr> <td align="center"><b>FLUX.2 VAE small</b></td> <td align="center"><b>FLUX.2 VAE</b></td> </tr></table>
**Prompt**<pre>A black cat holding a sign that says 'hello world' in typewriter font</pre>
# **Key Features**
1. **~1.4x faster decoding** compared to the full decoder.8 unmodified lines- [FLUX.2-klein-9b-kv](https://huggingface.co/black-forest-labs/FLUX.2-klein-9b-kv)- [FLUX.2-dev](https://huggingface.co/black-forest-labs/FLUX.2-dev)
# **Usage**
```shellpip install git+https://github.com/huggingface/diffusers.git```
```pythonimport torchfrom diffusers import Flux2KleinPipeline, AutoencoderKLFlux2
device = "cuda"dtype = torch.bfloat16
vae = AutoencoderKLFlux2.from_pretrained("InsecureErasure/FLUX.2-small-decoder-BF16", torch_dtype=dtype)pipe = Flux2KleinPipeline.from_pretrained("black-forest-labs/FLUX.2-klein-4B", vae=vae, torch_dtype=dtype)pipe.enable_model_cpu_offload()
prompt = "A black cat holding a sign that says 'hello world' in typewriter font"image = pipe( prompt=prompt, height=1024, width=1024, guidance_scale=1.0, num_inference_steps=4, generator=torch.Generator(device=device).manual_seed(0)).images[0]image.save("flux-klein-small-decoder.png")```
---# License
README.md+19-29