Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

H3 Image MLX in liquid-glass lettering on a blue gradient

This banner was generated end to end with MiniMax H3 Image using H3 Image MLX.

If you find this repository useful, feel free to 🌟 & fork~

H3 Image MLX

English · 简体中文

Follow @anion_ex on X PyPI version Requires Python 3.11 or newer Package license: Apache-2.0 AND MIT

Quick start · Image editing · How it works · Benchmarks · Usage · Performance

Generate and edit images on an Apple Silicon Mac with MiniMax H3 Image. Optimized for fast inference, with 4K generation using around 7 GB of peak inference-process memory. Available through a CLI and Python API, ready to use out of the box.

Highlights

  • Native Apple Silicon inference. Built on MLX to take advantage of your Mac's compute capabilities, H3 Image runs locally with text-to-image generation and multi-image editing.
  • W8A8 quantization and Metal acceleration. Reduce weight memory usage with a portable MLX inference path, plus W8A8 Metal TensorOps acceleration on supported chips. Compatible with M1–M4.
  • Staged inference with on-demand block loading. Each stage runs in a separate process to release its memory on completion. Denoiser weights can be read one block at a time, greatly reducing peak memory usage and leaving more room for other apps.
  • Overlap weight reads with GPU computation. Prefetch the next block while evaluating the current one, keeping streaming memory low and reducing time spent waiting for weights. Enable prefetch and async

In our 1024×1024 same-machine test, streaming with both switches matched resident-mode speed: 23.61 s vs 23.63 s, with the highest measured process peak falling from 21.18 GB to 3.23 GB — about 85% lower. Outputs matched pixel for pixel. Test conditions and results

Benchmark results

M5 Pro, resident INT8, 1024×1024: v0.1.0a8 reduced median generation time from 26.49 s to 18.93 s (28.5%). Median peak process footprint increased from 21.08 GB to 21.67 GB. Same-machine uncached results.

Streaming at resident speed

M5 Pro 48 GB, version 0.1.0a3, 1024×1024, identical weights, prompt and seed, original six-step sampler, no embedding cache.

Mode Median generation time Highest process peak
Resident 23.63 s 21.18 GB
Streaming 32.33 s 2.53 GB
Streaming + prefetch + async 23.61 s 3.23 GB

Resident and prefetch+async: five measured runs each; plain streaming: three. Warmups excluded. Memory is the highest kernel-recorded process physical footprint across measured runs, in decimal GB. Full results and timing ranges · Source JSON

Same-machine controlled comparison

The same M5 Pro MacBook (48 GB), weight files, teapot prompt, initial noise and six-step sigma grid. Each group has one warmup and three measured generations.

Resolution MLX DiT mode ComfyUI time (s) MLX time (s) Speed ratio ComfyUI peak (GB) MLX peak (GB)
1024×1024 resident 87.15 19.90 4.38× 31.29 21.16
1024×1024 stream 87.15 28.82 3.02× 31.29 2.53
2048×2048 resident 134.17 57.43 2.34× 38.21 22.27
2048×2048 stream 134.17 67.06 2.00× 38.21 3.48
4096×4096 stream 570.59 317.29 1.80× 42.31 7.18

Time is the median complete generation request. Memory is the kernel-recorded single-process physical-footprint peak, including warmup, in decimal GB. Speed ratio = local ComfyUI time ÷ MLX time.

This compares complete pipelines: ComfyUI's default text encoder runs on CPU; MLX uses GPU. The main table reproduces the community configuration. The additional native INT8 DiT path, pinned versions and measurement method are in the full benchmark records, with source JSON in this repository.

Supplementary community measurements

Device / memory Pipeline DiT mode Resolution Time (s) Process peak (GB) Source
M5 MacBook Air / 16 GB H3 Image MLX stream 1024×1024 70.51 2.48 arielfikru
M5 MacBook Air / 16 GB H3 Image MLX stream 2048×2048 240.78 2.78 arielfikru
M5 Pro Mac mini / 64 GB ComfyUI + MPS INT8 — 1024×1024 89.55 31.42 pratikgx
M5 Pro Mac mini / 64 GB ComfyUI + MPS INT8 — 2048×2048 164.90 36.21 pratikgx
M5 Pro Mac mini / 64 GB ComfyUI + MPS INT8 — 4096×4096 547.31 48.78 pratikgx

Independent measurements on different machines, retaining contributors' original results. Run counts and measurement methods are in the full records, alongside the earlier M5 Pro runs.

Six H3 Image MLX examples: a feast, a fox in flight, a celadon tea set, a woodland chapel, a watercolor illustration and a rainy-night watchmaker.

Generated locally with H3 Image MLX: food, wildlife, product photography, architecture, illustration and a 4K watchmaker portrait. Click the collage to view it at full size.

Generate your first image

Version 0.1.0a4 also supports unquantized BF16 DiT and text-encoder weights, retaining AdaLN pruning and staged streaming. Select --precision bf16; INT8 remains the default. BF16 download and usage

Use Python 3.11 or later on a Mac with Metal. Allow 49.30 GB of disk space for a fresh model download. Check the MiniMax model license for regional and usage restrictions.

python3 -m venv .venv
source .venv/bin/activate
python -m pip install 'h3-image-mlx==0.1.0a8'

h3-image-mlx fetch --models ./models
h3-image-mlx generate --models ./models --output teapot.png \
  --prompt 'A yellow enamel teapot and a white cup on a blue wooden table.'

This writes a 1024×1024 RGB PNG. Set --width and --height to change the size. Each dimension accepts multiples of 32 from 256 through 4096.

Use weight prefetch and asynchronous evaluation together with --dit-mode stream to reduce weight-loading waits. Streamed INT8 on the portable backend enables both by default. The W8A8 TensorOps backend uses the explicit switches below. The six-step sampler stays unchanged. Our 1024×1024 test matched resident-mode speed with about 85% less peak process memory. Same-machine results · Contributor measurements

Available from 0.1.0a2; upgrade and enable both switches for this command:

python -m pip install --upgrade 'h3-image-mlx==0.1.0a8'
H3_ASYNC=1 H3_PREFETCH=1 h3-image-mlx generate \
  --models ./models --dit-mode stream --output teapot.png \
  --prompt 'A yellow enamel teapot and a white cup on a blue wooden table.'

Usage guide: CLI, Python and existing weights · Performance guide: switches, caching and profiling

Experimental: optional two-/three-step LoRA inference and LoRA-merged INT8 checkpoints are available on GitHub main, off by default. Usage and quality trade-offs

Edit with reference images

To replace the cup in teapot.png with a bird from your own photo, save the photo as bird.png. Number the pictures in your prompt in the order you pass them on the command line.

h3-image-mlx generate --models ./models --output edit.png \
  --reference teapot.png --reference bird.png \
  --prompt 'Edit <Picture 1>. Replace the white cup with the bird from <Picture 2>. Keep the teapot and table.'

You can pass up to 16 references. On an M5 Pro, we completed one- and two-reference edits. The 16-reference test reached the third of six denoising steps before cancellation. Validation notes

How it works

The pipeline reduces memory use at three levels: between model stages, within the denoiser, and during image decoding.

H3 Image MLX pipeline: encode the prompt, stream denoiser weights, then decode overlapping image tiles. Each stage releases its model memory before the next starts.

  • Run one stage at a time. Text encoding, denoising and VAE decoding run in separate processes. Each saves its intermediate output and exits before the next loads its weights, so the three models do not need to stay in memory together. Editing adds a reference-image VAE encoding stage before denoising.
  • Keep quantized projections compact. The runtime reads Comfy-Org's INT8 ConvRot weights directly. Activations are rotated and dynamically quantized to INT8 before quantized linear projections. The portable backend uses a Metal SIMD kernel for small aligned projections and probes for direct INT8 TensorOps on macOS 26.4 or later for longer sequences. Other shapes and devices use tiled MLX operations. Other operations retain their appropriate floating-point precision.
  • Load denoiser weights as needed. In stream mode, tensors are read from safetensors as each transformer block runs, rather than cached for all six steps. Denoising still operates on the full image's latent sequence. resident mode caches weights to reduce repeated reads. The runtime also precomputes the steps' AdaLN modulation values from the compressed curves in Comfy-Org's pruned checkpoint, then releases the setup weights.
  • Decode in overlapping tiles. The VAE decodes small groups of latent tiles and blends their overlapping edges into the output image, limiting decoder working memory at high resolutions.

Streaming keeps memory low by reading weights on demand. Prefetch and asynchronous evaluation overlap these reads with GPU work to reduce the time cost. Peak usage still includes activations, attention buffers and image buffers, so resolution and reference-image count matter. See the benchmark results for the measured trade-off.

Hardware and memory

M5/M6 select W8A8 Metal TensorOps by default; M1–M4 use the portable MLX backend. Use --dit-mode stream for lower memory usage or --dit-mode resident to retain denoiser weights between steps. Hardware validation and automatic mode selection

Documentation

Document Contents
Usage guide CLI parameters, reference editing, Python API and existing weights
Performance guide Recommended streaming switches, hardware modes, embedding cache and profiling
Benchmarks Measurements, environments and source JSON
Validation notes Completed checks and remaining hardware coverage

Credits and licenses

MiniMax developed H3 Image and supplies the VAE configuration. Comfy-Org provides the quantized weights. The three W8A8 Metal kernel files come from mlx-serve and retain their MIT license. This project’s runtime code uses Apache-2.0.

About

I'm anionex, an AI-native developer who once ranked No. 3 on GitHub's global developer trending list, with more than 18.7k stars across my projects. If you would like to follow my future work, follow me on X or GitHub.

Metadata

Release files for h3-image-mlx 0.1.0a8

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for h3-image-mlx 0.1.0a8
File Size Uploaded Provenance Actions
h3_image_mlx-0.1.0a8.tar.gz 140.4 kB With provenance Details for h3_image_mlx-0.1.0a8.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for h3-image-mlx 0.1.0a8
File Interpreter ABI Platform Actions
h3_image_mlx-0.1.0a8-py3-none-any.whl Python 3 none any Details for h3_image_mlx-0.1.0a8-py3-none-any.whl

Total release size: 211.5 kB

Release files / h3_image_mlx-0.1.0a8.tar.gz

Download URL h3_image_mlx-0.1.0a8.tar.gz
Size 140.4 kB
Tags Source
SHA-256 checksum
How to use checksums
85c57940cfe0b1f73bd0c5df93c79cacbf1329752f8c94789c018e7bd25e1357
BLAKE2b-256 checksum
How to use checksums
1e42c77d4ad63856b8e931a38c6acb478bb3c713c12ba8590973843d146480d7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 14, 2026.

Transparency log

Release files / h3_image_mlx-0.1.0a8-py3-none-any.whl

Download URL h3_image_mlx-0.1.0a8-py3-none-any.whl
Size 71.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f05995a4a90ca7578a96d8c639562365c4e710d3158adb2b6bbd5e435a871f5e
BLAKE2b-256 checksum
How to use checksums
03f915515dd4166d694da02f9442cee7e6a16076f10083790e001b29b3f6e4c1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 14, 2026.

Transparency log

Security for h3-image-mlx 0.1.0a8

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for h3_image_mlx-0.1.0a8.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 14, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page