# minimax-ai/minimax-h3 architecture

> Architecture diagram of the GitHub repository minimax-ai/minimax-h3, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-08-08). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/minimax-ai/minimax-h3
- Repository: https://github.com/minimax-ai/minimax-h3

## Overview

#### Purpose and Entry Points
MiniMax H3 is a multimodal generative-model distribution for video plus native stereo audio. It ships two locally deployable 768p H3-Base checkpoint families—first/last-frame (`FL2VA/`) and multimodal-reference (`Ref2VA/`)—plus API-driven Context-IR and 2K regeneration workflows. Primary repository entry metadata is `model_index.json`; task-specific model manifests are `FL2VA/model_index.json` and `Ref2VA/model_index.json`.

#### Deployment Boundary
This is a model/checkpoint repository, not an application service implementation. Inference is supplied by external runtimes: SGLang, vLLM, Diffusers, or ComfyUI. The documented local serving entry is SGLang with a task variant, while reproducible request clients are shell scripts such as `scripts/readme/reproducible-768p-t2va-request.sh` and `scripts/readme/reproducible-768p-ref2va-request.sh`.

#### Checkpoint Families
`FL2VA/` supports text-to-audio-video and optional first/last-frame conditioning. `Ref2VA/` supports text plus images, video, and audio references. Both are self-contained Hugging Face-style component bundles, with duplicated architectural implementations and distinct transformer weights:
- `FL2VA/transformer/config.json`
- `Ref2VA/transformer/config.json`
- `FL2VA/processor/preprocessor_config.json`

#### Multimodal Input Processing
A processor/tokenizer and pretrained text encoder convert prompt and structured multimodal context into text/vision representations, including special dialogue tokens required by the model. Primary artifacts:
- `FL2VA/processor/chat_template.json`
- `FL2VA/tokenizer/tokenizer_config.json`
- `FL2VA/text_encoder/config.json`

For Ref2VA, input references are bounded externally by the API/workflow contract; modality interpretation and context refinement belong to hosted Context-IR rather than this repository.

#### Latent Encoding and Decoding
Visual and audio data cross explicit VAE boundaries before and after generation. The visual VAE is temporally causal and contains convolutional, attention, normalization, and ViT/CNN decoder components:
- `FL2VA/video_vae/minimax_h3_video_vae.py`
- `FL2VA/video_vae/klvae.py`
- `FL2VA/video_vae/vae_vit.py`

Audio is independently encoded/decoded per stereo channel through the DAC-based AudioVAE:
- `FL2VA/audio_vae/minimax_h3_audio_vae.py`
- `FL2VA/audio_vae/dac_audio_vae.py`
- `FL2VA/audio_vae/dac_bigvgan.py`

#### Joint Generation Core
Encoded text, visual, and audio context is packed into one multimodal sequence for the H3 Omni Transformer. The transformer jointly predicts video and audio latents; modality-specific behavior is concentrated at I/O and conditioning branches rather than separate transformer trunks. Weight shard indexes identify externally stored model tensors:
- `FL2VA/transformer/model.safetensors.index.json`
- `Ref2VA/transformer/model.safetensors.index.json`
- `transformer/diffusion_pytorch_model.safetensors.index.json`

Schedulers define the diffusion-generation control schedule:
- `scheduler/scheduler_config.json`
- `audio_scheduler/scheduler_config.json`

#### Full 2K Workflow and External Services
The 2K path is orchestrated across boundaries: hosted H3-Context-IR transforms raw multimodal intent into generation-ready context; local H3-Base produces 768p video/audio; hosted H3-Regenerate-2K consumes the base result plus original context. Context-IR and regeneration are not included locally and require MiniMax Open Platform APIs. Request examples encode this handoff:
- `scripts/readme/full-2k-t2va-h3-context-ir.sh`
- `scripts/readme/full-2k-t2va-h3-base.sh`
- `scripts/readme/full-2k-t2va-h3-regenerate-2k.sh`

#### Prompt-Authoring Layer
The `skills/` hierarchy is an independent prompt-authoring package for users or agents, not inference code. It standardizes structured H3 prompting and style-specific planning before requests reach Context-IR or H3-Base:
- `skills/h3-prompt-writing/SKILL.md`
- `skills/h3-prompt-writing/references/base-en.txt`
- `skills/h3-prompt-writing/references/ref-en.txt`

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_local["Local H3-Base distribution"]
  node_root_manifest["Distribution manifest<br/>checkpoint index<br/>[model_index.json]"]
  node_fl_manifest["FL2VA manifest<br/>task manifest<br/>[model_index.json]"]
  node_ref_manifest["Ref2VA manifest<br/>task manifest<br/>[model_index.json]"]
  node_fl_inputs["FL2VA input processor<br/>[chat_template.json]"]
  node_tokenizer["Tokenizer"]
  node_text_encoder["Text encoder<br/>encoder config<br/>[config.json]"]
  node_video_vae["Temporal video VAE<br/>visual latent codec"]
  node_audio_vae["Stereo AudioVAE<br/>audio latent codec"]
  node_fl_transformer["FL2VA Omni Transformer<br/>joint diffusion transformer"]
  node_ref_transformer["Ref2VA Omni Transformer<br/>joint diffusion transformer"]
  node_video_scheduler["Video scheduler<br/>diffusion schedule"]
  node_audio_scheduler["Audio scheduler<br/>diffusion schedule"]
end

subgraph group_external["External runtime and APIs"]
  node_runtime{{"Inference runtimes<br/>external runtime"}}
  node_local_request["Local request scripts<br/>request client"]
  node_context_ir{{"H3-Context-IR<br/>hosted context service"}}
  node_base_768p["H3-Base 768p generation<br/>local workflow stage"]
  node_regen_2k{{"H3-Regenerate-2K<br/>hosted regeneration service"}}
end

subgraph group_authoring["Prompt authoring"]
  node_prompt_skill["H3 prompt-writing skill<br/>prompt-authoring package<br/>[SKILL.md]"]
end

node_root_manifest -->|"indexes"| node_fl_manifest
node_root_manifest -->|"indexes"| node_ref_manifest
node_fl_manifest -->|"configures"| node_fl_inputs
node_fl_inputs -->|"uses"| node_tokenizer
node_tokenizer -->|"tokens to embeddings"| node_text_encoder
node_text_encoder -->|"text context"| node_fl_transformer
node_video_vae -->|"video latents"| node_fl_transformer
node_audio_vae -->|"audio latents"| node_fl_transformer
node_video_scheduler -->|"video diffusion control"| node_fl_transformer
node_audio_scheduler -->|"audio diffusion control"| node_fl_transformer
node_fl_transformer -->|"predicted video latents"| node_video_vae
node_fl_transformer -->|"predicted audio latents"| node_audio_vae
node_ref_manifest -->|"configures"| node_ref_transformer
node_local_request -->|"submits requests"| node_runtime
node_runtime -->|"loads task variant"| node_fl_manifest
node_runtime -->|"loads task variant"| node_ref_manifest
node_prompt_skill -.->|"structured prompts"| node_context_ir
node_prompt_skill -.->|"structured prompts"| node_local_request
node_context_ir -->|"generation-ready context"| node_base_768p
node_base_768p -->|"base result and context"| node_regen_2k

click node_root_manifest "https://github.com/minimax-ai/minimax-h3/blob/main/model_index.json"
click node_fl_manifest "https://github.com/minimax-ai/minimax-h3/blob/main/FL2VA/model_index.json"
click node_ref_manifest "https://github.com/minimax-ai/minimax-h3/blob/main/Ref2VA/model_index.json"
click node_fl_inputs "https://github.com/minimax-ai/minimax-h3/blob/main/FL2VA/processor/chat_template.json"
click node_tokenizer "https://github.com/minimax-ai/minimax-h3/blob/main/FL2VA/tokenizer/tokenizer_config.json"
click node_text_encoder "https://github.com/minimax-ai/minimax-h3/blob/main/FL2VA/text_encoder/config.json"
click node_video_vae "https://github.com/minimax-ai/minimax-h3/blob/main/FL2VA/video_vae/minimax_h3_video_vae.py"
click node_audio_vae "https://github.com/minimax-ai/minimax-h3/blob/main/FL2VA/audio_vae/minimax_h3_audio_vae.py"
click node_fl_transformer "https://github.com/minimax-ai/minimax-h3/blob/main/FL2VA/transformer/model.safetensors.index.json"
click node_ref_transformer "https://github.com/minimax-ai/minimax-h3/blob/main/Ref2VA/transformer/model.safetensors.index.json"
click node_video_scheduler "https://github.com/minimax-ai/minimax-h3/blob/main/scheduler/scheduler_config.json"
click node_audio_scheduler "https://github.com/minimax-ai/minimax-h3/blob/main/audio_scheduler/scheduler_config.json"
click node_local_request "https://github.com/minimax-ai/minimax-h3/blob/main/scripts/readme/reproducible-768p-t2va-request.sh"
click node_context_ir "https://github.com/minimax-ai/minimax-h3/blob/main/scripts/readme/full-2k-t2va-h3-context-ir.sh"
click node_base_768p "https://github.com/minimax-ai/minimax-h3/blob/main/scripts/readme/full-2k-t2va-h3-base.sh"
click node_regen_2k "https://github.com/minimax-ai/minimax-h3/blob/main/scripts/readme/full-2k-t2va-h3-regenerate-2k.sh"
click node_prompt_skill "https://github.com/minimax-ai/minimax-h3/blob/main/skills/h3-prompt-writing/SKILL.md"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_root_manifest,node_fl_manifest,node_ref_manifest,node_fl_inputs,node_tokenizer,node_text_encoder,node_video_vae,node_audio_vae,node_fl_transformer,node_ref_transformer,node_video_scheduler,node_audio_scheduler toneBlue
class node_runtime,node_local_request,node_context_ir,node_base_768p,node_regen_2k toneAmber
class node_prompt_skill toneMint
```

## Components

### Local H3-Base distribution

Deployable 768p checkpoint families and components.

- [Distribution manifest](https://github.com/minimax-ai/minimax-h3/blob/main/model_index.json): checkpoint index · Top-level model entry metadata. · `model_index.json`
- [FL2VA manifest](https://github.com/minimax-ai/minimax-h3/blob/main/FL2VA/model_index.json): task manifest · First/last-frame audio-video variant. · `FL2VA/model_index.json`
- [Ref2VA manifest](https://github.com/minimax-ai/minimax-h3/blob/main/Ref2VA/model_index.json): task manifest · Multimodal-reference audio-video variant. · `Ref2VA/model_index.json`
- [FL2VA input processor](https://github.com/minimax-ai/minimax-h3/blob/main/FL2VA/processor/chat_template.json): processor · Formats prompts and structured conditioning. · `FL2VA/processor/chat_template.json`
- [Tokenizer](https://github.com/minimax-ai/minimax-h3/blob/main/FL2VA/tokenizer/tokenizer_config.json): tokenizer · Defines special dialogue tokens. · `FL2VA/tokenizer/tokenizer_config.json`
- [Text encoder](https://github.com/minimax-ai/minimax-h3/blob/main/FL2VA/text_encoder/config.json): encoder config · Converts tokenized prompts to representations. · `FL2VA/text_encoder/config.json`
- [Temporal video VAE](https://github.com/minimax-ai/minimax-h3/blob/main/FL2VA/video_vae/minimax_h3_video_vae.py): visual latent codec · Causally encodes and decodes video latents. · `FL2VA/video_vae/minimax_h3_video_vae.py`
- [Stereo AudioVAE](https://github.com/minimax-ai/minimax-h3/blob/main/FL2VA/audio_vae/minimax_h3_audio_vae.py): audio latent codec · Independently processes stereo-channel latents. · `FL2VA/audio_vae/minimax_h3_audio_vae.py`
- [FL2VA Omni Transformer](https://github.com/minimax-ai/minimax-h3/blob/main/FL2VA/transformer/model.safetensors.index.json): joint diffusion transformer · Jointly predicts video and audio latents. · `FL2VA/transformer/model.safetensors.index.json`
- [Ref2VA Omni Transformer](https://github.com/minimax-ai/minimax-h3/blob/main/Ref2VA/transformer/model.safetensors.index.json): joint diffusion transformer · Distinct weights for multimodal-reference generation. · `Ref2VA/transformer/model.safetensors.index.json`
- [Video scheduler](https://github.com/minimax-ai/minimax-h3/blob/main/scheduler/scheduler_config.json): diffusion schedule · `scheduler/scheduler_config.json`
- [Audio scheduler](https://github.com/minimax-ai/minimax-h3/blob/main/audio_scheduler/scheduler_config.json): diffusion schedule · `audio_scheduler/scheduler_config.json`

### External runtime and APIs

Inference and 2K services outside this repository.

- **Inference runtimes**: external runtime · SGLang, vLLM, Diffusers, or ComfyUI execute local inference.
- [Local request scripts](https://github.com/minimax-ai/minimax-h3/blob/main/scripts/readme/reproducible-768p-t2va-request.sh): request client · Reproducible 768p task requests. · `scripts/readme/reproducible-768p-t2va-request.sh`
- [H3-Context-IR](https://github.com/minimax-ai/minimax-h3/blob/main/scripts/readme/full-2k-t2va-h3-context-ir.sh): hosted context service · Refines raw multimodal intent into generation-ready context. · `scripts/readme/full-2k-t2va-h3-context-ir.sh`
- [H3-Base 768p generation](https://github.com/minimax-ai/minimax-h3/blob/main/scripts/readme/full-2k-t2va-h3-base.sh): local workflow stage · Produces base video and native stereo audio. · `scripts/readme/full-2k-t2va-h3-base.sh`
- [H3-Regenerate-2K](https://github.com/minimax-ai/minimax-h3/blob/main/scripts/readme/full-2k-t2va-h3-regenerate-2k.sh): hosted regeneration service · Consumes base output and original context. · `scripts/readme/full-2k-t2va-h3-regenerate-2k.sh`

### Prompt authoring

Independent structured-prompt package.

- [H3 prompt-writing skill](https://github.com/minimax-ai/minimax-h3/blob/main/skills/h3-prompt-writing/SKILL.md): prompt-authoring package · Standardizes structured and style-specific prompts. · `skills/h3-prompt-writing/SKILL.md`

## Connections

- Distribution manifest → FL2VA manifest: indexes
- Distribution manifest → Ref2VA manifest: indexes
- FL2VA manifest → FL2VA input processor: configures
- FL2VA input processor → Tokenizer: uses
- Tokenizer → Text encoder: tokens to embeddings
- Text encoder → FL2VA Omni Transformer: text context
- Temporal video VAE → FL2VA Omni Transformer: video latents
- Stereo AudioVAE → FL2VA Omni Transformer: audio latents
- Video scheduler → FL2VA Omni Transformer: video diffusion control
- Audio scheduler → FL2VA Omni Transformer: audio diffusion control
- FL2VA Omni Transformer → Temporal video VAE: predicted video latents
- FL2VA Omni Transformer → Stereo AudioVAE: predicted audio latents
- Ref2VA manifest → Ref2VA Omni Transformer: configures
- Local request scripts → Inference runtimes: submits requests
- Inference runtimes → FL2VA manifest: loads task variant
- Inference runtimes → Ref2VA manifest: loads task variant
- H3 prompt-writing skill → H3-Context-IR: structured prompts
- H3 prompt-writing skill → Local request scripts: structured prompts
- H3-Context-IR → H3-Base 768p generation: generation-ready context
- H3-Base 768p generation → H3-Regenerate-2K: base result and context
