mlx-community/FLUX.2-klein-4B-bf16

MLX (bf16) snapshot of black-forest-labs/FLUX.2-klein-4B (Apache-2.0) for Apple Silicon — a compact rectified-flow MMDiT (5 double + 20 single blocks)

  • Qwen3-4B 3-layer-tap conditioner + FLUX.2 VAE. Standard diffusers tree (transformer/ text_encoder/ vae/ tokenizer/), loaded by the Swift/MLX port; int8/int4 are produced at load time (int4 DiT ~2.35 GB → a q4 pipeline fits a 16 GB Mac).

4B only — the 9B klein variants are FLUX Non-Commercial; this Apache-2.0 4B is the wrapped tier.

Parity (Swift port vs diffusers goldens, fp32/CPU)

  • MMDiT: cosine ≥0.9999995 at the 64×64 production grid (all blocks + norm_out + whole-forward)
  • FLUX.2 VAE decode 105–130 dB · Qwen3 3-layer-tap encoder cosine 0.9999999
  • GPU int4 1024²/4-step ~6 s.

Use (Swift / MLXEngine)

import MLXKlein
import MLXToolKit
let pkg = Klein4BT2IPackage(configuration: .init(quant: .int4, snapshotPath: "<this repo dir>"))
try await pkg.load()
let r = try await pkg.run(T2IRequest(prompt: "a red fox in a snowy forest at sunrise, photorealistic",
                                     width: 1024, height: 1024, seed: 42)) as! T2IResponse

Code: https://github.com/xocialize/flux2-klein-swift

Downloads last month

-

Downloads are not tracked for this model. How to track
MLX
Hardware compatibility
Log In to add your hardware

Quantized

Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Model tree for mlx-community/FLUX.2-klein-4B-bf16

Finetuned
(33)
this model

Collection including mlx-community/FLUX.2-klein-4B-bf16