Views
No views yet
float8wo) weight-only quantized version of
black-forest-labs/FLUX.2-klein-9B.
Both the diffusion transformer and the text encoder have their projection weights
stored in FP8 to cut memory roughly in half; the sensitive I/O layers are kept in BF16 to
preserve quality. Quantized with torchao and validated
end-to-end on an NVIDIA L40S (quantize → save → reload → inference, plus a paired
BF16-vs-FP8 fidelity eval).nn.Linear layers inside the transformer blocks
(transformer_blocks.* / single_transformer_blocks.*) were quantized (144 of 153
linears). The I/O boundary stays BF16: x_embedder / context_embedder, time & guidance
embedders, adaLN/modulation, norm_out / proj_out, and all norms.| Component | BF16 | FP8 (this repo) |
|---|---|---|
| Transformer weights | ~16.9 GB | ~8.8 GB (1.92×) |
| Text encoder | ~15.3 GB | ~8.8 GB (1.74×) |
| Full pipeline dir | — | ~17.75 GB |
| Metric | Value | Reading |
|---|---|---|
| LPIPS (perceptual) | 0.131 | low perceptual drift |
| PSNR | 23.3 dB | good fidelity |
| SSIM | 0.847 | good structural similarity |
abhishekchohan/flux2-klein-4b-fp8)
measured LPIPS 0.0995 / PSNR 23.76 dB / SSIM 0.902 on the same setup. If you need the
absolute highest fidelity, prefer the 4B, or keep the 9B text encoder in BF16.


1import torch
2from diffusers import Flux2KleinPipeline
3
4pipe = Flux2KleinPipeline.from_pretrained(
5 "abhishekchohan/flux2-klein-9b-fp8",
6 torch_dtype=torch.bfloat16,
7)
8pipe.enable_model_cpu_offload() # recommended at this size
9
10image = pipe(
11 prompt="a photo of a cat sitting on a windowsill at golden hour",
12 num_inference_steps=8,
13 guidance_scale=1.0,
14 height=1024,
15 width=1024,
16).images[0].bin (not safetensors) because torchao's
FP8 tensor subclasses cannot be serialized to safetensors. Loading therefore uses
torch.load deserialization:from_pretrained above — diffusers re-materializes the FP8
weights automatically. Requires a torchao install (pip install torchao).torchao weight-only quantization (Float8WeightOnlyConfig, float8_e4m3fn).black-forest-labs/FLUX.2-klein-9B still apply.