FLUX.2 klein (MLX)
Collection
BFL FLUX.2-klein-4B (Apache-2.0) MMDiT text-to-image, MLX bf16 for Apple Silicon. Swift port: https://github.com/xocialize/flux2-klein-swift • 2 items • Updated
How to use mlx-community/FLUX.2-klein-4B-bf16 with MLX:
# Download the model from the Hub pip install huggingface_hub[hf_xet] huggingface-cli download --local-dir FLUX.2-klein-4B-bf16 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)
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.
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
Quantized
Base model
black-forest-labs/FLUX.2-klein-4B