Skip to main content
POST
/
generate
/
bailian
/
wan2-keyframe-to-video
Tongyi Wanxiang Wan2 Keyframe to Video
curl --request POST \
  --url https://api.sinancode.com/v1/generate/bailian/wan2-keyframe-to-video \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "first_frame_url": "<string>",
  "last_frame_url": "<string>",
  "model": "wan2.2-kf2v-flash",
  "negative_prompt": "<string>",
  "prompt": "<string>",
  "prompt_extend": true,
  "resolution": "480P",
  "seed": 1073741823,
  "template": "<string>",
  "watermark": true
}
'
{
  "task_id": "01234567-89ab-cdef-0123-456789abcdef"
}
Generate smooth dynamic videos by providing just the first and last frame images using Alibaba Cloud’s Tongyi Wanxiang Keyframe-to-Video model. Key Features:
  • Keyframe Control - Precise control over video start and end frames
  • Smooth Transition - Automatically generate silky smooth intermediate frame animations
  • Multi-Resolution - Support 480P, 720P, 1080P output
  • Smart Rewrite - Support prompt intelligent rewriting for better results
  • Effect Templates - Support preset video effect templates

Authorizations

Authorization
string
header
required

Please use your API Token for authentication

Body

application/json

Task parameters

first_frame_url
string
required

First frame image URL (required) Supports public URL (HTTP/HTTPS) or Base64 encoding Image format: JPEG, JPG, PNG (no transparency), BMP, WEBP Image resolution: Width and height range [360, 2000] pixels File size: max 10MB Output video aspect ratio will be based on this image

last_frame_url
string

Last frame image URL (optional) Same requirements as first frame, resolution can differ from first frame Not required when using effects template (template)

model
enum<string>

Model name (optional, recommended to leave empty) When empty, uses the latest model version, future upgrades will apply automatically Current default: wan2.2-kf2v-flash

Available options:
wan2.2-kf2v-flash
negative_prompt
string

Negative prompt (optional, max 500 characters) Describe content you don't want to see in the video

Maximum string length: 500
prompt
string

Text prompt (optional, max 800 characters) Describe the elements and visual features you want in the generated video When first and last frames have significant subject/scene changes, describe the transition process (e.g., camera movement, subject motion)

Maximum string length: 800
prompt_extend
boolean

Whether to enable smart prompt rewriting (optional, default true) When enabled, uses a large model to intelligently rewrite the input prompt

resolution
enum<string>

Resolution tier (optional, default 720P) wan2.2-kf2v-flash: Available values 480P, 720P, 1080P

Available options:
480P,
720P,
1080P
seed
integer

Random seed (optional, range 0-2147483647)

Required range: 0 <= x <= 2147483647
template
string

Video effects template name (optional) When using this parameter, only first_frame_url is needed Different models support different effects templates

watermark
boolean

Whether to add watermark (optional, default false) Watermark is placed in the bottom-right corner with fixed text "AI Generated"

Response

OK

task_id
string
required

Task ID

Example:

"01234567-89ab-cdef-0123-456789abcdef"