seedinteger
Random seed (0-2147483647) for reproducible results. Omit for a random seed.
alibaba/wan/2.7/reference-to-videoAlibaba Wan 2.7 reference-to-video model generating video guided by reference content.
試用這個模型
PNG, JPEG, WebP, or GIF · 20 MiB maximum each
接下來您想做什麼?
選擇一個範例,將其輸入與結果載入 playground。
{
"images": [
"https://static.sandbase.ai/examples/6ec7122b-e121-4332-aac6-9564b61c6067/input/b1c60c74-e701-44d8-8f6a-c50b4cb6ffa0.webp"
],
"prompt": "Reference image, 3D cartoon adventure movie style, chibi characters with detailed textures, smooth actions, and vibrant colors. Keep the characters and forest scene consistent. Do not add text. Atmosphere: Adventurous, lighthearted, mysterious, whimsical. Characters: Boy explorer: round hat, backpack, short cloak. Sidekick: a flying small robot with a round body and blue glowing eyes. Scene: Fantasy forest with giant tree roots, mushrooms, vines, a treasure cave entrance, and sunbeams. Storyboard: 1. Wide shot: Tall trees and interlaced light beams in a mysterious and bright fantasy forest. 2. Medium shot: The boy pushes aside vines to explore. 3. Medium shot: The small robot flies beside him, scanning ahead with a blue light. 4. Close-up: An old treasure map unfolds in the boy's hands. 5. Close-up: He shows an excited expression, his eyes lighting up. 6. Action shot: The two jump over tree roots and a stream, continuing deeper into the forest. 7. Medium shot: A moss-covered treasure chest is revealed behind the vines. 8. Close-up: A golden glow shines from the edge of the treasure chest. 9. Final shot: The boy and the small robot stand before the treasure chest, looking at each other in surprise, full of adventure."
}Cast people, products, or characters from reference images (and optional reference videos) into a new scene. The prompt directs what they do; Wan 2.7 keeps their appearance consistent and supports several referenced characters interacting in one shot.
| Field | Type | Default | Notes |
|---|---|---|---|
prompt | string, required | — | Up to 50,000 characters. |
images | image URL[], required | — | Reference images, referred to in the prompt as Image 1, Image 2, … |
videos | video URL[] | — | Optional reference clips, referred to as Video 1, Video 2, … |
duration | 2–15 | 5 | Output length in seconds. |
aspect_ratio | 16:9 / 9:16 / 1:1 / 4:3 / 3:4 | — | Output frame shape. |
resolution | 720p / 1080p | 720p | Sets the per-second rate. |
seed | integer | random | Fix it to compare prompt changes. |
You pay for output seconds: $0.10 at 720p and $0.15 at 1080p, the same as Alibaba's list price. When you send reference videos, 5 seconds of input are added to the billed length.
| Output | 720p | 1080p |
|---|---|---|
| 5s, images only | $0.50 | $0.75 |
| 5s, with reference video | $1.00 | $1.50 |
| 10s, images only | $1.00 | $1.50 |
| 15s, images only | $1.50 | $2.25 |
Failed runs are not charged.
images changes what “Image 2” means.alibaba/wan/2.7/video-edit.Other Wan 2.7 endpoints: alibaba/wan/2.7/text-to-video, alibaba/wan/2.7/image-to-video, alibaba/wan/2.7/video-edit, alibaba/wan/2.7/video-extend, alibaba/wan/3.0/video (newer, up to 30s).
開始建置
透過 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.7/reference-to-video",
"images": [
"https://static.sandbase.ai/examples/alibaba/wan/2.6/reference-to-video/flash/input_images_0.png"
],
"prompt": "A golden retriever puppy running through a field of wildflowers in slow motion, ears flapping, tongue out, soft backlight",
"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 (0-2147483647) for reproducible results. Omit for a random seed.
imagesarray必填The URLs of reference images to guide video generation. Provide at least one reference image or video.
promptstring必填The text prompt to generate a video from.
預設:"A golden retriever puppy running through a field of wildflowers in slow motion, ears flapping, tongue out, soft backlight"
videosarrayThe URLs of reference videos to guide video generation.
durationintegerThe duration of the generated video in seconds.
預設:5
可能值:2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15
resolutionstringThe resolution of the video to generate.
預設:"720p"
可能值:"720p", "1080p"
aspect_ratiostringThe aspect ratio of the generated video.
可能值:"16:9", "9:16", "1:1", "4:3", "3:4"
{
"model": "alibaba/wan/2.7/reference-to-video",
"images": [
"https://static.sandbase.ai/examples/alibaba/wan/2.6/reference-to-video/flash/input_images_0.png"
],
"prompt": "A golden retriever puppy running through a field of wildflowers in slow motion, ears flapping, tongue out, soft backlight",
"duration": 5,
"resolution": "720p"
}已完成的執行會在輸出中顯示結果。以下為模型已儲存的範例,並非新的生成結果。
[
{
"poster": "https://static.sandbase.ai/examples/posters/06a833ab909502d05a32.jpg",
"source": "Alibaba Cloud",
"source_url": "https://www.alibabacloud.com/help/en/model-studio/video-to-video-guide",
"url": "https://static.sandbase.ai/examples/6ec7122b-e121-4332-aac6-9564b61c6067/output/69588557-e71b-479f-9cd3-29ece3fc657d.mp4"
}
]