seedinteger
Random seed for reproducibility. If None, a random seed is chosen.
alibaba/wan/2.5/image-to-videoWan 2.5 by Alibaba - animate still images into dynamic videos with AI. Transform photos into cinematic clips with natural motion, camera movement, and optional audio generation.
试用该模型
PNG、JPEG、WebP 或 GIF · 最大 20 MiB
下一步想做什么?
选择一个示例,将其输入和结果加载到 playground 中。
{
"image": "https://static.sandbase.ai/examples/307c1d7d-e78c-4a77-a6a5-1c6acba658c8/input/92e17c0c-edf0-478e-a3b4-c4dbaff2d415.jpg",
"prompt": "The white dragon warrior stands still, eyes full of determination and strength. The camera slowly moves closer or circles around the warrior, highlighting the powerful presence and heroic spirit of the character."
}Wan 2.5 image-to-video: animate a picture into a 5 or 10 second clip, optionally driven by an audio track.
| Field | Type | Default | Notes |
|---|---|---|---|
prompt | string, required | — | Text instruction. |
image | image URL, required | — | First frame. JPEG, PNG, or WebP URL. |
audio | audio URL | — | Optional WAV/MP3 URL that drives speech or rhythm. |
resolution | 480p / 720p / 1080p | 720p | Sets the per-second rate. |
duration | 5 / 10 | 5 | Output length in seconds. |
seed | integer | random | Fix it to compare prompt changes. |
You pay for output seconds: $0.05 at 480p, $0.10 at 720p, and $0.15 at 1080p. Input images and audio are not metered.
| Output | 480p | 720p | 1080p |
|---|---|---|---|
| 5s (default) | $0.25 | $0.50 | $0.75 |
| 10s | $0.50 | $1.00 | $1.50 |
Failed runs are not charged.
Other Wan 2.5 endpoints: alibaba/wan/2.5/text-to-video, alibaba/wan/2.5/text-to-image, alibaba/wan/2.5/image-to-image, alibaba/wan/2.7/image-to-video (newer).
开始构建
通过 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": "alibaba/wan/2.5/image-to-video",
"image": "https://static.sandbase.ai/examples/alibaba/wan/2.5/image-to-video/input_image_0.jpg",
"prompt": "The white dragon warrior stands still, eyes full of determination and strength. The camera slowly moves closer or circles around the warrior, highlighting the powerful presence and heroic spirit of the character.",
"duration": 5,
"resolution": "720p"
}
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;这并不表示支持视频上传。
seedintegerRandom seed for reproducibility. If None, a random seed is chosen.
audiostringURL of the audio to use as the background music. Must be publicly accessible. Limit handling: If the audio duration exceeds the duration value (5 or 10 seconds), the audio is truncated to the first 5 or 10 seconds, and the rest is discarded. If the audio is shorter than the video, the remaining part of the video will be silent. For example, if the audio is 3 seconds long and the video duration is 5 seconds, the first 3 seconds of the output video will have sound, and the last 2 seconds will be silent. - Format: WAV, MP3. - Duration: 3 to 30 s. - File size: Up to 15 MB.
imagestring必填URL of the image to use as the first frame. Must be publicly accessible or base64 data URI.
promptstring必填The text prompt describing the desired video motion. Max 800 characters.
durationintegerDuration of the generated video in seconds. Choose between 5 or 10 seconds.
默认值:5
可选值:5, 10
resolutionstringVideo resolution. Valid values: 480p, 720p, 1080p
默认值:"720p"
可选值:"480p", "720p", "1080p"
{
"model": "alibaba/wan/2.5/image-to-video",
"image": "https://static.sandbase.ai/examples/alibaba/wan/2.5/image-to-video/input_image_0.jpg",
"prompt": "The white dragon warrior stands still, eyes full of determination and strength. The camera slowly moves closer or circles around the warrior, highlighting the powerful presence and heroic spirit of the character.",
"duration": 5,
"resolution": "720p"
}已完成的运行会在输出中展示结果。以下内容是该模型保存的示例,而不是新的生成结果。
[
{
"poster": "https://static.sandbase.ai/examples/posters/5c699b105a9e49f3a705.jpg",
"source": "Alibaba Model Studio schema mirror",
"source_url": "https://www.alibabacloud.com/help/en/model-studio/",
"url": "https://static.sandbase.ai/examples/307c1d7d-e78c-4a77-a6a5-1c6acba658c8/output/54f0a145-0198-42b5-ae12-37bcba862ac2.mp4"
}
]