scripts/readme/full-2k-i2va-reference-768p-result-by-directly-calling-open-platform-api.sh
1.3 KB · 43 lines · bash Raw
1 #!/usr/bin/env bash
2 set -euo pipefail
3
4 # Create an 8-second 768P FL2VA video directly and capture its runtime task ID.
5 task_id=$(
6 curl --silent --show-error \
7 --request POST \
8 --url "$MINIMAX_API_BASE/v2/video_generation" \
9 --header "Authorization: Bearer $TOKEN" \
10 --header 'Content-Type: application/json' \
11 --data '{
12 "model": "MiniMax-H3",
13 "content": [
14 {
15 "type": "text",
16 "text": "Pull focus to the people in the background and add more steam to the ramen bowl."
17 },
18 {
19 "type": "image_url",
20 "image_url": {
21 "url": "https://cdn.hailuoai.com/prod/hailuo_demo/testsets/H3_AA_I2VA/gallery/sr_v17_variants_seed42_43_20260724/inputs/4a3a90bf9100_KDmcbkhzYo5sjjxr9FqcVmWVnzb.png"
22 },
23 "role": "first_frame"
24 }
25 ],
26 "resolution": "768P",
27 "duration": 8,
28 "ratio": "adaptive"
29 }' |
30 jq -er '.task_id'
31 )
32 # Query again while the task is queued or running.
33 generation_result=$(
34 curl --silent --show-error \
35 --request GET \
36 --url "$MINIMAX_API_BASE/v2/query/video_generation/$task_id" \
37 --header "Authorization: Bearer $TOKEN"
38 )
39 echo "$generation_result" | jq '{status: .task.status}'
40 # Download the 768P MP4 after the task succeeds.
41 video_url=$(echo "$generation_result" | jq -er '.task.content.url')
42 curl --location "$video_url" --output i2va_direct_768p.mp4
43