Wan Animate

Wan-Animate seamlessly animates characters and replaces subjects in videos, ensuring fluid realism and environmental consistency.

~398.13s
~$1.527
 1import requests
 2import json
 3
 4url = "https://api.segmind.com/v1/wan-animate"
 5headers = {
 6    "x-api-key": "YOUR_API_KEY",
 7    "Content-Type": "application/json"
 8}
 9
10data = {
11    "input_video": "https://segmind-resources.s3.amazonaws.com/input/e9f1b4cb-812d-43b4-9aaf-572bc01828d1-animate-1.mp4",
12    "reference_image": "https://segmind-resources.s3.amazonaws.com/input/7af018fd-d18a-4688-9afd-52df7510fe69-MarkuryFLUX_03641_.png",
13    "resolution": "480p",
14    "prompt": "woman posing for a selfie",
15    "seed": 987778,
16    "mode": "replace",
17    "base64": false
18}
19
20response = requests.post(url, headers=headers, json=data)
21
22if response.status_code == 200:
23    result = response.json()
24    print(json.dumps(result, indent=2))
25else:
26    print(f"Error: {response.status_code}")
27    print(response.text)

API Endpoint

POSThttps://api.segmind.com/v1/wan-animate

Parameters

input_videorequired
string (uri)

URL of the video to process. Use HD videos for high-quality outputs.

moderequired
string

'Animation' for animating image; 'Replace' for replacing video subject. Choose based on task requirement.

Default: "replace"
Allowed values :
"animation""replace"
promptrequired
string

Text directing animation. Use vivid descriptions for creative animations.

reference_imagerequired
string (uri)

URL for image reference. Use clear images for best rendering.

resolutionrequired
string

Output video resolution. Choose 720p for detail and 480p for speed.

Default: "480p"
Allowed values :
"480p""576p""720p"
base64optional
boolean

Outputs video as base64 string for easy data transfer.

Default: false
seedoptional
integer

Set seed for repeatability. Random seeds give variety.

Default: 987778

Response Type

Returns: Video

Common Error Codes

The API returns standard HTTP status codes. Detailed error messages are provided in the response body.

400

Bad Request

Invalid parameters or request format

401

Unauthorized

Missing or invalid API key

403

Forbidden

Insufficient permissions

404

Not Found

Model or endpoint not found

406

Insufficient Credits

Not enough credits to process request

429

Rate Limited

Too many requests

500

Server Error

Internal server error

502

Bad Gateway

Service temporarily unavailable

504

Timeout

Request timed out