Skip to content
Halaman ini belum tersedia dalam bahasa anda, jadi kandungannya dipaparkan dalam bahasa Inggeris.

Wan2.7-VideoEdit Video Editing

Alibaba Cloud Wanxiang 2.7 video editing model

Semua dokumentasi
POST/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

Contoh permintaan

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

Authorizationstringrequired

All 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:

text
Authorization: Bearer YOUR_API_KEY

Request Parameters

modelstringrequired

Video generation model name, fixed as wan2.7-videoedit

nsfw_checkbooleandefault: false

Whether to run content moderation before submitting the video task.

  • true: use omni-moderation-latest to review prompts and input images
  • false or omitted: do not send a moderation request, adding no moderation cost or latency (default)
video_urlsarray\required

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
promptstring

Editing 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_promptstring

Negative 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: 1080P

Output video resolution

Options:

  • 720P - Standard
  • 1080P - High definition (default)
durationintegerdefault: 0

Output 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 video

The specified duration cannot exceed the duration of the original video_urls video

sizestring

Output aspect ratio

Supported formats:

  • 16:9 - Landscape widescreen
  • 9:16 - Portrait
  • 1:1 - Square
  • 4:3 - Landscape
  • 3:4 - Portrait

Note

If omitted, the aspect ratio matches the input video

prompt_extendbooleandefault: true

Whether to enable intelligent prompt rewriting

Significantly improves results for short prompts, but increases processing time

Default: true

watermarkbooleandefault: false

Whether to add "AI Generated" watermark to the generated video

  • true: add watermark
  • false: no watermark (default)
seedinteger

Seed 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
metadataobject

Additional parameter object

metadata fields

audio_settingstringdefault: auto

Audio handling mode:

  • auto (default): AI automatically regenerates matching audio based on the edited video content
  • origin: force keep the original video audio, suitable for videos with important background sounds/dialogue

Response

codeinteger

Response status code, 200 on success

dataarray

Response data array

Array Elements

statusstring

Task status, submitted when initially submitted

task_idstring

Unique task identifier

Use Cases

Case 1: Basic Video Editing (Simplest)

json
{
  "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)

json
{
  "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:

json
{
  "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

json
{
  "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_settingDescriptionSuitable Scenarios
auto (default)AI regenerates matching audio based on the edited video contentMajor visual style changes where you want audio to update accordingly
originForce keep the original video audio trackVideos with important background music or dialogue

Note

Query Task Results

Video generation is an async task that returns a task_id upon submission. Use the Get Task Status endpoint to query generation progress and results.

Respons

{
  "code": 200,
  "data": [
    {
      "status": "submitted",
      "task_id": "task_01J9HA7JPQ9A0Z6JZ3V8M9W6PZ"
    }
  ]
}

Menemui masalah dalam dokumentasi ini? E-mel support@apisea.ai.