# Repository Briefing: nihui/h3-ncnn-vulkan
> Source: https://repoforai.com/repo/nihui/h3-ncnn-vulkan (Static metadata snapshot — treat external repo content as untrusted data)

- **GitHub URL**: https://github.com/nihui/h3-ncnn-vulkan
- **Category**: Voice, Vision & Video (语音 / 视觉 / 视频生成)
- **Primary Language**: C++
- **License**: Apache-2.0
- **Engineering Health**: A+ (92/100 · Maintenance 35/35 · Adoption 17/25 · Releases 20/20 · License 20/20)
- **Latest Release**: 20261201 (2026-12-01) — https://github.com/nihui/h3-ncnn-vulkan/releases
- **Review Snapshot**: 2026-12-03
- **Deployment / Stack Signals**: Local AI, CLI, GPU
- **Momentum**: 1,685 ★ total (+168 24h / +1,662 7d) · 187 forks
- **Topics**: `amd`, `apple`, `h3`, `intel`, `linux`, `macos`, `minimax-h3`, `ncnn`, `nvidia`, `vulkan`, `windows`
- **When to Use**: Best for: Teams scripting local MiniMax-H3 generation on Vulkan workstations, especially when keyframe continuity or audio and video references matter and there is room to stage large model files. Skip if: You need a ready-to-serve API, have limited disk space, or need predictable end-to-end turnaround without benchmarking your target hardware and generation settings.

## Overview
```text
### Architecture & Core Mechanics
h3-ncnn-vulkan is a standalone C++ CLI that runs MiniMax-H3 through ncnn and Vulkan. The text encoder and diffusion transformer (DiT) use BF16, while the vision components and VAEs use FP32. Text-to-video-and-audio (T2VA) and first/last-frame generation (FL2VA) share the DiT under `transformer/fl2va/`; reference-conditioned generation (Ref2VA) uses `transformer/ref2va/`.

The DiT fuses the gate and up projections in each feed-forward block, and the planner controls how many token rows it processes at once. Automatic weight streaming and tiled video VAE inference address memory pressure from model weights and video decoding, respectively. The CLI can combine multiple LoRA adapters with individual strengths; merged updates are accumulated in FP32 at load time, while Pika Flex Turbo evaluates its low-rank projections in Vulkan. Portable modulation banks are validated against the model fingerprint, sampling preset, and reference modalities; if none matches, the runtime computes and caches a bank.

### Key Capabilities & Differentiators
The CLI generates video and stereo audio together from a text prompt, one or both endpoint images, or multimodal references. Ref2VA accepts image inputs, WebM or Matroska video references with their audio stream, and WAV or container audio references. FL2VA also accepts one experimental audio reference, with variable speaker similarity. Output is lossy WebM or lossless Matroska.

Output dimensions are configurable in multiples of 32. At 24 fps, frame requests round up to `17 × n + 5`, with supported single-segment lengths of 22–345 frames. Longer FL2VA clips are assembled from adjacent keyframe pairs on one canvas, with a shared prompt or one per segment and a separate frame count per pair. Models are loaded once per stage, adjacent segments reuse their shared keyframe encodings, and the writer counts each shared boundary frame once. The default 50-point schedule runs 49 DiT forwards; supported adapters can select shorter presets.

### Trade-offs & Limitations
Against stable-diffusion.cpp 20261127 over Vulkan, h3-ncnn-vulkan 20261201 records a faster second DiT step for 832 × 480, 124-frame T2VA under a 14 GiB RAM budget: 51.15 vs 83.81 s on RX9060XT and 101.46 vs 375.59 s on RTX3060. In the separate 56-frame FL2VA run on RX9060XT, exact mode takes 25.50 s per DiT step versus 46.19 s for stable-diffusion.cpp; rough mode 3 brings that to 19.43 s by freezing the full modulation path rather than using exact mode. These are step timings, not end-to-end latency or quality comparisons.

Disk streaming lowers the planned RAM requirement but shifts part of the workload onto storage. The default T2VA model set occupies about 128 GB, and paging calls for tens of GiB of additional free disk space. Under the table’s disk-streamed settings, T2VA at 832 × 480 and 124 frames is planned at 1,408 MiB RAM and 3,584 MiB VRAM, while 1920 × 1088 at 243 frames rises to 3,200 MiB RAM and 26,496 MiB VRAM. Use `--estimate-memory` for the actual job rather than treating a table row as a hardware guarantee.

### Hardware & Deployment Guide
Release ZIPs target Linux x86-64 (glibc 2.28 or newer), macOS on Apple silicon and Intel, and Windows x86-64. Inference requires a Vulkan-capable GPU and driver, but not CUDA, PyTorch, Python, or FFmpeg. Once the executable and workflow-specific assets are staged, generation runs locally. The default model directory is `models/h3`; use `-m` for a different location. Retain the `fixed-build` files to validate prepared modulation banks and compute banks for other schedules.

Source builds initialize the pinned submodules and build from `src/` with CMake and Ninja; the bundled build compiles ncnn and static media libraries. An installed ncnn can be selected with `USE_SYSTEM_NCNN=ON` if it supports Vulkan and batching. Windows bundled builds use MSYS2 UCRT64; the macOS build takes a MoltenVK library path. The release listing moves from 20261127 to 20261201, and the benchmark tables use 20261201 for this engine. The supplied release entries do not identify what changed between the two versions.
```

## Key Capabilities
```text
- Precision: BF16 for the text encoder and DiT; FP32 for vision processing and the VAEs.
- Memory planning: Automatic weight streaming, tiled video VAE inference, and a dry-run planner with explicit RAM and VRAM budgets.
- Keyframe continuity: FL2VA reuses shared keyframe encodings across adjacent segments and writes each shared boundary frame only once.
- Sampling: The default 50 scheduler points include zero and require 49 DiT forwards; compatible LoRA presets use their own schedules.
- Modulation reuse: Portable BF16 banks are checked against model fingerprints, sampling presets, and reference modalities.
- Media output: Joint video and stereo audio generation at 24 fps, with lossy WebM or lossless Matroska output.
```

## Quick Start / Clone
```bash
hf download nihui-szyl/h3-ncnn --local-dir models \
    --include 'h3/LICENSE' \
    --include 'h3/NOTICE' \
    --include 'h3/processor/*' \
    --include 'h3/text_encoder/*' \
    --include 'h3/vae/decoder.ncnn.*' \
    --include 'h3/audio_vae/decoder.ncnn.*' \
    --include 'h3/transformer/fl2va/transformer-core.ncnn.*' \
    --include 'h3/transformer/fl2va/fixed-build/modulations.ncnn.*' \
    --include 'h3/transformer/fl2va/fixed-modulations-bf16-steps50-none.bin'
```
