---
title: FLUX.2-klein-4B-bf16
canonical_url: "https://www.modelscope.cn/models/mlx-community/FLUX.2-klein-4B-bf16"
md_url: "https://www.modelscope.cn/models/mlx-community/FLUX.2-klein-4B-bf16.md"
repository: mlx-community/FLUX.2-klein-4B-bf16
last_updated: 2026-07-07
license: apache-2.0
pipeline_tag: text-to-image-synthesis
tasks:
  - text-to-image-synthesis
base_model:
  - black-forest-labs/FLUX.2-klein-4B
base_model_relation: finetune
parameters: 11.9B
tensor_type:
  - BF16
  - I64
library_name:
  - mlx
  - lora
  - safetensors
  - diffusers
  - pytorch
frameworks:
  - pytorch
downloads: 53
stars: 1
tags:
  - mlx
  - safetensors
  - apple-silicon
  - text-to-image
  - diffusion
  - mmdit
  - flux2
  - klein
---

# FLUX.2-klein-4B-bf16

> FLUX.2-klein-4B-bf16 - mlx-community 在 ModelScope 开源的模型。mlx-community/FLUX.2-klein-4B-bf16

mlx-community/FLUX.2-klein-4B-bf16 是 ModelScope 魔搭社区上的 11.9B 参数text-to-image-synthesis模型，采用 apache-2.0 许可，基于 black-forest-labs/FLUX.2-klein-4B 构建。

- **Repository**: mlx-community/FLUX.2-klein-4B-bf16
- **License**: apache-2.0
- **Tasks**: text-to-image-synthesis
- **Parameters**: 11.9B
- **Base model**: black-forest-labs/FLUX.2-klein-4B
- **Tags**: mlx, safetensors, apple-silicon, text-to-image, diffusion, mmdit, flux2, klein
- **Downloads**: 53
- **Stars**: 1
- **Last updated**: 2026-07-07

Source: https://www.modelscope.cn/models/mlx-community/FLUX.2-klein-4B-bf16

---

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

MLX (bf16) snapshot of **[black-forest-labs/FLUX.2-klein-4B](https://huggingface.co/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)
```swift
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
