scripts/readme/full-2k-ref2va-h3-context-ir.sh
1.6 KB · 48 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": "Character speaks: Follow the wind, live free. Leave worries behind, enjoy the moment. Voice timbre follows reference audio 1."
17 },
18 {
19 "type": "video_url",
20 "video_url": {
21 "url": "https://cdn.hailuoai.com/prod/hailuo_demo/testsets/h3_promo_eval_ref2va/gallery/sr_v2p26_trio_seed42_20260724/inputs/297573323635_00_%E8%A7%86%E9%A2%911_YnyRbxEwio_video_20260525_163755_1927e9d3.mp4"
22 },
23 "role": "reference_video"
24 },
25 {
26 "type": "audio_url",
27 "audio_url": {
28 "url": "https://cdn.hailuoai.com/prod/hailuo_demo/testsets/h3_promo_eval_ref2va/gallery/sr_v2p26_trio_seed42_20260724/inputs/f463d523c5ce_01_%E9%9F%B3%E9%A2%911_RSLcbpzJPo_6%E6%9C%885%E6%97%A5(1).mp3"
29 },
30 "role": "reference_audio"
31 }
32 ],
33 "duration": 5,
34 "ratio": "adaptive"
35 }' |
36 jq -er '.task_id'
37 )
38 # Query again while the task is queued or running.
39 context_ir_result=$(
40 curl --silent --show-error \
41 --request GET \
42 --url "$MINIMAX_API_BASE/v2/query/video_generation/$task_id" \
43 --header "Authorization: Bearer $TOKEN"
44 )
45 echo "$context_ir_result" | jq .
46 # Export the complete expanded prompt for H3-Base and regeneration.
47 EXPANDED_PROMPT=$(echo "$context_ir_result" | jq -er '.task.content.prompt')
48