1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
const axios = require('axios');
const api_key = "YOUR API-KEY";
const url = "https://api.segmind.com/v1/vidu-template";
const data = {
"template_name": "fishermen",
"image_url": "https://segmind-resources.s3.amazonaws.com/input/da5eeaf6-a3d2-4413-9c24-3b781339f804-b27b33db-9b49-4262-a8f4-8811099797eb.png",
"seed": 0,
"bgm": true,
"beast": "auto",
"area": "auto"
};
(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);
}
})();Select a template for generation. Example: 'fishermen' for a marine theme or 'simpsons_comic' for a cartoonish style.
Allowed values:
Input the primary image URL. Use a high-quality image for best results.
Optional second image URL for special templates. Use if format requires a second visual input. Supports with given templates clayshot_duo, ai_outfit, dynasty_dress(1 or 2 image), smooth_shift
Optional third image URL for advanced templates. Applicable if the template supports multiple inputs. Supports with given templates ai_outfit, embrace_the_god_wealth, god_send_ingot, god_send_red_envelope, god_send_gold_coins
Seed affects randomness. Set '0' for unpredictability or a specific number for reproducibility.
min : 0,
max : 999999
Toggle background music. Enable for dynamic effects or disable for a silent aesthetic.
Choose a beast type for 'beast_companion'. Use 'bear' for strength or 'wolf' for agility.
Allowed values:
Select cultural area for 'exotic_princess'. Choose 'china' for Asian style or 'africa' for tribal flair.
Allowed values:
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.
Vidu Template AI is a generative image-to-video model that transforms static pictures into polished, dynamic videos by applying a variety of predefined motion templates. Built on advanced diffusion techniques, this REST API-driven service lets developers, creators, and product managers rapidly produce engaging visual content for social media, marketing campaigns, storytelling, and personal projects.
fishermen, simpsons_comic, ghibli, minecraft) cater to cartoon, cinematic, and themed styles.template_name: Choose your animation style.aspect_ratio: Select from 16:9, 4:3, 1:1, 3:4, or 9:16.seed: Control randomness (set to 0 for varied output or a fixed value for reproducibility).bgm: Toggle background music on/off.beast, area, image_url_2, image_url_3) unlock multi-input and theme options.image_url) for sharp details.template_name to match your brand tone (cartoon, epic, romantic, etc.).aspect_ratio that fits your target platform (e.g., 1:1 for Instagram, 16:9 for YouTube).seed to reproduce or explore variations.bgm for dynamic videos or disable for silent loops.beast_companion, exotic_princess), use beast or area to fine-tune style.image_url, image_url_2, image_url_3) for multi-scene templates.Q: How do I generate a video from a single image?
A: Send a POST request to /v1/vidu-template with image_url, template_name, and optional parameters. The API returns a video URL when processing completes.
Q: Which templates are available?
A: Choose from over 100 templates like shake_it_dance, manga_meme, star_carpet, love_story, and more. Check the dropdown in our API docs.
Q: How can I reproduce the same video output?
A: Set a fixed seed value (e.g., 42). The model will generate identical video results each time.
Q: Can I include background music?
A: Yes. Set bgm to true (default) to automatically add a soundtrack. Toggle off for silent animations.
Q: What aspect ratios are supported?
A: The model supports 16:9, 4:3, 1:1, 3:4, and 9:16—ideal for widescreen, square, and vertical platforms.