Wan 2.5 Image to Video Serverless API
Wan2.5-Preview creates stunning, high-resolution videos with flawless audio synchronization from multiple inputs.
1import requests
2import json
3
4url = "https://api.segmind.com/v1/wan-2.5-i2v"
5headers = {
6 "x-api-key": "YOUR_API_KEY",
7 "Content-Type": "application/json"
8}
9
10data = {
11 "seed": 42,
12 "image": "https://segmind-resources.s3.amazonaws.com/output/21aeb463-bb17-4536-864b-0bd1e11594a9-EMXN1y8qTgoGdXBsb2FkEg55bGFiLXN0dW50LXNncBo0YWlfcG9ydGFsLzE3NTM5NjM5NTIvbjdwNDlYOURCbS8yZTk0X2wwXzAwMS0wXzAuanBlZw_1000x1000.webp",
13 "prompt": "Kitten in a McDonald's uniform stands on a stool, grilling burger patties. It flips the patties with a spatula, watches them sizzle, and occasionally looks around while steam rises from the grill.",
14 "duration": "5",
15 "resolution": "720p",
16 "negative_prompt": "unnecessary clutter, dark shadows",
17 "enable_prompt_expansion": true
18}
19
20response = requests.post(url, headers=headers, json=data)
21
22if response.status_code == 200:
23 result = response.json()
24 print(json.dumps(result, indent=2))
25else:
26 print(f"Error: {response.status_code}")
27 print(response.text) 1import requests
2import json
3
4url = "https://api.segmind.com/v1/wan-2.5-i2v"
5headers = {
6 "x-api-key": "YOUR_API_KEY",
7 "Content-Type": "application/json"
8}
9
10data = {
11 "seed": 42,
12 "image": "https://segmind-resources.s3.amazonaws.com/output/21aeb463-bb17-4536-864b-0bd1e11594a9-EMXN1y8qTgoGdXBsb2FkEg55bGFiLXN0dW50LXNncBo0YWlfcG9ydGFsLzE3NTM5NjM5NTIvbjdwNDlYOURCbS8yZTk0X2wwXzAwMS0wXzAuanBlZw_1000x1000.webp",
13 "prompt": "Kitten in a McDonald's uniform stands on a stool, grilling burger patties. It flips the patties with a spatula, watches them sizzle, and occasionally looks around while steam rises from the grill.",
14 "duration": "5",
15 "resolution": "720p",
16 "negative_prompt": "unnecessary clutter, dark shadows",
17 "enable_prompt_expansion": true
18}
19
20response = requests.post(url, headers=headers, json=data)
21
22if response.status_code == 200:
23 result = response.json()
24 print(json.dumps(result, indent=2))
25else:
26 print(f"Error: {response.status_code}")
27 print(response.text)API Endpoint
https://api.segmind.com/v1/wan-2.5-i2vParameters
imagerequiredstring (uri)Input image for video generation. Choose a high-resolution image for best quality.
"https://segmind-resources.s3.amazonaws.com/output/21aeb463-bb17-4536-864b-0bd1e11594a9-EMXN1y8qTgoGdXBsb2FkEg55bGFiLXN0dW50LXNncBo0YWlfcG9ydGFsLzE3NTM5NjM5NTIvbjdwNDlYOURCbS8yZTk0X2wwXzAwMS0wXzAuanBlZw_1000x1000.webp"promptrequiredstringText description for video creation. Include vivid visuals for creative animations.
audiooptionalstring (uri)Upload an audio file for syncing. Use a song clip or melody for dynamic results.
durationoptionalintegerSets the video length. Choose 5 seconds for shorter clips and 10 for longer scenes.
510enable_prompt_expansionoptionalbooleanActivates prompt optimizer for enhanced results. Set to true for more detailed outputs.
truenegative_promptoptionalstringAvoid certain elements in generation. Include unwanted objects or colors for exclusion.
"unnecessary clutter, dark shadows"resolutionoptionalstringSet video quality. Use 1080p for high-quality renders and 480p for faster results.
"720p""480p""720p""1080p"seedoptionalintegerSets a random seed for consistent outputs. Use values between 1 and 100 for variation.
42Response 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