Wan Animate
Wan-Animate seamlessly animates characters and replaces subjects in videos, ensuring fluid realism and environmental consistency.
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) 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
https://api.segmind.com/v1/wan-animateParameters
input_videorequiredstring (uri)URL of the video to process. Use HD videos for high-quality outputs.
moderequiredstring'Animation' for animating image; 'Replace' for replacing video subject. Choose based on task requirement.
"replace""animation""replace"promptrequiredstringText directing animation. Use vivid descriptions for creative animations.
reference_imagerequiredstring (uri)URL for image reference. Use clear images for best rendering.
resolutionrequiredstringOutput video resolution. Choose 720p for detail and 480p for speed.
"480p""480p""576p""720p"base64optionalbooleanOutputs video as base64 string for easy data transfer.
falseseedoptionalintegerSet seed for repeatability. Random seeds give variety.
987778Response Type
Returns: Video
Common Error Codes
The API returns standard HTTP status codes. Detailed error messages are provided in the response body.
Bad Request
Invalid parameters or request format
Unauthorized
Missing or invalid API key
Forbidden
Insufficient permissions
Not Found
Model or endpoint not found
Insufficient Credits
Not enough credits to process request
Rate Limited
Too many requests
Server Error
Internal server error
Bad Gateway
Service temporarily unavailable
Timeout
Request timed out