1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
const axios = require('axios');
const api_key = "YOUR API-KEY";
const url = "https://api.segmind.com/v1/wan-2.2-t2v-fast";
const data = {
"prompt": "A sophisticated Korean teacher in her early 30s, with sleek, black hair tied in a high bun and sharp, cat-like eyes, stands at the front of the room. She wears a tailored blazer and pencil skirt, exuding authority. As she writes on the chalkboard, the chalk’s texture against her fingers sends a jolt of pleasure through her. The camera lingers on her face—her composed expression cracks as her lips tremble, her eyes flutter, and unaware figures remain in the background.",
"go_fast": true,
"num_frames": 81,
"resolution": "480p",
"aspect_ratio": "16:9",
"sample_shift": 12,
"frames_per_second": 16
};
(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);
}
})();
Random seed for reproducibility. Use a fixed seed for consistent outputs or leave blank for randomness.
Prompt describes the scene. Choose vivid and clear descriptions for best results.
Toggles speed of video creation. Set to true for quicker outputs.
Total frames in the video. 81 frames offer optimal quality.
min : 81,
max : 100
Select video resolution. Choose 480p for faster renders, 720p for quality.
Allowed values:
Aspect ratio of the video. 16:9 is standard, 9:16 for vertical.
Allowed values:
Controls frame sample shift. Increase for more motion variation.
min : 1,
max : 20
Video FPS. 16 fps is balanced; increase for smoother motion.
min : 5,
max : 24
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.
Wan2.2 is a state-of-the-art generative AI video model by Wan-AI, designed for both text-to-video and image-to-video synthesis. Leveraging a Mixture-of-Experts architecture, Wan2.2 dynamically routes denoising tasks to specialized expert networks, delivering cinematic-quality clips without extra computational overhead. It generates HD video at 480p or 720p and supports up to 24 frames per second, running efficiently on consumer GPUs such as the NVIDIA RTX 4090. Ideal for developers, creators, and product managers, Wan2.2 outperforms many commercial alternatives in both research settings and production pipelines.
Q: How do I generate a video from text?
A: Provide a clear prompt
in the text field, select resolution (480p/720p), set num_frames
and frames_per_second
, then run the model.
Q: Can I control the video’s aspect ratio?
A: Yes. Use the aspect_ratio
parameter to choose 16:9 for landscape or 9:16 for vertical output.
Q: What hardware is required to run Wan2.2?
A: A consumer GPU like NVIDIA RTX 4090 or equivalent with 24 fps support is recommended for smooth performance.
Q: How do I reproduce the same video output?
A: Set the seed
parameter to a fixed integer. Leaving it blank generates new random variations each run.