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
32
33
34
35
36
37
38
39
40
41
42
const axios = require('axios');
const FormData = require('form-data');
const api_key = "YOUR API-KEY";
const url = "https://api.segmind.com/v1/wan-2.5-i2v";
const reqBody = {
"seed": 42,
"image": "https://segmind-resources.s3.amazonaws.com/output/21aeb463-bb17-4536-864b-0bd1e11594a9-EMXN1y8qTgoGdXBsb2FkEg55bGFiLXN0dW50LXNncBo0YWlfcG9ydGFsLzE3NTM5NjM5NTIvbjdwNDlYOURCbS8yZTk0X2wwXzAwMS0wXzAuanBlZw_1000x1000.webp",
"prompt": "Kitten in a McDonald's uniform stands on a stool, grilling burger patties. It flips the patties with a spatula, watches them sizzle, and occasionally looks around while steam rises from the grill.",
"duration": 5,
"resolution": "720p",
"negative_prompt": "unnecessary clutter, dark shadows",
"enable_prompt_expansion": true
};
(async function() {
try {
const formData = new FormData();
// Append regular fields
for (const key in reqBody) {
if (reqBody.hasOwnProperty(key)) {
formData.append(key, reqBody[key]);
}
}
// Convert and append images as Base64 if necessary
const response = await axios.post(url, formData, {
headers: {
'x-api-key': api_key,
...formData.getHeaders()
}
});
console.log(response.data);
} catch (error) {
console.error('Error:', error.response ? error.response.data : error.message);
}
})();
Sets a random seed for consistent outputs. Use values between 1 and 100 for variation.
Upload an audio file for syncing. Use a song clip or melody for dynamic results.
Input image for video generation. Choose a high-resolution image for best quality.
Text description for video creation. Include vivid visuals for creative animations.
Sets the video length. Choose 5 seconds for shorter clips and 10 for longer scenes.
Allowed values:
Set video quality. Use 1080p for high-quality renders and 480p for faster results.
Allowed values:
Avoid certain elements in generation. Include unwanted objects or colors for exclusion.
Activates prompt optimizer for enhanced results. Set to true for more detailed outputs.
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 September 28, 2025.
Wan2.5-Preview takes a revolutionary approach when it comes to multimodal AI in multimedia content creation. It can smoothly merge text, image, video, and audio to render a cohesive and unified audio-visual output. It is equipped to produce high-fidelity cinematic 1080p videos up to 10 seconds in length, with synchronized multi-audio tracks to include voice, sound effects, and music. It is essentially a holistic model for a multitude of platforms and professional creators across several industries.
How does Wan2.5-Preview handle audio synchronization?
What's the optimal resolution for different use cases?
How can I ensure consistent outputs?
What makes Wan2.5-Preview different from other video generation models?
Can I control the artistic style of the generated videos?