FLUX.2 klein 4B β Core AI
Black Forest Labs' FLUX.2 [klein] 4B converted to Core AI for on-device image generation on Apple Silicon (macOS 27+), running on Apple's official diffusion runtime in apple/coreai-models.
FLUX.2 [klein] is step-distilled: 4 denoising steps at guidance 1.0 produce a full 1024Γ1024 image. It pairs a 4B flow-matching diffusion transformer (DiT) with an 8B Qwen3 text encoder.
Components
| Component | Description |
|---|---|
Transformer.aimodel |
Flow-matching DiT (25 blocks), 1024Γ1024 |
TextEncoder.aimodel |
Qwen3 text encoder (hidden states 9 / 18 / 27) |
VAEDecoder.aimodel |
Latent β 1024Γ1024 RGB image |
VAEEncoder.aimodel |
1024Γ1024 RGB image β latent (image-to-image) |
tokenizer/, pipeline.json, vae_bn_*.npy |
Sidecar assets (auto-loaded) |
Weights are 4-bit quantized (int4, per-block, block size 32); compute precision float16. The full bundle is 4.0 GB β Transformer 2.0 GB Β· TextEncoder 1.8 GB Β· VAE 0.16 GB.
Usage
Sample app (easiest)
CoreAIImageGenMac β pick "FLUX.2 klein 4B", tap Download & Load, type a prompt, Generate.
Swift
import CoreAIDiffusionPipeline
let pipeline = try await Flux2Pipeline(from: modelURL)
let config = PipelineConfiguration(
prompt: "a photo of a cat",
stepCount: 4,
guidanceScale: 1.0,
schedulerType: .discreteFlow
)
let result = try await pipeline.generateImages(configuration: config) { _ in true }
let image = result.images.first!
Command line (zoo reference tool)
swift run -c release diffusion-runner \
--model path/to/FLUX.2-klein-4B \
--prompt "a photo of a cat" --steps 4 --guidance-scale 1.0
How it was converted
uv run coreai.diffusion.export flux2-klein-4b --platform macOS
Performance
M4 Max (128 GB): ~17 s for a 4-step 1024Γ1024 image (cold model load + 4 denoising steps + VAE decode). The distilled 4-step schedule means no negative prompt / CFG is needed (guidance 1.0).
License
Apache 2.0, inherited from the base model black-forest-labs/FLUX.2-klein-4B. The converted weights are redistributed under the same terms, with attribution to Black Forest Labs.
Model tree for mlboydaisuke/FLUX.2-klein-4B-CoreAI
Base model
black-forest-labs/FLUX.2-klein-4B