seedinteger
Random seed for reproducibility.
最小值:0
最大值:2147483647
alibaba/wan/2.2/animate/replaceWan 2.2 Animate Replace replaces the person in the reference video with the character from the image.
試用這個模型
PNG、JPEG、WebP 或 GIF · 最多 20 MiB
接下來您想做什麼?
選擇一個範例,將其輸入與結果載入 playground。
{
"image": "https://static.sandbase.ai/examples/874ae93a-9288-40dc-b214-6c73426b2d22/input/e9a4fdfa-de1e-494c-a286-70452a235cf1.png",
"video": "https://static.sandbase.ai/examples/874ae93a-9288-40dc-b214-6c73426b2d22/input/c93e1785-2391-4b49-805a-bd2bfe345c93.mp4"
}Swap the person in a reference video for the character in image. Motion, camera, and scene come from the video; the new character's look comes from the picture, relit to fit the scene.
| Field | Type | Default | Notes |
|---|---|---|---|
image | image URL, required | — | Character image. JPEG, PNG, or WebP URL. |
video | video URL, required | — | Reference video that supplies the motion. |
resolution | 480p / 580p / 720p | 720p | Sets the rate. |
use_turbo | boolean | false | Faster generation at some quality cost. |
seed | integer 0–2147483647 | random | Fix it to compare prompt changes. |
Billing follows the upstream unit: output seconds counted at 16 frames per second, so a 30fps output bills about 1.9× its wall-clock length. Rates per counted second: $0.04 at 480p, $0.06 at 580p, $0.08 at 720p. The quote before submission assumes a 5-second, 30fps result; the final charge uses the measured output.
| Output | 480p | 580p | 720p |
|---|---|---|---|
| 5s at 30fps | $0.375 | $0.5625 | $0.75 |
| 10s at 30fps | $0.75 | $1.125 | $1.50 |
| 10s at 16fps | $0.40 | $0.60 | $0.80 |
Failed runs are not charged.
Other Wan 2.2 endpoints: alibaba/wan/2.2/animate/move, alibaba/wan/2.2/speech-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": "alibaba/wan/2.2/animate/replace",
"image": "https://static.sandbase.ai/examples/alibaba/wan/2.2/animate/replace/input_image_0.png",
"video": "https://static.sandbase.ai/examples/alibaba/wan/2.2/animate/replace/input_video_1.mp4",
"use_turbo": false,
"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.
最小值:0
最大值:2147483647
imagestring必填Input image URL (face / character).
videostring必填Reference video.
use_turbobooleanFaster generation with quality enhancement.
預設:false
resolutionstringOutput resolution.
預設:"720p"
可能值:"480p", "580p", "720p"
{
"model": "alibaba/wan/2.2/animate/replace",
"image": "https://static.sandbase.ai/examples/alibaba/wan/2.2/animate/replace/input_image_0.png",
"video": "https://static.sandbase.ai/examples/alibaba/wan/2.2/animate/replace/input_video_1.mp4",
"use_turbo": false,
"resolution": "720p"
}已完成的執行會在輸出中顯示結果。以下為模型已儲存的範例,並非新的生成結果。
[
{
"poster": "https://static.sandbase.ai/examples/posters/4d5a028d71443e685f77.jpg",
"source": "Alibaba Model Studio schema mirror",
"source_url": "https://www.alibabacloud.com/help/en/model-studio/",
"url": "https://static.sandbase.ai/examples/874ae93a-9288-40dc-b214-6c73426b2d22/output/a33829fd-db96-4b56-9675-74ed689de1e0.mp4"
}
]