Skip to content

Video Editing 2.7

The Wanxiang video editing model supports editing operations on input videos, such as adding, deleting, or modifying content, replacing backgrounds, converting styles, and replicating actions, effects, or camera movements. It offers the following two methods:

  • Instruction-based editing: Modify video content using text instructions, such as replacing character clothing, changing scene elements, or adjusting the visual style.

  • Instruction and reference image editing: In addition to instructions, you can pass a reference image to apply elements from the image, such as characters, clothing, or props, to the video.

Note

For video editing, especially for replicating actions, camera movements, or effects from a specific video, use Video Editing 2.7 . For video continuation capabilities, use Wanxiang Image-to-Video 2.7.

Getting started

Input prompt and reference imageInput video (effects video)Output video
Apply the special effects from the reference video to the long-haired woman in the image. The scene is a party.视频地址视频地址

Before making a call, obtain an API key and then configure the API key as an environment variable. To make calls using a software development kit (SDK), install the DashScope SDK.

Python SDK

Important

Make sure that the DashScope SDK for Python version is not earlier than 1.25.16 before you run the following code.

An outdated version may trigger errors such as "url error, please check url!". For more information, see Install the SDK to update.

HELPCODEESCAPE-python

from http import HTTPStatus
from dashscope import VideoSynthesis
import dashscope
import os

# The following is the URL for the Singapore region. URLs vary by region. For more information, see https://www.alibabacloud.com/help/en/model-studio/wan-video-editing-api-reference
dashscope.base_http_api_url = 'https://dashscope-intl.aliyuncs.com/api/v1'

# If the environment variable is not set, replace the following line with your Model Studio API key: api_key="sk-xxx"
# API keys vary by region. For more information, see https://www.alibabacloud.com/help/en/model-studio/get-api-key
api_key = os.getenv("DASHSCOPE_API_KEY")

media = [
    {
        "type": "video",
        "url": "https://help-static-aliyun-doc.aliyuncs.com/file-manage-files/zh-CN/20260409/eclvbm/21_refined.mp4"
    },
    {
        "type": "reference_image",
        "url": "https://help-static-aliyun-doc.aliyuncs.com/file-manage-files/zh-CN/20260409/jgekix/wan2.7-videoedit-demo.webp"
    }
]

def sample_sync_call():
    print('----sync call, please wait a moment----')
    rsp = VideoSynthesis.call(
        api_key=api_key,
        model="wan2.7-videoedit",
        media=media,
        resolution="720P",
        prompt_extend=True,
        watermark=True,
        prompt="Apply the special effects from the reference video to the long-haired woman in the image. The scene is a party.",
    )
    print(rsp)
    if rsp.status_code == HTTPStatus.OK:
        print(rsp.output.video_url)
    else:
        print('Failed, status_code: %s, code: %s, message: %s' %
              (rsp.status_code, rsp.code, rsp.message))


if __name__ == '__main__':
    sample_sync_call()

Java SDK

Important

Make sure that the DashScope Java SDK version is not earlier than 2.22.14 before you run the following code.

An outdated version may trigger errors such as "url error, please check url!". For more information, see Install the SDK to update.

HELPCODEESCAPE-java
// Copyright (c) Alibaba, Inc. and its affiliates.

import com.alibaba.dashscope.aigc.videosynthesis.VideoSynthesis;
import com.alibaba.dashscope.aigc.videosynthesis.VideoSynthesisParam;
import com.alibaba.dashscope.aigc.videosynthesis.VideoSynthesisResult;
import com.alibaba.dashscope.exception.ApiException;
import com.alibaba.dashscope.exception.InputRequiredException;
import com.alibaba.dashscope.exception.NoApiKeyException;
import com.alibaba.dashscope.utils.Constants;
import com.alibaba.dashscope.utils.JsonUtils;

import java.util.ArrayList;
import java.util.List;

public class VideoEdit {

    static {
        // The following is the URL for the Singapore region. If you are using a model in the China (Beijing) region, replace the URL with: https://dashscope.aliyuncs.com/api/v1
        Constants.baseHttpApiUrl = "https://dashscope-intl.aliyuncs.com/api/v1";
    }

    // If the environment variable is not set, replace the following line with your Model Studio API key: apiKey="sk-xxx"
    // API keys vary by region. For more information, see https://www.alibabacloud.com/help/en/model-studio/get-api-key
    static String apiKey = System.getenv("DASHSCOPE_API_KEY");

    public static void syncCall() {
        VideoSynthesis videoSynthesis = new VideoSynthesis();
        final String prompt = "Apply the special effects from the reference video to the long-haired woman in the image. The scene is a party.";
        List<VideoSynthesisParam.Media> media = new ArrayList<VideoSynthesisParam.Media>(){​{
            add(VideoSynthesisParam.Media.builder()
                    .url("https://help-static-aliyun-doc.aliyuncs.com/file-manage-files/zh-CN/20260409/eclvbm/21_refined.mp4")
                    .type("video")
                    .build());
            add(VideoSynthesisParam.Media.builder()
                    .url("https://help-static-aliyun-doc.aliyuncs.com/file-manage-files/zh-CN/20260409/jgekix/wan2.7-videoedit-demo.webp")
                    .type("reference_image")
                    .build());
        }​};
        VideoSynthesisParam param =
                VideoSynthesisParam.builder()
                        .apiKey(apiKey)
                        .model("wan2.7-videoedit")
                        .prompt(prompt)
                        .media(media)
                        .resolution("720P")
                        .promptExtend(true)
                        .watermark(true)
                        .build();
        VideoSynthesisResult result = null;
        try {
            System.out.println("---sync call, please wait a moment----");
            result = videoSynthesis.call(param);
        } catch (ApiException | NoApiKeyException e){
            throw new RuntimeException(e.getMessage());
        } catch (InputRequiredException e) {
            throw new RuntimeException(e);
        }
        System.out.println(JsonUtils.toJson(result));
    }

    public static void main(String[] args) {
        syncCall();
    }
}

curl

Step 1: Create a task to obtain a task ID

HELPCODEESCAPE-curl
curl --location 'https://dashscope-intl.aliyuncs.com/api/v1/services/aigc/video-generation/video-synthesis' \
    -H 'X-DashScope-Async: enable' \
    -H "Authorization: Bearer $DASHSCOPE_API_KEY" \
    -H 'Content-Type: application/json' \
    -d '{
    "model": "wan2.7-videoedit",
    "input": {
        "prompt": "Apply the special effects from the reference video to the long-haired woman in the image. The scene is a party.",
        "media": [
            {
                "type": "video",
                "url": "https://help-static-aliyun-doc.aliyuncs.com/file-manage-files/zh-CN/20260409/eclvbm/21_refined.mp4"
            },
            {
                "type": "reference_image",
                "url": "https://help-static-aliyun-doc.aliyuncs.com/file-manage-files/zh-CN/20260409/jgekix/wan2.7-videoedit-demo.webp"
            }
        ]
    },
    "parameters": {
        "resolution": "720P",
        "prompt_extend": true,
        "watermark": true
    }
}'

Step 2: Retrieve the result based on the task ID Replace {task_id} with the task_id value returned by the previous API call. The task_id is valid for queries for 24 hours.

HELPCODEESCAPE-curl
curl -X GET https://dashscope-intl.aliyuncs.com/api/v1/tasks/{task_id} \
--header "Authorization: Bearer $DASHSCOPE_API_KEY"

Sample output

video_url is valid for 24 hours. Download the video promptly.

HELPCODEESCAPE-json
{
    "request_id": "c1209113-8437-424f-a386-xxxxxx",
    "output": {
        "task_id": "966cebcd-dedc-4962-af88-xxxxxx",
        "task_status": "SUCCEEDED",
        "video_url": "https://dashscope-result-sh.oss-accelerate.aliyuncs.com/xxx.mp4?Expires=xxx",
         ...
    },
    ...
}

Scope

Supported models vary by region, and resources are isolated. When making a call, ensure that the model, Endpoint URL, and API Key all belong to the same region. Cross-region calls will fail.

Supported models:

International

When the service deployment scope is International, model inference compute resources are dynamically scheduled globally (excluding the Chinese mainland). Static data is stored in your selected region. The supported region for this deployment scope is Singapore.

ModelFeaturesInput modalityOutput video specifications
wan2.7-videoeditVideo with audio, silent video (depends on the input video) Instruction-based editing, video migrationText, image, videoResolution options: 720P, 1080P Video duration: [2s, 10s] (integer) Defined specifications: 30 fps, MP4 (H.264 encoding)

The Chinese mainland

When the service deployment scope is the Chinese mainland, model inference compute resources are limited to the Chinese mainland. Static data is stored in your selected region. The supported region for this deployment scope is China (Beijing).

ModelFeaturesInput modalityOutput video specifications
wan2.7-videoeditVideo with audio, silent video (depends on the input video) Instruction-based editing, video migrationText, image, videoResolution options: 720P, 1080P Video duration: [2s, 10s] (integer) Defined specifications: 30 fps, MP4 (H.264 encoding)

Note

The sample code in this topic applies to the Singapore region.

Core capabilities

Instruction-only editing

Supported model : wan2.7-videoedit.

Feature introduction: This feature modifies video content based on an input video and a text prompt. It is suitable for scenarios such as style conversion, action modification, and camera movement adjustments.

Parameter settings:

  • media: Specifies the video to be edited (type=video). You do not need to provide a reference image.

  • prompt: Describe the editing intent, such as "Change the video to an 8-bit pixel style".

Input promptInput videoOutput video
Change the video to an 8-bit pixel style视频地址视频地址

Python SDK

Important

Make sure that the DashScope SDK for Python version is not earlier than 1.25.16 before you run the following code.

An outdated version may trigger errors such as "url error, please check url!". For more information, see Install the SDK to update.

HELPCODEESCAPE-python
# -*- coding: utf-8 -*-
from http import HTTPStatus
from dashscope import VideoSynthesis
import dashscope
import os

# The following is the URL for the Singapore region. URLs vary by region. For more information, see https://www.alibabacloud.com/help/en/model-studio/wan-video-editing-api-reference
dashscope.base_http_api_url = 'https://dashscope-intl.aliyuncs.com/api/v1'

# If the environment variable is not set, replace the following line with your Model Studio API key: api_key="sk-xxx"
# API keys vary by region. For more information, see https://www.alibabacloud.com/help/en/model-studio/get-api-key
api_key = os.getenv("DASHSCOPE_API_KEY")

media = [
    {
        "type": "video",
        "url": "https://help-static-aliyun-doc.aliyuncs.com/file-manage-files/zh-CN/20260402/ldnfdf/wan2.7-videoedit-style-change.mp4"
    }
]

def sample_sync_call():
    print('----sync call, please wait a moment----')
    rsp = VideoSynthesis.call(
        api_key=api_key,
        model="wan2.7-videoedit",
        media=media,
        resolution="720P",
        prompt_extend=True,
        watermark=True,
        prompt="Convert the entire frame to a claymation style",
    )
    if rsp.status_code == HTTPStatus.OK:
        print(rsp.output.video_url)
    else:
        print('Failed, status_code: %s, code: %s, message: %s' %
              (rsp.status_code, rsp.code, rsp.message))


if __name__ == '__main__':
    sample_sync_call()

Java SDK

Important

Make sure that your DashScope Java SDK version is not earlier than 2.22.14 before you run the following code.

An outdated version may trigger errors such as "url error, please check url!". For more information, see Install the SDK to update.

HELPCODEESCAPE-java
// Copyright (c) Alibaba, Inc. and its affiliates.

import com.alibaba.dashscope.aigc.videosynthesis.VideoSynthesis;
import com.alibaba.dashscope.aigc.videosynthesis.VideoSynthesisParam;
import com.alibaba.dashscope.aigc.videosynthesis.VideoSynthesisResult;
import com.alibaba.dashscope.exception.ApiException;
import com.alibaba.dashscope.exception.InputRequiredException;
import com.alibaba.dashscope.exception.NoApiKeyException;
import com.alibaba.dashscope.utils.Constants;
import com.alibaba.dashscope.utils.JsonUtils;

import java.util.ArrayList;
import java.util.List;

public class VideoEdit {

    static {
        // The following is the URL for the Singapore region. If you are using a model in the China (Beijing) region, replace the URL with: https://dashscope.aliyuncs.com/api/v1
        Constants.baseHttpApiUrl = "https://dashscope-intl.aliyuncs.com/api/v1";
    }

    // If the environment variable is not set, replace the following line with your Model Studio API key: apiKey="sk-xxx"
    // API keys vary by region. For more information, see https://www.alibabacloud.com/help/en/model-studio/get-api-key
    static String apiKey = System.getenv("DASHSCOPE_API_KEY");

    public static void syncCall() {
        VideoSynthesis videoSynthesis = new VideoSynthesis();
        final String prompt = "Convert the entire frame to a claymation style";
        List<VideoSynthesisParam.Media> media = new ArrayList<VideoSynthesisParam.Media>(){​{
            add(VideoSynthesisParam.Media.builder()
                    .url("https://help-static-aliyun-doc.aliyuncs.com/file-manage-files/zh-CN/20260402/ldnfdf/wan2.7-videoedit-style-change.mp4")
                    .type("video")
                    .build());
        }​};
        VideoSynthesisParam param =
                VideoSynthesisParam.builder()
                        .apiKey(apiKey)
                        .model("wan2.7-videoedit")
                        .prompt(prompt)
                        .media(media)
                        .resolution("720P")
                        .promptExtend(true)
                        .watermark(true)
                        .build();
        VideoSynthesisResult result = null;
        try {
            System.out.println("---sync call, please wait a moment----");
            result = videoSynthesis.call(param);
        } catch (ApiException | NoApiKeyException e){
            throw new RuntimeException(e.getMessage());
        } catch (InputRequiredException e) {
            throw new RuntimeException(e);
        }
        System.out.println(JsonUtils.toJson(result));
    }

    public static void main(String[] args) {
        syncCall();
    }
}

curl

Step 1: Create a task to obtain a task ID

HELPCODEESCAPE-curl
curl --location 'https://dashscope-intl.aliyuncs.com/api/v1/services/aigc/video-generation/video-synthesis' \
    -H 'X-DashScope-Async: enable' \
    -H "Authorization: Bearer $DASHSCOPE_API_KEY" \
    -H 'Content-Type: application/json' \
    -d '{
    "model": "wan2.7-videoedit",
    "input": {
        "prompt": "Change the video to an 8-bit pixel style",
        "media": [
            {
                "type": "video",
                "url": "https://help-static-aliyun-doc.aliyuncs.com/file-manage-files/en-US/20260409/rkjvku/1.mp4"
            }
        ]
    },
    "parameters": {
        "resolution": "720P",
        "prompt_extend": true,
        "watermark": true
    }
}'

Step 2: Retrieve the result based on the task ID Replace {task_id} with the task_id value returned by the previous API call. The task_id is valid for queries for 24 hours.

HELPCODEESCAPE-curl
curl -X GET https://dashscope-intl.aliyuncs.com/api/v1/tasks/{task_id} \
--header "Authorization: Bearer $DASHSCOPE_API_KEY"

Instruction and reference image editing

Supported model : wan2.7-videoedit.

Feature introduction: This feature applies elements from a reference image, such as clothing or props, to a video based on a text prompt.

Parameter settings:

  • media: Specifies the video to be edited (type=video) and a reference image (type=reference_image). You can provide up to four reference images.

  • prompt: Describe the editing intent, such as "Make the horse-headed character in the video wear the striped sweater from the image".

Input prompt and reference imageInput videoOutput video
Make the horse-headed character in the video wear the striped sweater from the image视频地址视频地址

Python SDK

Important

Make sure that the DashScope SDK for Python version is not earlier than 1.25.16 before you run the following code.

An outdated version may trigger errors such as "url error, please check url!". For more information, see Install the SDK to update.

HELPCODEESCAPE-python
# -*- coding: utf-8 -*-
from http import HTTPStatus
from dashscope import VideoSynthesis
import dashscope
import os

# The following is the URL for the Singapore region. URLs vary by region. For more information, see https://www.alibabacloud.com/help/en/model-studio/wan-video-editing-api-reference
dashscope.base_http_api_url = 'https://dashscope-intl.aliyuncs.com/api/v1'

# If the environment variable is not set, replace the following line with your Model Studio API key: api_key="sk-xxx"
# API keys vary by region. For more information, see https://www.alibabacloud.com/help/en/model-studio/get-api-key
api_key = os.getenv("DASHSCOPE_API_KEY")

media = [
    {
        "type": "video",
        "url": "https://help-static-aliyun-doc.aliyuncs.com/file-manage-files/zh-CN/20260403/nlspwm/T2VA_22.mp4"
    },
    {
        "type": "reference_image",
        "url": "https://help-static-aliyun-doc.aliyuncs.com/file-manage-files/zh-CN/20260402/fwjpqf/wan2.7-videoedit-change-clothes.png"
    }
]

def sample_sync_call():
    print('----sync call, please wait a moment----')
    rsp = VideoSynthesis.call(
        api_key=api_key,
        model="wan2.7-videoedit",
        media=media,
        resolution="720P",
        prompt_extend=True,
        watermark=True,
        prompt="Replace the girl's clothes in the video with the clothes from the image",
    )
    if rsp.status_code == HTTPStatus.OK:
        print(rsp.output.video_url)
    else:
        print('Failed, status_code: %s, code: %s, message: %s' %
              (rsp.status_code, rsp.code, rsp.message))


if __name__ == '__main__':
    sample_sync_call()

Java SDK

Important

Make sure that the DashScope Java SDK version is not earlier than 2.22.14 before you run the following code.

An outdated version may trigger errors such as "url error, please check url!". For more information, see Install the SDK to update.

HELPCODEESCAPE-java
// Copyright (c) Alibaba, Inc. and its affiliates.

import com.alibaba.dashscope.aigc.videosynthesis.VideoSynthesis;
import com.alibaba.dashscope.aigc.videosynthesis.VideoSynthesisParam;
import com.alibaba.dashscope.aigc.videosynthesis.VideoSynthesisResult;
import com.alibaba.dashscope.exception.ApiException;
import com.alibaba.dashscope.exception.InputRequiredException;
import com.alibaba.dashscope.exception.NoApiKeyException;
import com.alibaba.dashscope.utils.Constants;
import com.alibaba.dashscope.utils.JsonUtils;

import java.util.ArrayList;
import java.util.List;

public class VideoEdit {

    static {
        // The following is the URL for the Singapore region. If you are using a model in the China (Beijing) region, replace the URL with: https://dashscope.aliyuncs.com/api/v1
        Constants.baseHttpApiUrl = "https://dashscope-intl.aliyuncs.com/api/v1";
    }

    // If the environment variable is not set, replace the following line with your Model Studio API key: apiKey="sk-xxx"
    // API keys vary by region. For more information, see https://www.alibabacloud.com/help/en/model-studio/get-api-key
    static String apiKey = System.getenv("DASHSCOPE_API_KEY");

    public static void syncCall() {
        VideoSynthesis videoSynthesis = new VideoSynthesis();
        final String prompt = "Replace the girl's clothes in the video with the clothes from the image";
        List<VideoSynthesisParam.Media> media = new ArrayList<VideoSynthesisParam.Media>(){​{
            add(VideoSynthesisParam.Media.builder()
                    .url("https://help-static-aliyun-doc.aliyuncs.com/file-manage-files/zh-CN/20260403/nlspwm/T2VA_22.mp4")
                    .type("video")
                    .build());
            add(VideoSynthesisParam.Media.builder()
                    .url("https://help-static-aliyun-doc.aliyuncs.com/file-manage-files/zh-CN/20260402/fwjpqf/wan2.7-videoedit-change-clothes.png")
                    .type("reference_image")
                    .build());
        }​};
        VideoSynthesisParam param =
                VideoSynthesisParam.builder()
                        .apiKey(apiKey)
                        .model("wan2.7-videoedit")
                        .prompt(prompt)
                        .media(media)
                        .resolution("720P")
                        .promptExtend(true)
                        .watermark(true)
                        .build();
        VideoSynthesisResult result = null;
        try {
            System.out.println("---sync call, please wait a moment----");
            result = videoSynthesis.call(param);
        } catch (ApiException | NoApiKeyException e){
            throw new RuntimeException(e.getMessage());
        } catch (InputRequiredException e) {
            throw new RuntimeException(e);
        }
        System.out.println(JsonUtils.toJson(result));
    }

    public static void main(String[] args) {
        syncCall();
    }
}

curl

Step 1: Create a task to obtain a task ID

HELPCODEESCAPE-curl
curl --location 'https://dashscope-intl.aliyuncs.com/api/v1/services/aigc/video-generation/video-synthesis' \
    -H 'X-DashScope-Async: enable' \
    -H "Authorization: Bearer $DASHSCOPE_API_KEY" \
    -H 'Content-Type: application/json' \
    -d '{
    "model": "wan2.7-videoedit",
    "input": {
        "prompt": "Make the horse-headed character in the video wear the striped sweater from the image",
        "media": [
            {
                "type": "video",
                "url": "https://help-static-aliyun-doc.aliyuncs.com/file-manage-files/zh-CN/20260409/dozxak/Wan_Video_Edit_33_1.mp4"
            },
            {
                "type": "reference_image",
                "url": "https://help-static-aliyun-doc.aliyuncs.com/file-manage-files/zh-CN/20260415/hynnff/wan-video-edit-clothes.webp"
            }
        ]
    },
    "parameters": {
        "resolution": "720P",
        "prompt_extend": true,
        "watermark": true
    }
}'

Step 2: Retrieve the result based on the task ID Replace {task_id} with the task_id value returned by the previous API call. The task_id is valid for queries for 24 hours.

HELPCODEESCAPE-curl
curl -X GET https://dashscope-intl.aliyuncs.com/api/v1/tasks/{task_id} \
--header "Authorization: Bearer $DASHSCOPE_API_KEY"

Scenarios and examples

Add, delete, or modify elements

Add, delete, or replace specific elements within a video.

TypeInput prompt and reference imageInput videoOutput video
AddAdd a black square piece of chocolate to the cup视频地址视频地址
DeleteRemove the train from the video. Keep everything else the same.视频地址视频地址
ModifyReplace the film in the video with the plate from the image视频地址视频地址
ModifyMake the horse man in the video wear the striped sweater from the image视频地址视频地址
ModifyChange the cat to a dog视频地址视频地址

Modify the environment or background

Use instructions to change the lighting conditions, seasonal colors, or geographical space of a video. You can also change the video background to transport objects to any space.

TypeInput promptInput videoOutput video
Modify seasonChange the background season to a snowy winter, with snow covering the trees. Keep the river the same.视频地址视频地址
Modify weatherKeep the character's actions the same, but change the entire scene from the current cloudy day to a sunny day. Keep everything else the same.视频地址视频地址
Modify lighting and shadowKeep everything else the same. Change the overall light color and filter of the frame from white to a warm tone. Maintain the details of the character's skin tone to create a harmonious look between the character and the background.视频地址视频地址
Modify backgroundKeep the main woman's actions the same, but change the video background to a gym.视频地址视频地址

Modify the video style

Quickly convert existing videos into various artistic styles, such as animation, 3D, claymation, or yarn.

TypeInput promptInput videoOutput video
Modify styleVideo-to-Image: C4D Cartoon Style视频地址视频地址
Modify styleConvert the entire frame to a live-action movie style视频地址视频地址
Modify styleConvert the entire frame to a watercolor painting style视频地址视频地址

Modify character behavior, lines, or camera work

For existing or generated video content, you can use instructions to modify the plot, such as character behavior or dialogue, and adjust camera work for further creative editing.

TypeInput promptInput videoOutput video
Modify character behaviorMake the man in the video take a spoonful of soup and drink it. Keep everything else the same.视频地址视频地址
Modify character emotionThe girl's expression in the frame becomes sad and she starts to cry. Keep everything else the same.视频地址视频地址
Modify character linesKeep 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"视频地址视频地址
Modify camera workChange the camera movement to a clockwise orbit around the character, with the character following the camera's movement.视频地址视频地址
Modify camera workChange the video's camera movement to a tilt-up while simultaneously looking down.视频地址视频地址

Replicate actions, camera movements, or effects

Replicate the action sequences, camera trajectories, and visual effects of a reference video to generate a video with consistent dynamic features.

TypeInput prompt or reference imageInput videoOutput video
Replicate single-person actionMake the person in the image imitate the actions of the person in the video.视频地址视频地址
Replicate multi-person actionReference the actions of the five people in the video, and change the scene to five people singing and playing instruments at a roadside stall in a city street.视频地址视频地址
Replicate camera movementReference the camera movement of the original video with fast camera motion. Change the scene to an awards ceremony, with the woman from the reference image walking the red carpet.视频地址视频地址
Replicate effectsReference the special effects of the video and apply them to the woman in the image, with the scene set on a street.视频地址视频地址

How to input videos and images

Input video

  • Video quantity: Required. Exactly one.

  • Input method:

Input reference image

  • Image quantity: Optional. Up to four.

  • Input method:

    • Public URL: Supports HTTP or HTTPS protocols. Example: https://xxxx/xxx.png.

    • Base64-encoded string: Example: data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAABDg...... (Example truncated for demonstration purposes).

      • Format: data:{MIME_type};base64,{base64_data}, where:

        • {base64_data}: The Base64-encoded string of the image file.

        • {MIME_type}: The media type of the image, which must correspond to the file format.

Image formatMIME Type
JPEGimage/jpeg
JPGimage/jpeg
PNGimage/png
BMPimage/bmp
WEBPimage/webp
  **Sample code**

  ```
  HELPCODEESCAPE-python
  import base64
  import mimetypes


  # Format is data:{MIME_type};base64,{base64_data}
  def encode_file(file_path):
      mime_type, _ = mimetypes.guess_type(file_path)
      if not mime_type or not mime_type.startswith("image/"):
          raise ValueError("Unsupported or unrecognized image format")
      with open(file_path, "rb") as image_file:
          encoded_string = base64.b64encode(image_file.read()).decode('utf-8')
      return f"data:{mime_type};base64,{encoded_string}"


  # Replace your_image.jpg with the actual image path
  base64_str = encode_file("your_image.jpg")
  print(base64_str)
  ```

Output video

  • Video quantity: 1.

  • Video specifications : The format is MP4. For more information, see Video specification scope.

  • Video URL validity : 24 hours.

  • Video dimensions : The resolution parameter specifies the video resolution, and the ratio parameter specifies the video aspect ratio.

Billing and rate limiting

  • For model free quotas and billing prices, see Model pricing.

  • For model rate limits, see Wanxiang series.

  • Billing description:

    • Input images are not billed. Input videos and output videos are billed by the second. The formula is: Total billable duration (seconds) = Input video duration (seconds) + Output video duration (seconds).

    • Failed model calls or processing errors do not incur any fees and do not consume the free quota for new users.

API documentation

Wanxiang Video Editing 2.7

FAQ

Q: What is the difference between Video Editing 2.7 (wan2.7-videoedit) and Video Editing 2.1 ( wan2.1-vace-plus**)?**

A: Video Editing 2.7 edits videos directly based on instructions, which is simpler to use and offers comprehensive upgrades. Video Editing 2.1 requires you to specify the function parameter and focuses on features such as local editing with masks and frame expansion. We recommend that you use Video Editing 2.7.

Q: How do I input multiple reference images?

A: You can add multiple objects with type=reference_image to the media array. You can add up to four reference images. Example:

HELPCODEESCAPE-json
{
    "media": [
        {"type": "video", "url": "<Input video URL>"},
        {"type": "reference_image", "url": "<Reference image 1 URL>"},
        {"type": "reference_image", "url": "<Reference image 2 URL>"},
        {"type": "reference_image", "url": "<Reference image 3 URL>"},
        {"type": "reference_image", "url": "<Reference image 4 URL>"}
    ]
}

Mirror of Alibaba Cloud Model Studio docs for reference and RAG. Not affiliated with Alibaba Cloud.