scripts/readme/full-2k-i2va-h3-context-ir.sh
1.2 KB · 41 lines · bash Raw
1 #!/usr/bin/env bash
2 set -euo pipefail
3
4 # Create the prompt-expansion task and capture its runtime ID.
5 task_id=$(
6 curl --silent --show-error \
7 --request POST \
8 --url "$MINIMAX_API_BASE/v2/h3_context_ir" \
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 "duration": 8,
27 "ratio": "adaptive"
28 }' |
29 jq -er '.task_id'
30 )
31 # Query again while the task is queued or running.
32 context_ir_result=$(
33 curl --silent --show-error \
34 --request GET \
35 --url "$MINIMAX_API_BASE/v2/query/video_generation/$task_id" \
36 --header "Authorization: Bearer $TOKEN"
37 )
38 echo "$context_ir_result" | jq .
39 # Export the complete expanded prompt for H3-Base and regeneration.
40 EXPANDED_PROMPT=$(echo "$context_ir_result" | jq -er '.task.content.prompt')
41