Skip to content

Commit 8992722

Browse files
authored
Merge pull request #212 from MiniMax-AI/agent/add-hailuo-h3-video-v2
Add Hailuo H3 video generation support
2 parents 3615170 + 0c4affd commit 8992722

22 files changed

Lines changed: 1626 additions & 100 deletions

File tree

README.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,12 +85,24 @@ mmx image generate --prompt "Logo" --out-dir ./out/
8585
### `mmx video`
8686

8787
```bash
88+
# Hailuo-2.3 (Video Generation V1)
8889
mmx video generate --prompt "Ocean waves at sunset" --download sunset.mp4
8990
mmx video generate --prompt "A robot painting" --async
91+
92+
# MiniMax-H3 (Video Generation V2)
93+
mmx video generate --api-key "$MINIMAX_API_KEY" --model MiniMax-H3 --prompt "Ocean waves at sunset"
94+
mmx video generate --api-key "$MINIMAX_API_KEY" --model MiniMax-H3 --prompt "The subject walks forward" --image start.jpg
95+
mmx video generate --api-key "$MINIMAX_API_KEY" --model MiniMax-H3 --prompt "Keep the same character" --reference-image character.png --reference-video motion.mp4
96+
9097
mmx video task get --task-id 123456
98+
mmx video task get --task-id 424010985738629 --model MiniMax-H3
9199
mmx video download --file-id 176844028768320 --out video.mp4
92100
```
93101

102+
For MiniMax-H3, local files and Base64 data URIs are preflight-checked against the documented limits: image 30 MB, reference video 50 MB, reference audio 15 MB, and total JSON request body 64 MB. The API validates dimensions, aspect ratio, duration, frame rate, and codecs for all media.
103+
104+
`--region` is an existing global CLI option, not an H3 parameter. Normal video generation does not need it; the CLI uses the saved or automatically detected region. H3 defaults to 2K, 5 seconds, and 16:9 for text-to-video.
105+
94106
### `mmx speech`
95107

96108
```bash

README_CN.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,12 +85,24 @@ mmx image generate --prompt "山水画" --out-dir ./output/
8585
### `mmx video`
8686

8787
```bash
88+
# Hailuo-2.3(视频生成 V1)
8889
mmx video generate --prompt "海浪拍打礁石" --download sunset.mp4
8990
mmx video generate --prompt "机器人作画" --async
91+
92+
# MiniMax-H3(视频生成 V2)
93+
mmx video generate --api-key "$MINIMAX_API_KEY" --model MiniMax-H3 --prompt "夕阳下的海浪"
94+
mmx video generate --api-key "$MINIMAX_API_KEY" --model MiniMax-H3 --prompt "主体向前行走" --image start.jpg
95+
mmx video generate --api-key "$MINIMAX_API_KEY" --model MiniMax-H3 --prompt "保持相同角色和动作" --reference-image character.png --reference-video motion.mp4
96+
9097
mmx video task get --task-id 123456
98+
mmx video task get --task-id 424010985738629 --model MiniMax-H3
9199
mmx video download --file-id 176844028768320 --out video.mp4
92100
```
93101

102+
MiniMax-H3 会在发送前检查本地文件和 Base64 数据:图片不超过 30 MB、参考视频不超过 50 MB、参考音频不超过 15 MB、JSON 请求体总计不超过 64 MB。所有素材的尺寸、宽高比、时长、帧率和编码格式仍由 API 服务端校验。
103+
104+
`--region` 是 CLI 原有的全局选项,不是 H3 参数。正常生成视频无需填写,CLI 会使用已保存或自动识别的区域。H3 默认使用 2K、5 秒,文生视频默认比例为 16:9。
105+
94106
### `mmx speech`
95107

96108
```bash

SDK.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,12 +65,29 @@ const video = await sdk.video.generate({
6565
prompt: 'Ocean waves at sunset',
6666
});
6767

68+
// MiniMax-H3 — Video Generation V2 with request defaults
69+
const h3Video = await sdk.video.generate({
70+
model: 'MiniMax-H3',
71+
prompt: 'Ocean waves at sunset',
72+
});
73+
6874
// Asynchronous — returns task ID immediately
6975
const { taskId } = await sdk.video.generate({
7076
prompt: 'A robot painting',
7177
async: true,
7278
});
7379

80+
const { taskId: h3TaskId } = await sdk.video.generate({
81+
model: 'MiniMax-H3',
82+
prompt: 'Ocean waves at sunset',
83+
async: true,
84+
});
85+
86+
const h3Task = await sdk.video.getTask({
87+
taskId: h3TaskId,
88+
model: 'MiniMax-H3',
89+
});
90+
7491
const task = await sdk.video.getTask({ taskId });
7592

7693
// Download

skill/SKILL.md

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ mmx image generate --prompt "Logo" --n 3 --out-dir ./gen/ --quiet
117117

118118
### video generate
119119

120-
Generate video. Default model: `MiniMax-Hailuo-2.3`. This is an async task — by default it polls until completion.
120+
Generate video. Default model: `MiniMax-Hailuo-2.3`. Select `MiniMax-H3` to use the Video Generation V2 multimodal API. This is an async task — by default it polls until completion.
121121

122122
```bash
123123
mmx video generate --prompt <text> [flags]
@@ -126,8 +126,14 @@ mmx video generate --prompt <text> [flags]
126126
| Flag | Type | Description |
127127
|---|---|---|
128128
| `--prompt <text>` | string, **required** | Video description |
129-
| `--model <model>` | string | `MiniMax-Hailuo-2.3` (default) or `MiniMax-Hailuo-2.3-Fast` |
130-
| `--first-frame <path-or-url>` | string | First frame image |
129+
| `--model <model>` | string | `MiniMax-Hailuo-2.3` (default), `MiniMax-Hailuo-2.3-Fast`, or `MiniMax-H3` |
130+
| `--image <path-or-url>` | string | Input image for image-to-video |
131+
| `--last-frame <path-or-url>` | string | Last frame image; H3 supports last-frame-only input |
132+
| `--reference-image <path-or-url>` | string, repeatable | H3 reference image |
133+
| `--reference-video <path-or-url>` | string, repeatable | H3 reference video |
134+
| `--reference-audio <path-or-url>` | string, repeatable | H3 reference audio; requires a reference image or video |
135+
| `--duration <seconds>` | number | H3 duration, 4-15 seconds (default: 5) |
136+
| `--ratio <ratio>` | string | H3 output ratio; T2V cannot use `adaptive` |
131137
| `--callback-url <url>` | string | Webhook URL for completion |
132138
| `--download <path>` | string | Save video to specific file |
133139
| `--async` | boolean | Return task ID immediately |
@@ -139,6 +145,18 @@ mmx video generate --prompt <text> [flags]
139145
mmx video generate --prompt "A robot." --async --quiet
140146
# stdout: {"taskId":"..."}
141147

148+
# H3 text-to-video
149+
mmx video generate --model MiniMax-H3 --prompt "Ocean waves." --async --quiet
150+
151+
# H3 image-to-video
152+
mmx video generate --model MiniMax-H3 --prompt "The subject walks forward." \
153+
--image start.jpg --async --quiet
154+
155+
# H3 reference-to-video
156+
mmx video generate --model MiniMax-H3 --prompt "Keep the same character." \
157+
--reference-image character.png \
158+
--reference-video motion.mp4 --async --quiet
159+
142160
# Blocking: wait and get file path
143161
mmx video generate --prompt "Ocean waves." --download ocean.mp4 --quiet
144162
# stdout: ocean.mp4

src/client/endpoints.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,18 @@ export function videoGenerateEndpoint(baseUrl: string): string {
1818
return `${baseUrl}/v1/video_generation`;
1919
}
2020

21+
export function videoGenerateV2Endpoint(baseUrl: string): string {
22+
return `${baseUrl}/v2/video_generation`;
23+
}
24+
2125
export function videoTaskEndpoint(baseUrl: string, taskId: string): string {
2226
return `${baseUrl}/v1/query/video_generation?task_id=${taskId}`;
2327
}
2428

29+
export function videoTaskV2Endpoint(baseUrl: string, taskId: string): string {
30+
return `${baseUrl}/v2/query/video_generation/${taskId}`;
31+
}
32+
2533
export function fileRetrieveEndpoint(baseUrl: string, fileId: string): string {
2634
return `${baseUrl}/v1/files/retrieve?file_id=${fileId}`;
2735
}

src/command.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ export interface OptionDef {
66
description: string;
77
type?: 'string' | 'number' | 'boolean' | 'array';
88
required?: boolean;
9+
hidden?: boolean;
910
}
1011

1112
export interface Command {

0 commit comments

Comments
 (0)