Vidu Template Serverless API

Transform static images into captivating videos using diverse motion templates effortlessly.

~125.77s
$0.063 per generation
 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

POSThttps://api.segmind.com/v1/vidu-template

Parameters

image_urlrequired
string (uri)

Input the primary image URL. Use a high-quality image for best results.

template_namerequired
string

Select a template for generation. Example: 'fishermen' for a marine theme or 'simpsons_comic' for a cartoonish style.

Default: "fishermen"
Allowed values (108 total):
"subject_3""pubg_winner_hit""split_stance_pet""shake_it_down""fairy_me""simpsons_comic""ladudu_me""french_kiss""hugging""bodyshake"+98 more
areaoptional
string

Select cultural area for 'exotic_princess'. Choose 'china' for Asian style or 'africa' for tribal flair.

Default: "auto"
Allowed values (13 total):
"auto""denmark""uk""africa""china""mexico""switzerland""russia""italy""korea"+3 more
beastoptional
string

Choose a beast type for 'beast_companion'. Use 'bear' for strength or 'wolf' for agility.

Default: "auto"
Allowed values :
"auto""bear""tiger""elk""snake""lion""wolf"
bgmoptional
boolean

Toggle background music. Enable for dynamic effects or disable for a silent aesthetic.

Default: true
image_url_2optional
string (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_3optional
string (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

seedoptional
integer

Seed affects randomness. Set '0' for unpredictability or a specific number for reproducibility.

Default: 0Range: 0 - 999999

Response Type

Returns: Video

Common Error Codes

The API returns standard HTTP status codes. Detailed error messages are provided in the response body.

400

Bad Request

Invalid parameters or request format

401

Unauthorized

Missing or invalid API key

403

Forbidden

Insufficient permissions

404

Not Found

Model or endpoint not found

406

Insufficient Credits

Not enough credits to process request

429

Rate Limited

Too many requests

500

Server Error

Internal server error

502

Bad Gateway

Service temporarily unavailable

504

Timeout

Request timed out