Wan 2.1 480p image to video Serverless API

Create high-quality 480p videos with excellent visual quality and a broad spectrum of motion from static images.

~53.38s
~$0.53
 1import requests
 2import json
 3
 4url = "https://api.segmind.com/v1/wan2.1-i2v-480p"
 5headers = {
 6    "x-api-key": "YOUR_API_KEY",
 7    "Content-Type": "application/json"
 8}
 9
10data = {
11    "prompt": "A shady looking man in a trench coat glances nervously from side to side. He slowly reaches up to the side of his face and opens it up like a door, revealing a tiny alien inside his head who is piloting him by pulling various levers. The tiny alien is also wearing a trench coat and glances nervously from side to side. Also this entire scene takes place in the bleachers at a rodeo.",
12    "negative_prompt": "blurry, bad quality, camera shake, distortion, poor composition, low resolution, artifact, watermark",
13    "image": "https://segmind-resources.s3.amazonaws.com/input/e654c0e4-f048-4450-b289-e37280210c3e-wan-480-ip.png",
14    "seed": 30887452,
15    "video_length": 3,
16    "resolution": "480",
17    "steps": 30,
18    "base64": false
19}
20
21response = requests.post(url, headers=headers, json=data)
22
23if response.status_code == 200:
24    result = response.json()
25    print(json.dumps(result, indent=2))
26else:
27    print(f"Error: {response.status_code}")
28    print(response.text)

API Endpoint

POSThttps://api.segmind.com/v1/wan2.1-i2v-480p

Parameters

imagerequired
string (uri)

Reference image for video generation

promptrequired
string

Prompt for video generation

resolutionrequired
integer

Resolution of the generated video (longest side of the video)

Default: 480
Allowed values :
360480576
video_lengthrequired
integer

Length of the generated video in seconds

Default: 3Range: 1 - 5
base64optional
boolean

Output as base64

Default: false
negative_promptoptional
string

Negative prompt for video generation

Default: "blurry, bad quality, camera shake, distortion, poor composition, low resolution, artifact, watermark"
seedoptional
integer

Seed number for video generation

Default: 42424242
stepsoptional
integer

Number of steps for video generation

Default: 30Range: 10 - 70

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