scripts/readme/full-2k-i2va-h3-base.sh
1.1 KB · 43 lines · bash Raw
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": "fl2va",
10 "prompt": $prompt,
11 "conditions": [
12 {
13 "type": "image",
14 "uri": "https://cdn.hailuoai.com/prod/hailuo_demo/testsets/H3_AA_I2VA/gallery/sr_v17_variants_seed42_43_20260724/inputs/4a3a90bf9100_KDmcbkhzYo5sjjxr9FqcVmWVnzb.png",
15 "role": "keyframe",
16 "frame_index": 0
17 }
18 ],
19 "target": {
20 "short_edge": 768,
21 "aspect_ratio": "auto",
22 "duration_seconds": 8
23 },
24 "seed": 0
25 }' |
26 curl --silent --show-error \
27 --request POST \
28 --url "$SGLANG_DEPLOYMENT_URL/v1/videos" \
29 --header 'Content-Type: application/json' \
30 --data-binary @- |
31 jq -er '.id'
32 )
33 # Query the generation status.
34 curl --silent --show-error \
35 --request GET \
36 --url "$SGLANG_DEPLOYMENT_URL/v1/videos/$video_id" |
37 jq '{status}'
38 # Download the local H3-Base MP4 after its status becomes completed.
39 curl --silent --show-error \
40 --request GET \
41 --url "$SGLANG_DEPLOYMENT_URL/v1/videos/$video_id/content" \
42 --output i2va.mp4
43