seedinteger
Random seed (0-2147483647) for reproducible results. Omit for a random seed.
Thử model
PNG, JPEG, WebP, or GIF · 20 MiB maximum each
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.
{
"prompt": "Change the video to an 8-bit pixel style",
"video": "https://static.sandbase.ai/examples/d2517981-e23d-4629-a811-791107b46f0d/input/776801b8-88cf-4cfe-8ae6-b3b3f695f1e3.mp4"
}{
"images": [
"https://static.sandbase.ai/examples/9d304d2f-bc79-4e10-895b-7f9feb28fe82/input/255e6684-4e13-4b95-9841-ae954e4713a4.webp"
],
"prompt": "Make the horse-headed character in the video wear the striped sweater from the image",
"video": "https://static.sandbase.ai/examples/9d304d2f-bc79-4e10-895b-7f9feb28fe82/input/6dfddb1c-4c34-48a6-a270-e605bc44cb6c.mp4"
}{
"prompt": "Remove the train from the video. Keep everything else the same.",
"video": "https://static.sandbase.ai/examples/cd7590b7-af00-4d8b-87d1-58170e9b07db/input/5adb4529-4fd8-4595-922d-4c4198496cc9.mp4"
}{
"prompt": "Change the background season to a snowy winter, with snow covering the trees. Keep the river the same.",
"video": "https://static.sandbase.ai/examples/f69f7e20-129d-4d5a-b109-f23772cb979b/input/b20d1ce4-7267-4dd3-ae9e-d09498d0d211.mp4"
}{
"prompt": "Keep the character's voice and tone. Change the left girl's line to: \"Mom, what color is this?\", and change the right girl's line to: \"It's green, baby\"",
"video": "https://static.sandbase.ai/examples/29baa5d7-a124-48b7-91f8-c617e222fd79/input/e4ee5497-9a40-477e-9d6f-f0680cf46210.mp4"
}{
"images": [
"https://static.sandbase.ai/examples/27df96ad-5550-452c-9d92-b0a530e5eb65/input/f88104ef-3e5f-4c9e-ab4b-bf8d6b35879f.png"
],
"prompt": "Reference the special effects of the video and apply them to the woman in the image, with the scene set on a street.",
"video": "https://static.sandbase.ai/examples/27df96ad-5550-452c-9d92-b0a530e5eb65/input/173d05e0-a5ab-485f-9a75-fe20bf0e5f13.mp4"
}Change an existing clip with a sentence: restyle it, swap an object or outfit, or rework the background. The edit is carried through every frame so motion and timing from the source are kept. Optional reference images guide the new look.
| Field | Type | Default | Notes |
|---|---|---|---|
prompt | string, required | — | Up to 50,000 characters. |
video | video URL, required | — | Source clip, Video 1 in the prompt. |
images | image URL[] | — | Optional reference images, Image 1, Image 2, … |
audio_setting | auto / origin | auto | auto regenerates audio to match the edit; origin keeps the source track. |
duration | 0 / 2 / 3 / 4 / 5 / 6 / 7 / 8 / 9 / 10 | 0 | 0 keeps the source length; 2–10 trims or sets the output length. |
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. With duration: 0 the output matches the source, so you pay for the source length; the quote before submission assumes 5 seconds and the final charge uses the measured length. Input video is not metered separately.
| Output | 720p | 1080p |
|---|---|---|
5s source, duration: 0 | $0.50 | $0.75 |
10s source, duration: 0 | $1.00 | $1.50 |
Any source, duration: 3 | $0.30 | $0.45 |
Failed runs are not charged.
duration before running the full clip.alibaba/wan/2.7/video-extend.Other Wan 2.7 endpoints: alibaba/wan/2.7/text-to-video, alibaba/wan/2.7/image-to-video, alibaba/wan/2.7/reference-to-video, alibaba/wan/2.7/video-extend, alibaba/wan/3.0/video (newer, up to 30s).
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.7/video-edit",
"duration": 0,
"resolution": "720p",
"audio_setting": "auto"
}
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 (0-2147483647) for reproducible results. Omit for a random seed.
videostringbắt buộcThe URL of the input video to edit.
imagesarrayReference images to guide the video editing.
promptstringbắt buộcThe editing instruction describing what changes to make.
Mặc định: ""
durationintegerOutput video duration in seconds. 0 means match input video duration. When set (2-10), truncates from the start.
Mặc định: 0
Giá trị có thể dùng: 0, 2, 3, 4, 5, 6, 7, 8, 9, 10
resolutionstringThe resolution of the output video.
Mặc định: "720p"
Giá trị có thể dùng: "720p", "1080p"
audio_settingstringAudio handling. 'auto': model decides whether to regenerate audio. 'origin': preserve original audio from input video.
Mặc định: "auto"
Giá trị có thể dùng: "auto", "origin"
{
"model": "alibaba/wan/2.7/video-edit",
"duration": 0,
"resolution": "720p",
"audio_setting": "auto"
}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/4f56fc5e6f0961e6af9e.jpg",
"source": "Alibaba Cloud",
"source_url": "https://www.alibabacloud.com/help/en/model-studio/wan-video-editing-guide",
"url": "https://static.sandbase.ai/examples/d2517981-e23d-4629-a811-791107b46f0d/output/19789c99-8591-4882-a1d4-25574df39dec.mp4"
}
]