Wan 2.6 Image To Video Serverless API
Wan 2.6 transforms text and images into high-quality videos with precise audio sync, perfect for engaging content creation.
1import requests
2import json
3
4url = "https://api.segmind.com/v1/wan-2.6-i2v"
5headers = {
6 "x-api-key": "YOUR_API_KEY",
7 "Content-Type": "application/json"
8}
9
10data = {
11 "image": "https://segmind-resources.s3.amazonaws.com/output/58c03b83-811d-4c4d-8837-1c01b8c8cdea-wan2.6-i2v-ip.webp",
12 "prompt": "A dramatic action POV chase scene. The camera shows the protagonist falling back on the wet ground, then quickly standing up and sprinting at high speed through heavy rain. The POV camera shakes violently with each step, with motion blur on the trees and bushes rushing past. Every few seconds, the character quickly turns their head, and the camera swings backward to reveal a massive T-Rex charging straight toward them. Mud explodes under its heavy footsteps, rain drips from its jaws, and it snaps its enormous teeth just behind the camera. Raindrops hit the lens, dirt and leaves splash upward, and flashes of lightning illuminate the dinosaur’s wet scales. The scene feels frantic, high-speed, hyper-realistic, and intensely cinematic",
13 "duration": 5,
14 "resolution": "720p",
15 "multi_shots": false,
16 "negative_prompt": "low resolution, error, worst quality, low quality, defects",
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.6-i2v"
5headers = {
6 "x-api-key": "YOUR_API_KEY",
7 "Content-Type": "application/json"
8}
9
10data = {
11 "image": "https://segmind-resources.s3.amazonaws.com/output/58c03b83-811d-4c4d-8837-1c01b8c8cdea-wan2.6-i2v-ip.webp",
12 "prompt": "A dramatic action POV chase scene. The camera shows the protagonist falling back on the wet ground, then quickly standing up and sprinting at high speed through heavy rain. The POV camera shakes violently with each step, with motion blur on the trees and bushes rushing past. Every few seconds, the character quickly turns their head, and the camera swings backward to reveal a massive T-Rex charging straight toward them. Mud explodes under its heavy footsteps, rain drips from its jaws, and it snaps its enormous teeth just behind the camera. Raindrops hit the lens, dirt and leaves splash upward, and flashes of lightning illuminate the dinosaur’s wet scales. The scene feels frantic, high-speed, hyper-realistic, and intensely cinematic",
13 "duration": 5,
14 "resolution": "720p",
15 "multi_shots": false,
16 "negative_prompt": "low resolution, error, worst quality, low quality, defects",
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.6-i2vParameters
imagerequiredstring (uri)Input image for video generation
promptrequiredstringText prompt for video generation
audiooptionalstring (uri)Audio file (wav/mp3, 3-30s, ≤15MB) for voice/music synchronization
nulldurationoptionalintegerAn enumeration.
551015enable_prompt_expansionoptionalbooleanIf set to true, the prompt optimizer will be enabled
truemulti_shotsoptionalbooleanEnable intelligent multi-shot segmentation (only active when enable_prompt_expansion is enabled). True enables multi-shot segmentation, false generates single-shot content.
falsenegative_promptoptionalstringNegative prompt to avoid certain elements
""resolutionoptionalstringAn enumeration.
"720p""720p""1080p"seedoptionalintegerRandom seed for reproducible generation
nullResponse 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