MXFP4 Models
Collection
24 items • Updated
How to use intel-ai/FLUX.2-klein-4B-MXFP4-RTN-AutoRound with Diffusers:
pip install -U diffusers transformers accelerate
import torch
from diffusers import DiffusionPipeline
# switch to "mps" for apple devices
pipe = DiffusionPipeline.from_pretrained("intel-ai/FLUX.2-klein-4B-MXFP4-RTN-AutoRound", dtype=torch.bfloat16, device_map="cuda")
prompt = "Astronaut in a jungle, cold color palette, muted colors, detailed, 8k"
image = pipe(prompt).images[0]import torch
from diffusers import DiffusionPipeline
# switch to "mps" for apple devices
pipe = DiffusionPipeline.from_pretrained("intel-ai/FLUX.2-klein-4B-MXFP4-RTN-AutoRound", dtype=torch.bfloat16, device_map="cuda")
prompt = "Astronaut in a jungle, cold color palette, muted colors, detailed, 8k"
image = pipe(prompt).images[0]This is a MXFP4 (4-bit micro-scaling) quantization of black-forest-labs/FLUX.2-klein-4B, a lightweight distilled text-to-image model. Generated by AutoRound with RTN (round-to-nearest, iters=0).
Evaluated with vllm-omni diffusion harness (4 steps, guidance 1.0, 1024×1024, seed 42).
| Benchmark | BF16 Baseline | MXFP4 Quantized |
|---|---|---|
| DrawBench CLIP | 32.06 | 32.44 |
| DrawBench CLIP-IQA | 69.86 | 66.97 |
| DrawBench ImageReward | 1.05 | 1.00 |
| GenEval | 0.821 | 0.800 |
MXFP4 quantization shows some degradation vs the BF16 baseline (GenEval 0.800 vs 0.821, CLIP-IQA 66.97 vs 69.86). MXFP8 is recommended for higher fidelity.
from vllm_omni.entrypoints.omni import Omni
from vllm_omni.inputs.data import OmniDiffusionSamplingParams
omni = Omni(model="INCModel3/FLUX.2-klein-4B-MXFP4-RTN-AutoRound", mode="text-to-image")
params = OmniDiffusionSamplingParams(
height=1024, width=1024, seed=42,
guidance_scale=1.0, num_inference_steps=4, num_outputs_per_prompt=1,
)
out = omni.generate("a red bench in a park", sampling_params_list=[params])
Please follow the license of the original model black-forest-labs/FLUX.2-klein-4B.
Produced with autoquant-agent — agent-driven quantize + evaluate + self-heal.
Base model
black-forest-labs/FLUX.2-klein-4B