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 Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

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

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

Uploaded Python 3

File details

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

File metadata

  • Download URL: zimage_mnn-0.1.3-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.3-py3-none-any.whl
Algorithm Hash digest
SHA256 1002668adc0ef8fbc36c3294b65219f35bf90691ab02ac3d7e7fea3d3d3807d2
MD5 14b6b368c7bcf3ba25e6d41fc868cc3c
BLAKE2b-256 2c523e2215a3084ebf5216b50892b17bdfa701a1a1fca95824a2fcb578608c0f

See more details on using hashes here.

Release history Release notifications | RSS feed

0.1.4

2 files

This release

0.1.3 This release

1 file

0.1.2

2 files

0.1.1

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