seedinteger
Random seed for reproducibility.
Tối thiểu: 0
Tối đa: 2147483647
alibaba/wan/2.2/speech-to-videoWan 2.2 Speech to Video turns a portrait image and a speech audio into a talking video guided by a prompt.
Thử model
PNG, JPEG, WebP hoặc GIF · tối đa 20 MiB
Bạn muốn làm gì tiếp theo?
Chọn một ví dụ để nạp đầu vào và kết quả của nó vào playground.
{
"audio": "https://static.sandbase.ai/examples/1e330d15-cead-4a6f-95c7-573cdf0002b4/input/a299cae5-adf2-4f2e-a69b-110e1cf5d1a1.wav",
"image": "https://static.sandbase.ai/examples/1e330d15-cead-4a6f-95c7-573cdf0002b4/input/2e0cf355-04f3-49ac-9998-f9d7a51e8f19.png",
"prompt": "Summer beach vacation style, a white cat wearing sunglasses sits on a surfboard."
}Turn a portrait and a speech track into a talking video. Wan 2.2 lip-syncs the face in image to audio and animates head and body movement; the prompt sets the scene and gestures.
| Field | Type | Default | Notes |
|---|---|---|---|
prompt | string, required | — | Text instruction. |
image | image URL, required | — | Portrait to animate. JPEG, PNG, or WebP URL. |
audio | audio URL, required | — | Speech track (WAV/MP3) that drives the lips. |
num_frames | integer 40–120 | 80 | Frames to generate (40–120, 16 frames per second of video). |
resolution | 480p / 580p / 720p | 720p | Sets the rate. |
negative_prompt | string | — | What to avoid. |
seed | integer 0–2147483647 | random | Fix it to compare prompt changes. |
Billed per output second at the upstream rate: $0.10 at 480p, $0.15 at 580p, $0.20 at 720p. The default 80 frames is 5 seconds.
| Output | 480p | 580p | 720p |
|---|---|---|---|
| 80 frames (5s, default) | $0.50 | $0.75 | $1.00 |
| 120 frames (7.5s) | $0.75 | $1.125 | $1.50 |
Failed runs are not charged.
Other Wan 2.2 endpoints: alibaba/wan/2.2/animate/move, alibaba/wan/2.2/animate/replace.
Bắt đầu xây dựng
Gửi model này qua 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/speech-to-video",
"audio": "https://static.sandbase.ai/examples/alibaba/wan/2.2/speech-to-video/input_audio_1.wav",
"image": "https://static.sandbase.ai/examples/alibaba/wan/2.2/speech-to-video/input_image_0.png",
"prompt": "Summer beach vacation style, a white cat wearing sunglasses sits on a surfboard.",
"num_frames": 80,
"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"Tạo một SandBase API key và đặt nó trong môi trường máy chủ của bạn. Tất cả request sử dụng xác thực Bearer.
export SANDBASE_API_KEY="YOUR_API_KEY"Giữ key trên máy chủ. Không hiển thị trong mã trình duyệt hoặc commit vào repository.
POST tới /v1/run với model ID này và các đầu vào của nó. Ví dụ request ở trên bao gồm cả bước gửi và polling.
Dùng run ID được trả về để poll cho đến khi trạng thái là completed, failed hoặc timeout. Chỉ đọc đầu ra sau khi completed.
curl "https://api.sandbase.ai/v1/run/$RUN_ID" \
-H "Authorization: Bearer $SANDBASE_API_KEY"Cung cấp một URL tệp có thể truy cập công khai trong trường image, video hoặc audio của model. Các định dạng và giới hạn được hỗ trợ hiển thị bên cạnh từng input trong Playground.
Dùng điều khiển upload hoặc replace trên các trường image được hỗ trợ trong Playground. Trường URL video chấp nhận một video driving được host; điều này không đồng nghĩa hỗ trợ tải lên video.
seedintegerRandom seed for reproducibility.
Tối thiểu: 0
Tối đa: 2147483647
audiostringbắt buộcInput audio URL.
imagestringbắt buộcInput image URL (face / character).
promptstringbắt buộcText prompt guiding the generation.
num_framesintegerFrames to generate (40–120, multiple of 4) at 16 fps.
Mặc định: 80
Tối thiểu: 40
Tối đa: 120
resolutionstringOutput resolution.
Mặc định: "720p"
Giá trị có thể dùng: "480p", "580p", "720p"
negative_promptstringContent to avoid.
Mặc định: ""
{
"model": "alibaba/wan/2.2/speech-to-video",
"audio": "https://static.sandbase.ai/examples/alibaba/wan/2.2/speech-to-video/input_audio_1.wav",
"image": "https://static.sandbase.ai/examples/alibaba/wan/2.2/speech-to-video/input_image_0.png",
"prompt": "Summer beach vacation style, a white cat wearing sunglasses sits on a surfboard.",
"num_frames": 80,
"resolution": "720p"
}Một run đã hoàn tất sẽ hiển thị kết quả trong output. Phần sau là ví dụ đã lưu của model, không phải một lần tạo mới.
[
{
"poster": "https://static.sandbase.ai/examples/posters/e90941034859654e6a1d.jpg",
"source": "Alibaba Model Studio schema mirror",
"source_url": "https://www.alibabacloud.com/help/en/model-studio/",
"url": "https://static.sandbase.ai/examples/1e330d15-cead-4a6f-95c7-573cdf0002b4/output/7c0ba794-a7be-4ec8-80ab-357cd06ad681.mp4"
}
]