1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
const axios = require('axios');
const fs = require('fs');
const path = require('path');
async function toB64(imgPath) {
const data = fs.readFileSync(path.resolve(imgPath));
return Buffer.from(data).toString('base64');
}
const api_key = "YOUR API-KEY";
const url = "https://api.segmind.com/v1/wan-animate";
const data = {
"input_video": "https://segmind-resources.s3.amazonaws.com/input/e9f1b4cb-812d-43b4-9aaf-572bc01828d1-animate-1.mp4",
"reference_image": "toB64('https://segmind-resources.s3.amazonaws.com/input/7af018fd-d18a-4688-9afd-52df7510fe69-MarkuryFLUX_03641_.png')",
"resolution": "480p",
"prompt": "woman posing for a selfie",
"seed": 987778,
"mode": "replace",
"base64": false
};
(async function() {
try {
const response = await axios.post(url, data, { headers: { 'x-api-key': api_key } });
console.log(response.data);
} catch (error) {
console.error('Error:', error.response.data);
}
})();
URL of the video to process. Use HD videos for high-quality outputs.
URL for image reference. Use clear images for best rendering.
Output video resolution. Choose 720p for detail and 480p for speed.
Allowed values:
Text directing animation. Use vivid descriptions for creative animations.
Set seed for repeatability. Random seeds give variety.
'Animation' for animating image; 'Replace' for replacing video subject. Choose based on task requirement.
Allowed values:
Outputs video as base64 string for easy data transfer.
To keep track of your credit usage, you can inspect the response headers of each API call. The x-remaining-credits property will indicate the number of remaining credits in your account. Ensure you monitor this value to avoid any disruptions in your API usage.
Edited by Segmind Team on October 9, 2025.
Wan‑Animate is the latest AI model, built on the Wan Framework, that is designed to transform animation in videos with flawless substitution of the original subject. The model efficiently imitates the facial expressions and physical movements from the source video to produce smooth and natural animations. Wan-Animate is integrated with a powerful Relighting LoRA module that ensures the preservation of lighting and environmental details during the transformation process. It produces realistic, high-quality character animation and maintains consistency in subject replacement.
Wan-Animate can combine character animation and replacement capabilities within a single model to provide advanced environmental consistency, making it an excellent option for realistic animations.
It is recommended to use high-definition videos with clear movement and good lighting for supreme results. Furthermore, Wan-Animate performs exceptionally well when it is provided with source videos having distinct facial expressions and body movements.
Yes, using the seed parameter gives reproducible results; setting a specific seed value ensures consistent outputs across multiple runs.
Yes, Wan-Animate is available as an open-source model; hence, the developers can access and modify the code to suit their specific needs.
If you combine HD input videos with 720p resolution output, share clear reference images, and provide detailed prompts describing the desired animation, these aspects work synergistically and render the best animation.