Wan2.7-VideoEdit Video Editing
Alibaba Cloud Wanxiang 2.7 video editing model
所有文件/v1/videos/generations- AI editing based on existing videos: style transfer, content replacement, element addition
- Optionally accepts reference images to specify target style or appearance
- Supports keeping the original video duration or customizing the output duration
請求範例
curl --request POST \
--url https://api.apisea.ai/v1/videos/generations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"model": "wan2.7-videoedit",
"video_urls": ["https://cdn.example.com/original.mp4"],
"prompt": "Replace the background with a snowy mountain scene",
"resolution": "1080P"
}'Authorization
AuthorizationstringrequiredAll API endpoints require Bearer Token authentication
Get your API Key:
Visit the API Key Management Page to get your API Key
Add it to the request header:
Authorization: Bearer YOUR_API_KEYRequest Parameters
modelstringrequiredVideo generation model name, fixed as wan2.7-videoedit
nsfw_checkbooleandefault: falseWhether to run content moderation before submitting the video task.
true: useomni-moderation-latestto review prompts and input imagesfalseor omitted: do not send a moderation request, adding no moderation cost or latency (default)
video_urlsarray\Source video URL array for editing
Warning
Only the 1st video is used
Note
Video constraints:
- Format: mp4, mov
- Duration: 2–10s
- Resolution: width and height in the range [240, 4096] pixels
- Aspect ratio: 1:8 – 8:1
- File size: up to 100MB
promptstringEditing instruction describing the desired changes, up to 5000 characters
Note
If omitted, the model performs a default style transfer
Example: "Change the character's outfit to a red gown", "Replace the background with a snowy mountain scene"
negative_promptstringNegative prompt describing unwanted content, up to 500 characters
image_urlsarray\Reference image URL array, up to 4 images
Used to specify the target style or appearance (e.g., reference style for style transfer)
resolutionstringdefault: 1080POutput video resolution
Options:
720P- Standard1080P- High definition (default)
durationintegerdefault: 0Output video duration (seconds)
0(default): keep the full original video duration- Integer between
2-10: take the specified duration from the start
Note
When
duration=0, billing is based on the actual duration of the output videoThe specified duration cannot exceed the duration of the original
video_urlsvideo
sizestringOutput aspect ratio
Supported formats:
16:9- Landscape widescreen9:16- Portrait1:1- Square4:3- Landscape3:4- Portrait
Note
If omitted, the aspect ratio matches the input video
prompt_extendbooleandefault: trueWhether to enable intelligent prompt rewriting
Significantly improves results for short prompts, but increases processing time
Default: true
watermarkbooleandefault: falseWhether to add "AI Generated" watermark to the generated video
true: add watermarkfalse: no watermark (default)
seedintegerSeed integer used to control the randomness of generated content
Value range: integer ≥0
Note
- For identical requests, the model generates different results when receiving different seed values (e.g., omitting seed)
- For identical requests, the model generates similar results when receiving the same seed value, but exact consistency is not guaranteed
metadataobjectAdditional parameter object
metadata fields
audio_settingstringdefault: autoAudio handling mode:
auto(default): AI automatically regenerates matching audio based on the edited video contentorigin: force keep the original video audio, suitable for videos with important background sounds/dialogue
Response
codeintegerResponse status code, 200 on success
dataarrayResponse data array
Array Elements
statusstringTask status, submitted when initially submitted
task_idstringUnique task identifier
Use Cases
Case 1: Basic Video Editing (Simplest)
{
"model": "wan2.7-videoedit",
"video_urls": ["https://cdn.example.com/original.mp4"],
"prompt": "Replace the background with a snowy mountain scene"
}Case 2: Style Transfer (With Reference Image)
{
"model": "wan2.7-videoedit",
"prompt": "Transfer the video style to the anime style of the reference image",
"video_urls": ["https://cdn.example.com/original.mp4"],
"image_urls": [
"https://cdn.example.com/anime_style.jpg"
],
"resolution": "1080P",
"watermark": false
}Case 3: Keep Original Video Audio
Suitable for videos with important background sound or dialogue:
{
"model": "wan2.7-videoedit",
"video_urls": ["https://cdn.example.com/speech.mp4"],
"prompt": "Replace the background with a mountain path",
"metadata": { "audio_setting": "origin" }
}Case 4: Full Parameters
{
"model": "wan2.7-videoedit",
"prompt": "Change the character's outfit to a red gown",
"negative_prompt": "blurry, distorted",
"video_urls": ["https://cdn.example.com/original.mp4"],
"image_urls": ["https://cdn.example.com/reference.jpg"],
"resolution": "1080P",
"duration": 0,
"size": "16:9",
"prompt_extend": true,
"watermark": false,
"seed": 888,
"metadata": {
"audio_setting": "origin"
}
}Audio Handling
| audio_setting | Description | Suitable Scenarios |
|---|---|---|
auto (default) | AI regenerates matching audio based on the edited video content | Major visual style changes where you want audio to update accordingly |
origin | Force keep the original video audio track | Videos with important background music or dialogue |
Note
Query Task Results
Video generation is an async task that returns a
task_idupon submission. Use the Get Task Status endpoint to query generation progress and results.
回應
{
"code": 200,
"data": [
{
"status": "submitted",
"task_id": "task_01J9HA7JPQ9A0Z6JZ3V8M9W6PZ"
}
]
}發現文件有問題嗎?請寄信至 support@apisea.ai。