Skip to main content

zimage-mnn

Run Z-Image-Turbo text-to-image locally with MNN — optimized for Apple Silicon (Metal) with a CPU fallback.

The 12.3B-parameter DiT is quantized to int8 weights and runs the full pipeline (text encoder → 8-step denoiser → VAE) entirely on-device. No cloud calls.

Install & run (one line)

uvx zimage-mnn "a cute cat sitting on a windowsill"

Models (~11 GB) download automatically on first run and are cached in ~/.cache/zimage_mnn.

CLI usage

# basic
uvx zimage-mnn "a red sports car on a coastal highway"

# options
uvx zimage-mnn "a panda eating bamboo" \
    --size 1024 \        # resolution (multiple of 16; model tuned for 1024)
    --steps 8 \          # denoising steps (2-12)
    --seed 42 \          # random seed
    --num-images 2 \     # generate several (seed increments)
    --output out.png \   # output file / prefix
    --backend metal      # auto | metal | cpu

HTTP API

uvx zimage-mnn --api --port 8000
curl -X POST http://127.0.0.1:8000/generate \
     -H "Content-Type: application/json" \
     -d '{"prompt":"a cute cat","size":1024,"steps":8,"seed":42}' \
     -o cat.png

GET /health returns {"status":"ok"}.

Python API

from zimage_mnn import ZImageMNNPipeline

pipe = ZImageMNNPipeline.from_pretrained()          # downloads models
image = pipe("a cute cat", size=1024, steps=8, seed=42)
image.save("cat.png")

images = pipe.generate("a dog", num_images=3, seed=7)

Performance (Apple M5 Pro, 1024×1024, 8 steps)

Backend per step end-to-end
Metal (fp32, int8 weights) ~13 s ~2 min
CPU (int8, 12 threads) ~27 s ~4 min

Quality matches the original PyTorch pipeline (single-step cosine ≈ 0.9996).

Requirements

  • Python ≥ 3.9
  • macOS with Apple Silicon recommended (Metal). CPU works anywhere but is slower.
  • ~16 GB RAM recommended; ~11 GB disk for the models.

License

Apache-2.0. Model weights derive from Tongyi-MAI/Z-Image-Turbo — see its license.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

zimage_mnn-0.1.1.tar.gz (1.7 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

zimage_mnn-0.1.1-py3-none-any.whl (1.7 MB view details)

Uploaded Python 3

File details

Details for the file zimage_mnn-0.1.1.tar.gz.

File metadata

  • Download URL: zimage_mnn-0.1.1.tar.gz
  • Upload date:
  • Size: 1.7 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.13

File hashes

Hashes for zimage_mnn-0.1.1.tar.gz
Algorithm Hash digest
SHA256 8da3b14a5219ed0cbbff8d1bf3137260f3f0ff46a494cc626007df1095ca2950
MD5 c5a55ac83516510d82bc3991d074a532
BLAKE2b-256 ecb1a717cfa7f6709ef8dd7193ebf0c3449c353ec1e944eb6688e59beb238622

See more details on using hashes here.

File details

Details for the file zimage_mnn-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: zimage_mnn-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 1.7 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.13

File hashes

Hashes for zimage_mnn-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 2b3c798f1cd017a5fc94fbdccb93948066398d00bbdd4b0e5d71801864388693
MD5 113466869aea70055fede175852ae3e8
BLAKE2b-256 dc6f25e6b7966cbdcca254ba02eb2e788167d47dd8cf6b516c4e18bd7107c2ab

See more details on using hashes here.

Release history Release notifications | RSS feed

0.1.4

2 files

0.1.3

1 file

0.1.2

2 files

This release

0.1.1 This release

2 files

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page