antirez releases h3.c — a C engine for MiniMax-H3 video generation on Apple Silicon

Translated by a model; the original is in Russian.

· Artificial intelligence
Salvatore Sanfilippo, the author of Redis, has unveiled a native inference engine for the MiniMax-H3 model, generating video with sound directly on Apple chips via Metal.

cover.svg

Salvatore Sanfilippo (antirez), best known as the author of Redis, has published a project called h3.c — an inference engine for the multimodal MiniMax-H3 model that runs natively on Apple Silicon. The code is written in C using Metal, distributed under the MIT license, and at the time of this news had gathered more than five hundred stars on GitHub.

What it can do

The model generates video with sound from a text description, and it also supports finer-grained scenarios: specifying the first and last frame (the FL2VA condition), as well as ordered references to images, video and audio (Ref2VA). Image references are fed to the model as <Picture 1>, <Picture 2> and so on; you can, for example, ask it to “make the person in the picture wave at the camera.” Audio references must be between two and fifteen seconds long.

By default, h3.c produces clips at 24 frames per second, and the duration is rounded up to a valid temporal shape for the model: a request for ten seconds, for instance, turns into 243 frames. Media input and MP4 encoding require FFmpeg and FFprobe.

Betting on speed

The core of the project is hand-tuned optimization for specific hardware, the M3 Max and M5 Max. The author offers “slow quality / default / aggressive” preset bundles that let you vary the number of denoising steps, the count of active transformer blocks and the internal canvas size. The spread is enormous: a reference pass over the “fox in the snow” on an M5 Max took about 26 seconds, while a stripped-down four-step variant took roughly 3.5 seconds, losing some detail but preserving the scene and the motion.

The int8 path was worked out separately: dynamic activation quantization and per-weight scales cut render time from 36 to about 19 seconds, while also reducing peak memory consumption from 36 to 26 GiB. The 33-billion-parameter model is loaded in phases — the transformer, the Qwen text encoder and the decoders never coexist in a single memory space at the same time.

Engineering meticulousness

The README reads like a detailed engineering diary: dozens of environment variables such as H3_NAX or H3_DISABLE_FUSED_MLP let you turn individual optimizations on and off for precise A/B comparison. Correctness is verified by checking against reference MLX outputs — down to a relative error on the order of 10⁻⁶ on the audio encoder. Sanfilippo candidly notes where a speedup yields only a fraction of a percent, and why one aggressive combination of settings or another produces “chromatic ringing” and “ghost limbs.”


Source: Hacker News

Comments

Sign in, to comment.

  • No comments yet.