Skip to main content
POST
/
vendors
/
alibaba
/
v1
/
wan2.1-vace-plus
/
generation
Create Generation Task
curl --request POST \
  --url https://api.mulerouter.ai/vendors/alibaba/v1/wan2.1-vace-plus/generation \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "model": "wan2.1-vace-plus",
  "function": "image_reference",
  "prompt": "<string>",
  "ref_images_url": [
    "<string>"
  ],
  "negative_prompt": "<string>",
  "obj_or_bg": [
    "obj"
  ],
  "size": "1280*720",
  "duration": 5,
  "prompt_extend": true,
  "seed": 1073741823
}
'
{
  "task_info": {
    "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
    "status": "pending",
    "created_at": "2023-11-07T05:31:56Z",
    "updated_at": "2023-11-07T05:31:56Z"
  }
}
This API supports Alibaba Tongyi Wanxiang (Wan2) video editing models. Please refer to Alibaba Cloud’s official documentation for more details.

Overview

Edit videos using the wan2.1-vace-plus model with multi-modal inputs. This model supports multiple video editing functions.

Supported Functions

FunctionDescription
image_referenceGenerate videos from 1-3 reference images
video_repaintingRepaint/restyle an existing video
video_editLocal (masked) editing of video regions
video_extensionExtend video with new content
video_outpaintingExpand video canvas in any direction

Example Requests

Multi-image Reference

{
  "function": "image_reference",
  "prompt": "A cat playing in the garden",
  "ref_images_url": [
    "https://example.com/cat.jpg",
    "https://example.com/garden.jpg"
  ],
  "obj_or_bg": ["obj", "bg"],
  "size": "1280*720",
  "duration": 5
}

Video Repainting

{
  "function": "video_repainting",
  "prompt": "Transform the scene into a cyberpunk style",
  "video_url": "https://example.com/source.mp4",
  "control_condition": "depth",
  "strength": 0.8
}

Local Editing

{
  "function": "video_edit",
  "prompt": "Replace the background with a beach sunset",
  "video_url": "https://example.com/source.mp4",
  "mask_image_url": "https://example.com/mask.png",
  "mask_type": "tracking"
}

Video Extension

{
  "function": "video_extension",
  "prompt": "Continue the scene with the character walking forward",
  "first_clip_url": "https://example.com/clip.mp4",
  "duration": 5
}

Video Outpainting

{
  "function": "video_outpainting",
  "prompt": "Expand to show more of the surrounding environment",
  "video_url": "https://example.com/source.mp4",
  "top_scale": 1.5,
  "left_scale": 1.3,
  "right_scale": 1.3
}

Function Details

image_reference

  • Required: ref_images_url (1-3 images)
  • Required when multiple images: obj_or_bg array
  • Output: 720P resolution, 5s duration

video_repainting

  • Required: video_url, control_condition
  • Control conditions: posebodyface, posebody, depth, scribble
  • Strength: 0.0-1.0 (default 1.0)

video_edit

  • Required: video_url
  • Mask options: mask_image_url or mask_video_url
  • Mask types: tracking (follows motion), fixed (static)

video_extension

  • Required: prompt
  • Optional: first_frame_url, last_frame_url, first_clip_url, last_clip_url
  • With guidance video: requires control_condition

video_outpainting

  • Required: video_url
  • Scale options: top_scale, bottom_scale, left_scale, right_scale (1.0-2.0)

Video Requirements

PropertyRequirement
FormatMP4
Max size50MB
Min FPS16
Max duration5s

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json

wan2.1-vace-plus video editing entry point. Select a function and supply the parameters supported by that function.

model
enum<string>
required

Model name (only wan2.1-vace-plus is supported)

Available options:
wan2.1-vace-plus
function
enum<string>
required

Multi-image reference feature selector.

Available options:
image_reference
Allowed value: "image_reference"
prompt
string
required

Text description for the synthesized video (max 800 characters).

Maximum string length: 800
ref_images_url
string<uri>[]
required

Public URLs for 1-3 reference images (JPG/JPEG/PNG/BMP/TIFF/WEBP, 360-2000px, ≤10MB, ASCII URL). Required.

Required array length: 1 - 3 elements
negative_prompt
string

Negative prompt (max 500 characters).

Maximum string length: 500
obj_or_bg
enum<string>[]

Matches ref_images_url to label each image as entity ("obj") or background ("bg"). Required when multiple images are supplied; defaults to ["obj"] for a single image.

Available options:
obj,
bg
size
enum<string>
default:1280*720

Output resolution ("width*height"). Supported: 1280*720 (default), 720*1280, 960*960, 832*1088, 1088*832.

Available options:
1280*720,
720*1280,
960*960,
832*1088,
1088*832
duration
enum<integer> | null

Output duration (seconds). Fixed at 5.

Available options:
5
prompt_extend
boolean
default:true

Enable intelligent prompt rewriting (default true).

seed
integer

Random seed [0, 2147483647].

Required range: 0 <= x <= 2147483647

Response

202 - application/json

Accepted - Task created successfully

task_info
object