API
If you're looking for an API, you can choose from your desired programming language.
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
import requests
import base64
# Use this function to convert an image file from the filesystem to base64
def image_file_to_base64(image_path):
with open(image_path, 'rb') as f:
image_data = f.read()
return base64.b64encode(image_data).decode('utf-8')
# Use this function to fetch an image from a URL and convert it to base64
def image_url_to_base64(image_url):
response = requests.get(image_url)
image_data = response.content
return base64.b64encode(image_data).decode('utf-8')
# Use this function to convert a list of image URLs to base64
def image_urls_to_base64(image_urls):
return [image_url_to_base64(url) for url in image_urls]
api_key = "YOUR_API_KEY"
url = "https://api.segmind.com/v1/vidu-template"
# Request payload
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"
}
headers = {'x-api-key': api_key}
response = requests.post(url, json=data, headers=headers)
print(response.content) # The response is the generated image
Attributes
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 – Image-to-Video Generation Model
What is Vidu Template AI?
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.
Key Features
- Wide Template Library: Over 100 motion templates (e.g.,
fishermen
,simpsons_comic
,ghibli
,minecraft
) cater to cartoon, cinematic, and themed styles. - High-Quality Diffusion: Leverages cutting-edge diffusion models for smooth, artifact-free animations.
- Customizable Outputs:
template_name
: Choose your animation style.aspect_ratio
: Select from16:9
,4:3
,1:1
,3:4
, or9:16
.seed
: Control randomness (set to0
for varied output or a fixed value for reproducibility).bgm
: Toggle background music on/off.- Advanced params (
beast
,area
,image_url_2
,image_url_3
) unlock multi-input and theme options.
- Fast Inference: Low-latency REST API endpoints for seamless integration into web or mobile apps.
- Reproducible Results: Seed-based generation ensures that teams can collaborate on consistent video outputs.
Best Use Cases
- Social Media Ads: Convert product shots into eye-catching animated clips.
- Marketing Content: Craft branded intros or transitions with custom themes.
- Storytelling & Personal Projects: Animate family photos, travel snapshots, or event highlights.
- E-commerce: Showcase apparel, gadgets, and lifestyle products in motion.
- User-Generated Campaigns: Empower communities to animate their own images with themed templates.
Prompt Tips and Output Quality
- Use a high-resolution image URL (
image_url
) for sharp details. - Select the ideal
template_name
to match your brand tone (cartoon, epic, romantic, etc.). - Set an
aspect_ratio
that fits your target platform (e.g.,1:1
for Instagram,16:9
for YouTube). - Adjust
seed
to reproduce or explore variations. - Enable
bgm
for dynamic videos or disable for silent loops. - For specialized effects (
beast_companion
,exotic_princess
), usebeast
orarea
to fine-tune style. - Combine up to three image URLs (
image_url
,image_url_2
,image_url_3
) for multi-scene templates.
FAQs
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.
Other Popular Models
sdxl-controlnet
SDXL ControlNet gives unprecedented control over text-to-image generation. SDXL ControlNet models Introduces the concept of conditioning inputs, which provide additional information to guide the image generation process

illusion-diffusion-hq
Monster Labs QrCode ControlNet on top of SD Realistic Vision v5.1

faceswap-v2
Take a picture/gif and replace the face in it with a face of your choice. You only need one image of the desired face. No dataset, no training

codeformer
CodeFormer is a robust face restoration algorithm for old photos or AI-generated faces.
