MiniMax H3
Set a video's length by frame count.
Set a video's length
There are two ways to set how long a video is. Send exactly one of them in
video_config - a request with both, or neither, is rejected with HTTP 400.
duration_secs: whole seconds, from the model's list of durations. Works on every video model.num_frames: a frame count, for lengths between whole seconds.MiniMax-H3accepts it forT2V,I2V,F2F, andR2Vat 24 FPS. Other models reject it with HTTP 400.
Want 3.75 seconds? Send num_frames: 90 - seconds x 24.
curl https://api.machgen.ai/api/v0/generate \
-H "Authorization: Bearer $MACHGEN_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"prompt": "A red panda exploring a misty forest at dawn",
"model": "MiniMax-H3",
"task_type": "T2V",
"video_config": {"num_frames": 90, "height": 768, "aspect_ratio": "16:9"}
}'MiniMax-H3 renders frame counts of 17n + 5: 22, 39, 56, 73, 90, and so on
up to 362. Any other count from 14 to 370 moves to the nearest of these, so
num_frames: 60 renders 56 frames (2.33 seconds). An exact tie goes to the
shorter one. The response returns the count used in metadata.num_frames, and the
exact length in seconds in metadata.duration_secs:
{
"task_id": "t-abc123",
"metadata": {"num_frames": 90, "duration_secs": 3.75, "fps": 24, ...}
}All the frame counts MiniMax-H3 renders, with their length in seconds:
| Frames | Seconds | Frames | Seconds | Frames | Seconds |
|---|---|---|---|---|---|
| 22 | 0.92 | 39 | 1.62 | 56 | 2.33 |
| 73 | 3.04 | 90 | 3.75 | 107 | 4.46 |
| 124 | 5.17 | 141 | 5.88 | 158 | 6.58 |
| 175 | 7.29 | 192 | 8 | 209 | 8.71 |
| 226 | 9.42 | 243 | 10.12 | 260 | 10.83 |
| 277 | 11.54 | 294 | 12.25 | 311 | 12.96 |
| 328 | 13.67 | 345 | 14.38 | 362 | 15.08 |
The request is rejected with HTTP 400 when:
num_framesis below 14 or above 370 (it would render fewer than 22 or more than 362 frames).fpsis set to anything but 24 (or leave it out).- the model or task type doesn't take
num_frames, orreference_video_operationkeeps the source video's length.
A frame-count video is billed by the second, rounded to the nearest whole second (an exact half rounds down): 56 frames bill as 2 seconds, 124 frames (5.17 seconds) as 5.
With the Python SDK, see Set a video's length.