scripts/readme/full-2k-t2va-h3-context-ir.sh
1.1 KB · 34 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": "Epic space-opera theatrical teaser: a female captain stands alone before a massive observation window as the last fleet gathers and jumps away in a blinding flash, the bridge shaking, leaving her behind."
17 }
18 ],
19 "duration": 10,
20 "ratio": "16:9"
21 }' |
22 jq -er '.task_id'
23 )
24 # Query again while the task is queued or running.
25 context_ir_result=$(
26 curl --silent --show-error \
27 --request GET \
28 --url "$MINIMAX_API_BASE/v2/query/video_generation/$task_id" \
29 --header "Authorization: Bearer $TOKEN"
30 )
31 echo "$context_ir_result" | jq .
32 # Export the complete expanded prompt for H3-Base and regeneration.
33 EXPANDED_PROMPT=$(echo "$context_ir_result" | jq -er '.task.content.prompt')
34