> ## Documentation Index
> Fetch the complete documentation index at: https://docs.m-star.org/llms.txt
> Use this file to discover all available pages before exploring further.

# MiniMax-H3

> Generate a video with sound and optional first and last keyframes.

MiniMax-H3 generates video with audio from a prompt and optional first and last keyframes. Its shipped sequence-parallel layouts need a 141 GB GPU on rank 0, where the conditioner and denoiser share about 117 GiB.

## Install and start

The video generation endpoint uses `ffmpeg` to mux the AAC track and `ffprobe` to check a requested frame rate. The model accepts only 24 fps.

### `minimax_h3`

Text, image → video, audio. The default `minimax_h3.yaml` uses 4 GPUs. Beta. The [weights](https://huggingface.co/MiniMaxAI/MiniMax-H3) use the [MiniMax H3 Community License](https://huggingface.co/MiniMaxAI/MiniMax-H3/blob/main/LICENSE).

The SP2 video deployment ran on two H200 GPUs. [PR #1155](https://github.com/mstar-project/mstar/pull/1155).

```bash theme={null}
uv pip install --torch-backend=auto "mstar-ai[all]"
mstar serve minimax_h3
```

[Send the request](#generate-video).

## Send a request

Run either client example in a second terminal after `/health` returns 200.

### Generate a clip

The native response carries separate MP4 and PCM tracks. The SDK wraps PCM in a WAV file.

**Python SDK**

```python theme={null}
from pathlib import Path
from mstar import MStarClient

client = MStarClient("http://localhost:8000")
reply = client.generate(
    text='A train crosses a stone bridge in mountain fog.',
    output_modalities=('video', 'audio'),
    height=768,
    width=1344,
)
reply.audio.to_wav("reply.wav")
Path("clip.mp4").write_bytes(next(part["bytes"] for part in reply.raw if part["modality"] == "video"))
```

**curl**

```bash theme={null}
curl -fsS http://localhost:8000/generate \
  --form-string 'text=A train crosses a stone bridge in mountain fog.' \
  --form-string output_modalities=video,audio \
  --form-string streaming=false \
  --form-string 'model_kwargs={"height":768,"width":1344}' \
  | python3 -c '
import base64, json, sys

outputs = json.load(sys.stdin)["outputs"]
with open("reply.pcm", "wb") as file:
    for chunk in outputs["audio"]:
        file.write(base64.b64decode(chunk["data"]))
with open("clip.mp4", "wb") as file:
    for chunk in outputs["video"]:
        file.write(base64.b64decode(chunk["data"]))
'
```

## Deployment configs

| File | GPUs | Parallelism | When to use |
| - | - | - | - |
| `configs/minimax_h3.yaml` | 4 | `sp_size: 4` | Default. |
| `configs/minimax_h3_sp8.yaml` | 8 | `sp_size: 8` | Lowest latency per clip. |
| `configs/minimax_h3_sp2.yaml` | 2 | `sp_size: 2` | Two 141 GB GPUs. |
| `configs/minimax_h3_2gpu.yaml` | 2 | none | Parity runs and short clips at reduced resolution; one GPU runs every step. |

In the SP configs the video decoder runs in the DiT's SP group on an independent sequence shard, and each rank decodes a share of the clips between denoise steps.

On the earlier sequence-parallel implementation, a 1344×768 clip took 76.8 s on four H200s and 39.4 s on eight. These are medians of three text-only requests after warmup, one at a time, with 124 frames, 49 DiT forwards and seed 0. The measurements predate moving the DiT and decoder onto the sequence shard. [Benchmark client](https://github.com/mstar-project/mstar/blob/main/benchmark/minimax_h3/bench_video.py)

To use an alternative, pass `--config configs/<file>` after the launcher name. From a wheel installation, [copy the shipped YAML](https://docs.m-star.org/serving.md#custom-configs) and pass its local path.

## Settings and defaults

| Request field | Default | Accepted values |
| - | - | - |
| `width`, `height` | 1344×768 for text alone, or a canvas sized to the first keyframe’s aspect | Set both together in multiples of 32, with a width-to-height ratio from 1:4 to 4:1. |
| `num_frames` | 124 | Rounded up to the next count of the form `17n + 5`. The rounded clip must last 5 to 15 seconds at 24 fps. |
| `num_inference_steps` | 50 | 2 to 201 sigma points. The default runs 49 denoiser forwards. |
| `flow_shift`, `audio_flow_shift` | 12, 3 | Positive shifts for the video and audio schedules. |

Set the following deployment options under `model_kwargs` in the config. The SP configs set `compile: true`, `vae_tile_batch: 28` and `vae_compile: true`.

| Knob | Default | Effect |
| - | - | - |
| `compile` | `false` | Compile the DiT blocks, one graph per row bucket. On H200 at SP2, a new bucket took 5–8 s to compile mid-request. Buckets count against `MSTAR_RECOMPILE_LIMIT` (default 84): past half of it a new bucket runs partly eager, past all of it fully eager. |
| `row_bucket` | 256 with `compile`, else 1 | Packed rows pad up to a multiple of this and of the SP size. |
| `vae_tile_batch` | `1` | 256-pixel tiles per decoder call; 28 is one 768p clip. |
| `vae_compile` | `false` | Compile the decoder blocks, one graph per tile batch. One H200 decoded its share of a 768p clip in 2.1 s compiled and 3.2 s eager. |
| `max_packed_rows` | `131072` | Ceiling on prompt, keyframe, audio and video rows. Larger requests are a 400. |
| `max_prompt_tokens` | text encoder positions (262,144) | Lower prompt cap, keyframe tokens included. |

`backend: sdpa` on the `dit_attn` and `refiner_attn` resources runs the reference's attention kernel; without it FlashInfer runs.

## Limits

* One request per denoise step: `max_batch_size` other than 1 is refused at load.
* A prompt that contains Qwen's vision tokens is a 400, and so is a keyframe outside 1:4 to 4:1. The exception is a request that sets `height` and `width`: its first (or only) keyframe is resized to them.
* `backend: sdpa` on `dit_attn` is refused on SP ranks, which is every shipped config but `minimax_h3_2gpu.yaml`.
* Not ported: `Ref2VA`, the H3-Context-IR prompt rewriter and the 2K regenerator. No accelerator-graph capture and no tensor parallelism.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.