Vidu Template Serverless API
Transform static images into captivating videos using diverse motion templates effortlessly.
POST /v2/vidu-template · submit + poll 1# pip install "segmind>=1.1.0"
2# export SEGMIND_API_KEY="YOUR_API_KEY"
3from segmind import SegmindClient, InferenceFailed, InferenceTimeout
4
5# Async (v2) — recommended for long-running / video models.
6# run() blocks up to 600s; submit_async + job.wait(timeout=...) sets a longer
7# deadline and keeps the request_id so you can re-poll later.
8client = SegmindClient() # reads SEGMIND_API_KEY
9payload = {
10 "template_name": "fishermen",
11 "image_url": "https://segmind-resources.s3.amazonaws.com/input/da5eeaf6-a3d2-4413-9c24-3b781339f804-b27b33db-9b49-4262-a8f4-8811099797eb.png",
12 "seed": 0,
13 "bgm": True,
14 "beast": "auto",
15 "area": "auto",
16}
17job = client.submit_async("vidu-template", **payload)
18print(job.request_id) # available immediately
19try:
20 result = job.wait(timeout=900, interval=2.0)
21 print(result["status"]) # COMPLETED
22 print(result.get("output")) # model output (e.g. video URL)
23except InferenceTimeout as e:
24 print("still running:", e.request_id) # re-poll later with this id
25except InferenceFailed as e:
26 print("failed:", e.detail)
27
28# Fast models (<=600s) can use the one-liner instead:
29# result = segmind.run("vidu-template", **payload) 1# pip install "segmind>=1.1.0"
2# export SEGMIND_API_KEY="YOUR_API_KEY"
3from segmind import SegmindClient, InferenceFailed, InferenceTimeout
4
5# Async (v2) — recommended for long-running / video models.
6# run() blocks up to 600s; submit_async + job.wait(timeout=...) sets a longer
7# deadline and keeps the request_id so you can re-poll later.
8client = SegmindClient() # reads SEGMIND_API_KEY
9payload = {
10 "template_name": "fishermen",
11 "image_url": "https://segmind-resources.s3.amazonaws.com/input/da5eeaf6-a3d2-4413-9c24-3b781339f804-b27b33db-9b49-4262-a8f4-8811099797eb.png",
12 "seed": 0,
13 "bgm": True,
14 "beast": "auto",
15 "area": "auto",
16}
17job = client.submit_async("vidu-template", **payload)
18print(job.request_id) # available immediately
19try:
20 result = job.wait(timeout=900, interval=2.0)
21 print(result["status"]) # COMPLETED
22 print(result.get("output")) # model output (e.g. video URL)
23except InferenceTimeout as e:
24 print("still running:", e.request_id) # re-poll later with this id
25except InferenceFailed as e:
26 print("failed:", e.detail)
27
28# Fast models (<=600s) can use the one-liner instead:
29# result = segmind.run("vidu-template", **payload)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
Asynchronous requests (v2)
Use Async for video, long-running (>~60s), or high-concurrency workloads; Sync is simplest for fast image & LLM calls. Async submits a request and you poll it to completion.
- 1
POST /v2/vidu-templateSubmit — returns request_id, status_url, response_url
- 2
GET /v2/requests/{id}/statusPoll — until COMPLETED or FAILED
- 3
GET /v2/requests/{id}Result — final response body
Status states
- A FAILED request is served as HTTP 422 — the body still carries the error detail.
- An unknown or expired request_id returns HTTP 404.
- Results are retained for 1 hour, then expire.
- Content / RAI blocks surface as FAILED, not a separate state.
- Track completion by polling the status endpoint.
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