scripts/readme/full-2k-t2va-h3-base.sh
| 1 | #!/usr/bin/env bash |
| 2 | set -euo pipefail |
| 3 | |
| 4 | # Create the H3-Base request with the expanded prompt and capture the video ID. |
| 5 | video_id=$( |
| 6 | jq -n \ |
| 7 | --arg prompt "$EXPANDED_PROMPT" \ |
| 8 | '{ |
| 9 | "task": "t2va", |
| 10 | "prompt": $prompt, |
| 11 | "conditions": [], |
| 12 | "target": { |
| 13 | "short_edge": 768, |
| 14 | "aspect_ratio": "16:9", |
| 15 | "duration_seconds": 10 |
| 16 | }, |
| 17 | "seed": 0 |
| 18 | }' | |
| 19 | curl --silent --show-error \ |
| 20 | --request POST \ |
| 21 | --url "$SGLANG_DEPLOYMENT_URL/v1/videos" \ |
| 22 | --header 'Content-Type: application/json' \ |
| 23 | --data-binary @- | |
| 24 | jq -er '.id' |
| 25 | ) |
| 26 | # Query the generation status. |
| 27 | curl --silent --show-error \ |
| 28 | --request GET \ |
| 29 | --url "$SGLANG_DEPLOYMENT_URL/v1/videos/$video_id" | |
| 30 | jq '{status}' |
| 31 | # Download the local H3-Base MP4 after its status becomes completed. |
| 32 | curl --silent --show-error \ |
| 33 | --request GET \ |
| 34 | --url "$SGLANG_DEPLOYMENT_URL/v1/videos/$video_id/content" \ |
| 35 | --output t2va.mp4 |
| 36 | |