Skip to main content
POST
/
vendors
/
alibaba
/
v1
/
wan2.1-kf2v-plus
/
generation
Create Generation Task
curl --request POST \
  --url https://api.mulerouter.ai/vendors/alibaba/v1/wan2.1-kf2v-plus/generation \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "prompt": "<string>",
  "image": "<string>",
  "last_frame": "<string>",
  "negative_prompt": "<string>",
  "template": "<string>",
  "resolution": "720P",
  "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 generation models. Please refer to Alibaba Cloud’s official documentation for more details.

Overview

Generate videos from first and last frame keyframes using the wan2.1-kf2v-plus model. This model creates smooth interpolation between two keyframe images.

Key Features

  • Keyframe-to-video interpolation
  • First and last frame specification (required)
  • 720P resolution
  • Fixed 5s duration
  • 30fps output

Image Requirements

PropertyRequirement
FormatsJPEG, JPG, PNG (no transparency), BMP, WEBP
Dimensions[360, 2000] pixels for both width and height
File SizeMax 10MB
InputPublic URL or Base64 encoded data

Example Requests

Basic Keyframe Interpolation

{
  "prompt": "A black cat looks curiously at the sky, camera gradually rises from eye-level to overhead",
  "image": "https://example.com/first_frame.jpg",
  "last_frame": "https://example.com/last_frame.jpg",
  "resolution": "720P",
  "duration": 5
}

With Negative Prompt

{
  "prompt": "Character starts walking, motion is smooth and natural",
  "image": "https://example.com/start.jpg",
  "last_frame": "https://example.com/end.jpg",
  "negative_prompt": "shaking, distortion",
  "resolution": "720P",
  "duration": 5
}

With Video Effect Template

{
  "prompt": "Scene transitions with special effects",
  "image": "https://example.com/keyframe1.jpg",
  "last_frame": "https://example.com/keyframe2.jpg",
  "template": "flying",
  "resolution": "720P"
}

Prompt Tips

For best results when describing keyframe interpolation:
  • Describe the transition between first and last frame
  • Specify motion direction and camera movement
  • Include timing cues if needed

Authorizations

Authorization
string
header
required

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

Body

application/json
prompt
string
required

Transition and motion description between the first and last frame (max 800 characters).

Maximum string length: 800
image
string
required

First keyframe image (URL or Base64). Supported formats: JPEG/JPG/PNG/BMP/WEBP, 360-2000px, ≤10MB.

last_frame
string
required

Last keyframe image (URL or Base64). Same constraints as the first frame.

negative_prompt
string

Negative prompt describing unwanted content (max 500 characters).

Maximum string length: 500
template
string | null

Optional video effect template name.

resolution
enum<string>
default:720P

Output Resolution

Available options:
720P
duration
enum<integer>

Video duration in seconds (30 fps). Fixed at 5 seconds.

Available options:
5
prompt_extend
boolean
default:true

Enable intelligent prompt rewriting.

seed
integer

Random seed [0, 2147483647].

Required range: 0 <= x <= 2147483647

Response

202 - application/json

Accepted - Task created successfully

task_info
object