Vidu Template Serverless API
Transform static images into captivating videos using diverse motion templates effortlessly.
1import requests
2import json
3
4url = "https://api.segmind.com/v1/vidu-template"
5headers = {
6 "x-api-key": "YOUR_API_KEY",
7 "Content-Type": "application/json"
8}
9
10data = {
11 "template_name": "fishermen",
12 "image_url": "https://segmind-resources.s3.amazonaws.com/input/da5eeaf6-a3d2-4413-9c24-3b781339f804-b27b33db-9b49-4262-a8f4-8811099797eb.png",
13 "seed": 0,
14 "bgm": true,
15 "beast": "auto",
16 "area": "auto"
17}
18
19response = requests.post(url, headers=headers, json=data)
20
21if response.status_code == 200:
22 result = response.json()
23 print(json.dumps(result, indent=2))
24else:
25 print(f"Error: {response.status_code}")
26 print(response.text) 1import requests
2import json
3
4url = "https://api.segmind.com/v1/vidu-template"
5headers = {
6 "x-api-key": "YOUR_API_KEY",
7 "Content-Type": "application/json"
8}
9
10data = {
11 "template_name": "fishermen",
12 "image_url": "https://segmind-resources.s3.amazonaws.com/input/da5eeaf6-a3d2-4413-9c24-3b781339f804-b27b33db-9b49-4262-a8f4-8811099797eb.png",
13 "seed": 0,
14 "bgm": true,
15 "beast": "auto",
16 "area": "auto"
17}
18
19response = requests.post(url, headers=headers, json=data)
20
21if response.status_code == 200:
22 result = response.json()
23 print(json.dumps(result, indent=2))
24else:
25 print(f"Error: {response.status_code}")
26 print(response.text)API Endpoint
https://api.segmind.com/v1/vidu-templateParameters
image_urlrequiredstring (uri)Input the primary image URL. Use a high-quality image for best results.
template_namerequiredstringSelect a template for generation. Example: 'fishermen' for a marine theme or 'simpsons_comic' for a cartoonish style.
"fishermen""subject_3""pubg_winner_hit""split_stance_pet""shake_it_down""fairy_me""simpsons_comic""ladudu_me""french_kiss""hugging""bodyshake"+98 moreareaoptionalstringSelect cultural area for 'exotic_princess'. Choose 'china' for Asian style or 'africa' for tribal flair.
"auto""auto""denmark""uk""africa""china""mexico""switzerland""russia""italy""korea"+3 morebeastoptionalstringChoose a beast type for 'beast_companion'. Use 'bear' for strength or 'wolf' for agility.
"auto""auto""bear""tiger""elk""snake""lion""wolf"bgmoptionalbooleanToggle background music. Enable for dynamic effects or disable for a silent aesthetic.
trueimage_url_2optionalstring (uri)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
image_url_3optionalstring (uri)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
seedoptionalintegerSeed affects randomness. Set '0' for unpredictability or a specific number for reproducibility.
0Range: 0 - 999999Response Type
Returns: Video
Common Error Codes
The API returns standard HTTP status codes. Detailed error messages are provided in the response body.
Bad Request
Invalid parameters or request format
Unauthorized
Missing or invalid API key
Forbidden
Insufficient permissions
Not Found
Model or endpoint not found
Insufficient Credits
Not enough credits to process request
Rate Limited
Too many requests
Server Error
Internal server error
Bad Gateway
Service temporarily unavailable
Timeout
Request timed out