audiosarray
Up to 3 reference audio clips (voice or music).
heygen/heygen-video/reference-to-videoHeyGen Video Reference to Video generates a 5-15 second video guided by reference images, videos and audio.
试用该模型
PNG, JPEG, WebP, or GIF · 20 MiB maximum each · up to 9
下一步想做什么?
选择一个示例,将其输入和结果加载到 playground 中。
{
"aspect_ratio": "16:9",
"images": [
"https://static.sandbase.ai/examples/dbd3acd5-a7f8-4bc6-a1c3-a6abe02c545f/input/f31c8ffc-a03e-43e6-9873-619009a711c2.png"
],
"prompt": "The tiger from the reference image walks through a snowy pine forest at dusk, snowflakes falling, low-angle shot."
}{
"aspect_ratio": "16:9",
"images": [
"https://static.sandbase.ai/examples/d1601611-1204-40e5-8c03-663e25116aad/input/050a8af9-8598-4a6b-b90c-ce437082ede7.png"
],
"prompt": "The rabbit from the reference image sits by a campfire in a cozy forest clearing at night, sparks drifting upward, slow orbit shot."
}HeyGen Video Reference to Video generates a 5–15 second video guided by reference images, videos and audio clips.
| Field | Type | Default | Notes |
|---|---|---|---|
prompt | string, required | — | Scene and action; describe how each reference is used. |
images | image URL[] | — | Up to 9 reference images (characters, products, scenes). |
videos | video URL[] | — | Up to 3 reference videos for motion or style. |
audios | audio URL[] | — | Up to 3 reference audio clips (voice or music). |
aspect_ratio | 21:9 / 16:9 / 4:3 / 1:1 / 3:4 / 9:16 | — | Leave empty to follow the references. |
resolution | 480p / 768p / 1080p / 2k | 768p | Output resolution; 1080p and 2k cost more. |
duration | 5–15 | 5 | Output length in seconds. |
Billed per output second: $0.07 at 480p, $0.10 at 768p, $0.18 at 1080p and 2k. References are not billed separately.
| Output | Price |
|---|---|
| 5s, 768p (default) | $0.50 |
| 5s, 480p | $0.35 |
| 10s, 1080p | $1.80 |
| Failed runs are not charged. |
Other HeyGen Video endpoints: heygen/heygen-video/text-to-video, heygen/heygen-video/image-to-video.
开始构建
通过 SandBase Unified Run API 提交此模型。
# The quoted heredoc keeps Unicode and shell metacharacters unchanged.
result=$(curl --fail-with-body --silent \
-X POST "https://api.sandbase.ai/v1/run" \
-H "Authorization: Bearer $SANDBASE_API_KEY" \
-H "Content-Type: application/json" \
--data-binary @- <<'SANDBASE_JSON'
{
"model": "heygen/heygen-video/reference-to-video",
"duration": 5,
"resolution": "768p"
}
SANDBASE_JSON
)
run_id=$(printf '%s' "$result" | jq -r .id)
for attempt in $(seq 1 120); do
status=$(printf '%s' "$result" | jq -r .status)
case "$status" in completed|failed|timeout) break ;; esac
sleep 2
result=$(curl --fail-with-body --silent \
-H "Authorization: Bearer $SANDBASE_API_KEY" \
"https://api.sandbase.ai/v1/run/$run_id")
done
status=$(printf '%s' "$result" | jq -r .status)
[ "$status" = completed ] || { echo "Generation ended: $status" >&2; exit 1; }
printf '%s\n' "$result"创建一个 SandBase API 密钥,并将其设置到服务器环境中。所有请求都使用 Bearer 身份验证。
export SANDBASE_API_KEY="YOUR_API_KEY"请将密钥保存在服务器端。不要在浏览器代码中暴露它,也不要提交到仓库。
使用此模型 ID 及其输入向 /v1/run 发送 POST 请求。上方的请求示例包含提交和轮询。
使用返回的运行 ID 轮询,直到状态为 completed、failed 或 timeout。仅在 completed 后读取输出。
curl "https://api.sandbase.ai/v1/run/$RUN_ID" \
-H "Authorization: Bearer $SANDBASE_API_KEY"在模型的 image、video 或 audio 字段中传入一个可公开访问的文件 URL。支持的格式和限制显示在每个 Playground 输入项旁边。
在 Playground 中支持的图片字段上使用上传或替换控件。视频 URL 字段接受托管的 driving video;这并不表示支持视频上传。
audiosarrayUp to 3 reference audio clips (voice or music).
imagesarrayUp to 9 reference images (characters, products, scenes).
promptstring必填Describe the scene, action, camera and sound.
videosarrayUp to 3 reference videos for motion or style.
durationintegerOutput length in seconds (5-15).
默认值:5
最小值:5
最大值:15
resolutionstringOutput resolution. 1080p and 2k cost more.
默认值:"768p"
可选值:"480p", "768p", "1080p", "2k"
aspect_ratiostringOutput frame shape. Leave empty to follow the references (adaptive).
可选值:"21:9", "16:9", "4:3", "1:1", "3:4", "9:16"
{
"model": "heygen/heygen-video/reference-to-video",
"duration": 5,
"resolution": "768p"
}已完成的运行会在输出中展示结果。以下内容是该模型保存的示例,而不是新的生成结果。
[
{
"url": "https://static.sandbase.ai/examples/dbd3acd5-a7f8-4bc6-a1c3-a6abe02c545f/output/9ecef62d-e5c5-4def-b244-64aaa8bbfc56.mp4"
}
]