Wan 2.2 Image to Video Flash Serverless API

Transform a single image and text prompt into a coherent, dynamic video.

~65.39s
$0.075 - $0.180 per generation
 1import requests
 2import json
 3
 4url = "https://api.segmind.com/v1/wan-2.2-i2v-flash"
 5headers = {
 6    "x-api-key": "YOUR_API_KEY",
 7    "Content-Type": "application/json"
 8}
 9
10data = {
11    "prompt": "4K cinematic close-up of a bloodied, battle-worn Viking warrior kneeling in a snowy sacred cave, eyes wide and glassy with intensity.His long braided blonde beard is frosted with snow, blood streaks run down his face and shoulders. The background is dimly lit by a flickering flame behind him — ancient carvings and symbols glow faintly on the icy stone wall. Camera slowly pushes in on his face as snow swirls in slow motion, and he breathes heavily, lips slightly parted.Suddenly, subtle glitch effects ripple across his face — like time distorting — as if a divine force is entering his mind.In the distance, an echo of a woman’s voice is heard whispering prophecy. As his eyes narrow, a faint blue rune glow reflects in his iris, foreshadowing something ancient and powerful.The camera holds as his expression changes — from fear… to understanding… to resolve.",
12    "image": "https://segmind-resources.s3.amazonaws.com/output/310df0db-0c5e-4c5a-8c78-5db73fbc7c91-bcd49a2d-a0a9-465e-aefd-ca9b5ebb11a7.jpeg",
13    "negative_prompt": "Avoid depicting busy urban environments.",
14    "resolution": "720P",
15    "prompt_extend": true,
16    "watermark": false
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/wan-2.2-i2v-flash

Parameters

imagerequired
string (uri)

Base image is used to establish the video's theme. Choose images with strong visual elements or futuristic items.

promptrequired
string

A descriptive prompt guides the video generation with vivid storytelling. Try a vibrant imaginary or futuristic setting for best effects.

negative_promptoptional
string

Excludes specific details from the final video. Avoid elements like chaotic environments for clearer messaging.

Default: "Avoid depicting busy urban environments."
prompt_extendoptional
boolean

Enhances the prompt automatically for better results. Enable this for complex or lengthy descriptions.

Default: true
resolutionoptional
string

Defines the output video quality. Use 720P for high clarity or 480P for faster processing.

Default: "720P"
Allowed values :
"480P""720P"
seedoptional
integer

Controls the randomness of video generation. Set a number for consistency or leave blank for variability.

Default: null
watermarkoptional
boolean

Adds an 'AI Generated' tag to outputs. Use for transparency in generated media.

Default: false

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