@eternityspring: MiniMax H3 is blowing up locally, but the tutorials are all NVIDIA + ComfyUI, and Mac users can only watch helplessly. Now Redis creator antirez can't stand it anymore, so he hand-wrote an H3 inference engine in pure C + Metal, Apple Silico…
Summary
Redis creator antirez releases h3.c, a pure C + Metal inference engine for MiniMax H3 that runs natively on Apple Silicon, enabling text-to-video/audio without Python, PyTorch, or ComfyUI.
View Cached Full Text
Cached at: 08/12/26, 12:25 PM
MiniMax H3 is blowing up locally, but the tutorials are all NVIDIA + ComfyUI, leaving Mac users just watching. Now Redis creator antirez couldn’t stand it anymore and hand-wrote an H3 inference engine in pure C + Metal, running natively on Apple Silicon. It’s not a wrapper—written from scratch:
- Pure C + Metal shaders, no Python, no PyTorch, no ComfyUI
- Text-to-video + audio, first/last frame control, Ref2VA multi-image references, all working end to end
- Interactive session with direct commands:
!firstopening image /!lastending image /!ref-imagereference image - Reads HuggingFace official weights, ffmpeg exports video; still optimizing performance on M3 Max / M5 Max
http://github.com/antirez/h3.c
Mac users, go try it out! See if it’s faster than NVIDIA!
antirez/h3.c
Source: https://github.com/antirez/h3.c
h3-metal
Native MiniMax-H3 inference for Apple Silicon. The project is being built as a sequence of working vertical slices: deterministic host/model metadata first, then portable Metal block parity, prompt encoding, prompt-to-video/audio, and first/last-frame conditioning and then ordered references. Prompt-to-video/audio, first/last-frame conditioning, and ordered Ref2VA image/video/audio references work end to end. The current work is incremental H3-specific Metal performance and memory optimization on M3 Max and M5 Max.
Tutorial
1. Build and inspect the model
The examples assume that the Hugging Face snapshot is in ./MiniMax-H3 and that FFmpeg and FFprobe are available on PATH.
make -j8
mkdir -p outputs
./h3 --info -d ./MiniMax-H3
--info checks the model layout and prints the selected Metal device without mapping all weights or generating media. Run ./h3 --help for the complete CLI reference.
Without -p, the same binary starts an Iris-style interactive session:
./h3 -d ./MiniMax-H3 --width 512 --height 512 --steps 6
Type a prompt to generate a numbered video. The session keeps the exact BF16 prompt conditioning, prepared DiT, and video decoder in memory, so repeating a prompt with another seed avoids loading and encoding them again. Useful commands are !status, !seed random, !seconds 2, !show, !save output.mp4, and !cache. Use !help for the full, short list.
First/last-frame conditioning is persistent in the session:
h3> !first opening.png
h3> !last ending.png
h3> The camera moves slowly around the subject.
Use !first clear or !last clear to remove an anchor. Generated videos are written to the session directory printed at startup. For a general Ref2VA conditioning image, use !ref-image PATH instead. Images are appended in order and exposed to the model as <image 1>, <image 2>, and so on; filenames have no meaning to the model.
h3> !ref-image person.png
h3> Make the person shown in Picture 1 wave to the camera.
!refs lists the current order, !ref-remove N removes one entry, and !refs clear removes them all. Ref2VA references cannot be mixed with !first/!last anchors.
2. Make a first fast video
Start with the validated balanced preset. It generates 22 frames at 24 fps (about 0.92 seconds), displays the evolving middle-video frame after every denoising transition in a supported graphical terminal, and prints phase timings:
./h3 --profile \
-d ./MiniMax-H3 \
-p "A red fox walks through fresh snow in a pine forest. Medium tracking shot, natural winter light, realistic fur, soft footsteps and wind." \
--width 512 --height 512 \
--frames 22 --steps 20 \
--layers 45 --reuse 2 \
--show \
-o outputs/fox-fast.mp4
This is deliberately not the most aggressive configuration:
--steps 20performs the default 20 denoising passes.--reuse 2computes 11 fresh denoiser velocities instead of all 20 and extrapolates the skipped transitions.--layers 45runs 45 of the 50 transformer blocks, reducing both time and unified-memory use.--showis optional. It supports Kitty/Ghostty and iTerm2/WezTerm/Konsole graphical protocols. It loads a resident preview VAE, displays one representative middle-video frame after every Euler transition, and then displays all final frames. Display dimensions default to 2x so the image has its intended logical size on macOS Retina screens; use--zoom 1on a non-HiDPI display. This adds preview decode time and roughly 10 GiB of temporary model residency; runs without--showare unchanged.--profileis optional and does not select a different generation path.
The first process invocation also pays model loading and filesystem-cache costs. Compare performance using repeated runs, and alternate variants when the machines are warming up because this workload is sensitive to thermal throttling.
For a very short iteration, request four denoising passes directly:
./h3 --profile \
-d ./MiniMax-H3 \
-p "A red fox walks through fresh snow in a pine forest. Medium tracking shot, natural winter light, realistic fur." \
--width 512 --height 512 --frames 22 \
--steps 4 --layers 50 --reuse 1 \
--show \
-o outputs/fox-four-step.mp4
--steps N always means exactly N denoising passes. Four through seven passes use the same schedule that won the low-budget comparison; increasing from 4 to 7 progressively improves detail and motion. Keep --reuse 1 at such small budgets so every requested pass runs the model. --show displays one preview after each pass.
Several tail-heavy schedules were evaluated because most visible cleanup happens late in a long run. They preserved too few early composition updates and produced woven texture, weak motion, or clipped colors. The retained mode uses the released linear base grid with one terminal point. On the 512-square, 22-frame fox test, the selected four-pass result had 0.556 full-video SSIM against a 29-pass reference; an independent surfer test measured 0.547. The four-pass denoise took about 3.5 seconds on M5 Max, versus 26.4 seconds for the reference.
For a low-memory run, add --ssd-streaming:
./h3 --profile \
-d ./MiniMax-H3 \
-p "A red fox walks through fresh snow in a pine forest." \
--width 512 --height 512 --frames 22 --steps 20 \
--layers 50 --reuse 1 --ssd-streaming \
-o outputs/fox-ssd.mp4
This uses the original BF16 checkpoint without conversion or quantization. It keeps two DiT blocks in memory and reads the next block from SSD while the GPU runs the current one. On M5 Max, tracked DiT storage fell from about 36.5 GiB to 2.0 GiB at 512 square and 2.1 GiB at 864x480. A warm 50-block forward measured 1.35 versus 2.49 seconds at 512 square (84% slower), and 2.14 versus 2.68 seconds at 864x480 (26% slower). These are comparisons against the same full-residency BF16 path, and the results were byte-identical in both checks.
The 2.0–2.1 GiB figure is the DiT’s tracked tensor storage, not total system RAM. Prompt encoding and the two VAEs run in separate phases rather than adding their full peaks to it; the OS, media buffers, and output resolution still need headroom. --show keeps a preview VAE resident and adds roughly 10 GiB, so omit it for the lowest-memory run.
SSD streaming is an explicit memory/speed tradeoff and is not the default. It cannot be combined with --use-int8-row-fc2. In an interactive session, use !ssd-streaming on.
3. Move toward reference quality
Change one control at a time when evaluating quality. First restore all layers, then all denoiser evaluations, and finally raise the default 20-pass schedule to the slower 50-pass reference:
./h3 --profile \
-d ./MiniMax-H3 \
-p "A red fox walks through fresh snow in a pine forest. Medium tracking shot, natural winter light, realistic fur, soft footsteps and wind." \
--width 512 --height 512 \
--frames 22 --steps 50 \
--layers 50 --reuse 1 \
-o outputs/fox-close.mp4
The defaults are --steps 20 --layers 50 --reuse 1; keep --steps 50 explicit for this close path. It performs 50 complete 50-block denoiser forwards and is much more expensive than the default, but is the right oracle when a fast mode changes the subject, anatomy, motion, or composition. Numerical pixel identity with MLX is not expected because the random-number and execution engines differ; the depicted content and motion should agree.
4. Choose a speed/quality preset
These controls are independent unless noted otherwise:
| Control | Slow reference | Default | Aggressive | Main impact |
|---|---|---|---|---|
| Denoising passes | --steps 50 | --steps 20 | --steps 4..7 | The number always names actual denoising passes. |
| Whole denoiser reuse | --reuse 1 | --reuse 2 | --reuse 3 | At 20 steps: 20, 11, or 8 fresh DiT evaluations. |
| Active DiT blocks | --layers 50 | --layers 45 | --layers 40 | Fewer blocks reduce compute and resident transformer weights. |
| Core residual reuse | --core-reuse 1 | --core-reuse 4 | --core-reuse 6 | Refreshes patch/head work every step but runs the expensive core less often. |
| Token reduction | off | optional | --token-reduction | Pairs horizontal video tokens inside middle blocks; faster but may change composition. |
| Internal canvas | output size | 384x384 for 512 square output | 320x320 | Runs DiT/VAE smaller, then upscales with vImage. |
On M5, --use-int8-row-fc2 uses one activation scale per FC2 row and a single full-width TensorOps product. It is optional because it is less numerically conservative than grouped int8. It reduced complete denoiser forwards by about 2.6% in reciprocal tests. Matched four-step fox and surfer videos kept the same subjects, setting, and motion (full-video SSIM 0.919 and 0.828). In the interactive session, use !int8-row-fc2 on.
--reuse and --core-reuse are mutually exclusive. Layer thinning can be combined with either one.
To make the first command faster while keeping its output resolution, add token reduction:
./h3 --profile \
-d ./MiniMax-H3 \
-p "A surfer riding inside a sharp blue ocean wave, one rider and one white board, realistic spray." \
--width 512 --height 512 --frames 22 --steps 20 \
--layers 45 --reuse 2 --token-reduction \
-o outputs/surfer-fast.mp4
At the validated 512 square shape, token reduction cut the 45 layers + reuse 2 denoise profile from 16.69 to 12.60 seconds on the IT M5 Max. Independent fox and surfer renders stayed coherent, but composition can diverge more from the close path.
For an aggressive preview, render internally at 320 square and upscale to the requested 512 square output:
./h3 --profile \
-d ./MiniMax-H3 \
-p "A red fox walking through snow, realistic, tracking shot." \
--width 512 --height 512 \
--render-width 320 --render-height 320 \
--frames 22 --steps 20 --layers 40 --reuse 3 \
-o outputs/fox-aggressive.mp4
This combination produced a clean, recognizable 22-frame fox in validation, but loses fine detail and can change framing. Do not add --token-reduction to both --layers 40 and --reuse 3: that tested combination produced color ringing, outlines, and ghosted limbs.
As an alternative to whole-velocity reuse, this keeps the timestep-dependent patch and output heads fresh at every transition:
./h3 --profile \
-d ./MiniMax-H3 \
-p "A surfer riding a blue ocean wave." \
--width 512 --height 512 --frames 22 --steps 20 \
--layers 45 --core-reuse 4 \
-o outputs/surfer-core-reuse.mp4
Use --core-reuse 6 only as an aggressive preview. Values above 6 are not exposed because validation lost subject fidelity.
5. Pick resolution and duration
Width and height must each be multiples of 32, at least 32, and their product must not exceed 768 * 1344 pixels. Those are mechanical limits, not a promise that every tiny canvas has good model quality. H3-Base is a 768p model.
| Canvas | Current guidance |
|---|---|
512x512 | Safest development size; repeatedly validated with multiple prompts. |
768x768 | Validated close-quality square output; substantially more expensive. |
1344x768, 768x1344 | Released 768p-class landscape/portrait limit. |
1024x768, 768x1024 | Valid 4:3 and 3:4 768p-class canvases. |
384x384 internal to 512x512 | Validated fast-quality scaling point. |
320x320 internal to 512x512 | Validated aggressive scaling point. |
256x256 | Native fast-preview canvas with automatic low-resolution RoPE adaptation. |
For a fast native 256-square preview:
./h3 -d ./MiniMax-H3 \
-p "A red fox walks through fresh snow in a pine forest." \
--width 256 --height 256 \
--frames 22 --steps 20 \
--layers 50 --reuse 1 \
-o outputs/fox-256.mp4
At 256 square, H3 has only an 8x8 effective spatial-token grid, so it has less room for fine detail and complex composition. H3 automatically halves spatial RoPE coordinates at exactly 256 square. This removed repeating lattice artifacts in long fox renders and stayed coherent on an independent portrait, without adding tokens or runtime. Use --use-reference-rope to restore the released/MLX coordinates for parity checks. Keep token reduction off at this size.
Native 128 square remains unsupported: its 4x4 token grid did not recover a recognizable subject even with adjusted RoPE.
--render-width and --render-height must be set together, must have the same aspect ratio as the output, and cannot exceed the output dimensions. The model and VAE use the internal size; terminal frames and the encoded video retain the requested output size.
H3 emits 24 fps and aligns frame requests upward to 5 + 17*n: Use --seconds N for a duration-oriented request, or --frames N for direct frame control; the two options are mutually exclusive. Fractional seconds are accepted. Seconds are converted at 24 fps and then rounded upward to the next legal H3 temporal shape, so --seconds 10 produces 243 frames (10.125 seconds).
| Frames | Approximate video duration |
|---|---|
| 22 | 0.917 seconds |
| 39 | 1.625 seconds |
| 56 | 2.333 seconds |
| 107 | 4.458 seconds |
| 243 | 10.125 seconds |
| 362 | 15.083 seconds |
Short clips are useful for development. The released workflow is intended for roughly 4–15 second videos. A request such as --frames 23 is rounded up to 39 frames rather than producing an arbitrary temporal shape.
6. Improve the prompt
A short prompt works, but the released system expects a Context-IR-like description. State the subject, action, setting, camera, lighting/style, and desired sound. For example:
Scene: a single red fox in a snow-covered pine forest at dawn.
Action: the fox walks steadily left to right and looks toward the camera once.
Camera: medium-height lateral tracking shot, 50 mm lens, stable framing.
Look: photorealistic fur, cold blue ambient light, warm sunrise rim light.
Audio: soft footsteps in snow, light wind through pine branches, no music.
Keep identity and object counts explicit when they matter. --seed N controls the native random stream; the default is 42. Compare options with the same prompt, seed, resolution, frame count, and step count.
7. Preview frames and diagnose performance
--showdisplays a representative frame after every denoising transition, followed by all frames from the completed video. Like Iris, it advertises 2x display dimensions by default for Retina terminals;--zoom Nchanges that factor without resizing the generated video or the encoded terminal image.--frames-dir DIRwrites final callback frames as PPM files. Intermediate--showpreviews are not written there.-o ''disables MP4 encoding; combine it with--frames-dirwhen FFmpeg is unavailable.--profilereports phase wall time, Metal encoding/wait time, peak live tensor storage, cumulative allocation, and dispatch counts.
For example:
./h3 --profile -d ./MiniMax-H3 -p "A hummingbird hovering over red flowers." \
--width 512 --height 512 --frames 22 --steps 20 \
--layers 45 --reuse 2 --frames-dir outputs/hummingbird-frames \
-o ''
8. Add image, video, and audio references
First/last-frame anchors select the FL2VA path:
./h3 -d ./MiniMax-H3 -p "The fox keeps walking through the snow." \
--width 512 --height 512 --frames 22 --steps 20 \
--layers 45 --reuse 2 \
--first-frame fox.png --last-frame fox-later.png \
-o outputs/fox-anchored.mp4
Ordered references select the distinct Ref2VA checkpoint. Use the flag matching the media semantics:
# One image reference.
./h3 -d ./MiniMax-H3 -p "Use the animal and setting in the referen
Similar Articles
Antirez/h3.c: MiniMax H3 inference engine for Mac computers
Antirez's h3.c is a native Minimal inference engine for MiniMax-H3 on Apple Silicon, providing a fast, end-to-end prompt-to-video/audio pipeline with Metal optimizations and an interactive session. It is currently focused on performance and memory optimization for M3 Max and M5 Max.
@eternityspring: https://x.com/eternityspring/status/2084666970558074971
Detailed explanation of how to run the MiniMax H3 video generation model locally on an RTX 4080 16GB using ComfyUI's native workflow, including model download, directory configuration, parameter tuning, and common pitfalls.
@VincentLogic: Discovered an amazing open-source project! Redis creator antirez made a splash! ds4 — DeepSeek V4 Flash local inference engine, optimized for Mac Metal, topping GitHub charts for days! And here's the killer part: 128GB…
Redis creator antirez released an open-source project called ds4, a DeepSeek V4 Flash local inference engine optimized for Mac Metal, featuring disk KV caching, ultra-long context, and excellent performance.
@sitinme: There's a pretty interesting open-source project called Cider, specifically designed to accelerate local AI inference on Macs with Apple Silicon chips. Many people buy a Mac mini or MacBook Pro and want to run models locally, but often encounter issues like insufficient speed and high memory usage. Actually...
Cider is an open-source project designed for Apple Silicon Macs, accelerating local AI inference by fully leveraging the computing power of M-series chips. It is compatible with the MLX ecosystem, supports models like Qwen and Llama, and is easy to install.
@Saccc_c: Using cloud GPUs to run MiniMax H3 is definitely the most correct way for ordinary people to dive into AI video, costing less than a cent per second! Friends who have tried AIGC know that a membership costing sixty or seventy yuan barely lasts for four or five runs. But by renting GPUs and running top open-source models like H3, the cost is extremely low, and the performance is still impressive...
Introduces the cost advantages of using cloud GPUs to run the MiniMax H3 model for AI video generation, and plans to open-source a Codex plugin to simplify the workflow.