An unofficial native MLX port of inclusionAI/Ming-Image-0.2-Design for Apple silicon. It covers text-to-image only. Inference is pure MLX: no PyTorch, transformers or diffusers are needed.
All credit for the model goes to inclusionAI. This repository contains converted weights and an independent MLX implementation of the inference path (ming_mlx/). It is not affiliated with or endorsed by inclusionAI.
| component | precision | notes |
|---|---|---|
| BailingMoeV2 text encoder (16B total / 0.8B active MoE) | 8-bit (affine, group 64) | attention, MLPs and all 256 routed experts; routers, norms and embeddings stay BF16 |
| connector (Qwen2, 1.5B), projections, query tokens | BF16 | |
| diffusion transformer (6B) | BF16 | 8-bit/4-bit DiT gave no speed-up and hurt quality |
| Qwen-Image VAE decoder (RGBA) | BF16 | the 3D causal convs are collapsed exactly to 2D for single frames |
The vision tower, the LM head and the VAE encoder are not needed for text-to-image and are not included. Total download is about 30 GB.
pip install -U huggingface_hub # provides the `hf` CLI
hf download amarck/Ming-Image-0.2-Design-MLX --local-dir Ming-Image-0.2-Design-MLX
cd Ming-Image-0.2-Design-MLX
python -m venv .venv && source .venv/bin/activate
pip install -r requirements.txt
python -m ming_mlx.generate --model . --resolution 1024 \
--prompt 'A red fox reading a book titled "MLX" in a cozy library, warm light' \
--output-dir outputs --timings
Output is an RGBA PNG. Options:
| flag | values |
|---|---|
--resolution |
1024 or 2048; the default is 2048, matching upstream |
--steps |
default 12 |
--seed |
default 42 |
--prompts-file |
one prompt per line; prompts are encoded first, then the text encoder is freed, so peak memory stays the same as for one image (no reloads) |
--no-compile |
turn off mx.compile |
Seeds follow torch.manual_seed semantics and reproduce upstream's PyTorch initial noise, so the same seed gives the same starting point as the CUDA reference. Images are written as image_00.png, image_01.png, …, which overwrites earlier runs in the same --output-dir. Requires Python ≥ 3.10.
| upstream PyTorch on MPS (BF16) | this repo | |
|---|---|---|
| s/step at 1024² (short / long / cabin prompt) | 1.84 / 2.11 / 2.90 | 1.31 / 1.37 / 1.88 |
| time per 1024² image (incl. load, encode, decode) | 27–37 s | 17–24 s |
| s/step at 2048² | 12.6 | 8.2 (interleaved runs with cooldowns; sustained runs are thermally limited) |
| memory | 65 GiB (1024²), 121 GiB (2048²)¹ | **≈ 19 GiB (1024²), 24 GiB (2048²)**² |
¹ torch.mps.driver_allocated_memory(), which includes PyTorch's allocator cache. ² mx.get_peak_memory(). The two metrics are not strictly like-for-like.
Speed-ups over a straight port (together about 14% at 1024² and 9% at 2048², measured as interleaved A/B runs):
mx.compileThe port was validated component by component against the upstream PyTorch implementation (CUDA A100 BF16, MPS BF16 and an FP32 reference), feeding each component identical inputs:
Individual 12-step BF16 images from any backend (CUDA, MPS, MLX) differ in fine detail. The trajectory is chaotic, so even an exact FP32 run is only 22–25 dB from a CUDA BF16 image. Composition, layout and rendered text agree; see the comparison below (FP32 reference / CUDA BF16 / MPS BF16 / MLX BF16 / this repo).
Text rendering (OCR exact-match, Apple Vision, 18 target strings over 3 prompts, seed 42): this repo matches the BF16 MLX model at both resolutions (94.4% at 1024², 100% at 2048²). 4-bit variants were rejected because they garble copy. This is a single-seed check, so treat it as a regression canary rather than a benchmark. Separately, on the BF16 weights, the speed optimizations gave OCR results identical to the unoptimized path on every seed tested (8 at 1024², 4 at 2048²).
ming_mlx/convert.py and ming_mlx/quantize.py reproduce this checkpoint from the original weights:
python -m ming_mlx.convert --src Ming-Image-0.2-Design --dst weights_mlx
python -m ming_mlx.quantize --src weights_mlx --dst weights_mlx_llm8 --llm-bits 8
MIT, the same as the original model (LICENSE, © 2026 inclusionAI). The connector and VAE are derived from Qwen2-1.5B and the Qwen-Image VAE (both Apache-2.0) as packaged in the upstream checkpoint. SHA256SUMS covers every file in this repo.
dit-00001-of-00003.safetensors 5.0 GBdit-00002-of-00003.safetensors 5.0 GBllm-q8-00002-of-00004.safetensors 5.0 GBllm-q8-00003-of-00004.safetensors 4.9 GBllm-q8-00001-of-00004.safetensors 4.7 GBcond.safetensors 2.7 GBllm-q8-00004-of-00004.safetensors 2.7 GBdit-00003-of-00003.safetensors 2.3 GBvae.safetensors 51 MBinclusionAI/Ming-Image-0.2-Design