Wan 2.2 Text to Video Fast Serverless API
Wan2.2 transforms text and images into high-quality video clips with cinematic flair.
1import requests
2import json
3
4url = "https://api.segmind.com/v1/wan-2.2-t2v-fast"
5headers = {
6 "x-api-key": "YOUR_API_KEY",
7 "Content-Type": "application/json"
8}
9
10data = {
11 "prompt": "A sophisticated Korean teacher in her early 30s, with sleek, black hair tied in a high bun and sharp, cat-like eyes, stands at the front of the room. She wears a tailored blazer and pencil skirt, exuding authority. As she writes on the chalkboard, the chalk’s texture against her fingers sends a jolt of pleasure through her. The camera lingers on her face—her composed expression cracks as her lips tremble, her eyes flutter, and unaware figures remain in the background.",
12 "go_fast": true,
13 "num_frames": 81,
14 "resolution": "480p",
15 "aspect_ratio": "16:9",
16 "sample_shift": 12,
17 "frames_per_second": 16,
18 "high_noise_lora_scale": 1,
19 "low_noise_lora_scale": 1
20}
21
22response = requests.post(url, headers=headers, json=data)
23
24if response.status_code == 200:
25 result = response.json()
26 print(json.dumps(result, indent=2))
27else:
28 print(f"Error: {response.status_code}")
29 print(response.text) 1import requests
2import json
3
4url = "https://api.segmind.com/v1/wan-2.2-t2v-fast"
5headers = {
6 "x-api-key": "YOUR_API_KEY",
7 "Content-Type": "application/json"
8}
9
10data = {
11 "prompt": "A sophisticated Korean teacher in her early 30s, with sleek, black hair tied in a high bun and sharp, cat-like eyes, stands at the front of the room. She wears a tailored blazer and pencil skirt, exuding authority. As she writes on the chalkboard, the chalk’s texture against her fingers sends a jolt of pleasure through her. The camera lingers on her face—her composed expression cracks as her lips tremble, her eyes flutter, and unaware figures remain in the background.",
12 "go_fast": true,
13 "num_frames": 81,
14 "resolution": "480p",
15 "aspect_ratio": "16:9",
16 "sample_shift": 12,
17 "frames_per_second": 16,
18 "high_noise_lora_scale": 1,
19 "low_noise_lora_scale": 1
20}
21
22response = requests.post(url, headers=headers, json=data)
23
24if response.status_code == 200:
25 result = response.json()
26 print(json.dumps(result, indent=2))
27else:
28 print(f"Error: {response.status_code}")
29 print(response.text)API Endpoint
https://api.segmind.com/v1/wan-2.2-t2v-fastParameters
promptrequiredstringPrompt describes the scene. Choose vivid and clear descriptions for best results.
aspect_ratiooptionalstringAspect ratio of the video. 16:9 is standard, 9:16 for vertical.
"16:9""16:9""9:16"frames_per_secondoptionalintegerVideo FPS. 16 fps is balanced; increase for smoother motion.
16Range: 5 - 24go_fastoptionalbooleanToggles speed of video creation. Set to true for quicker outputs.
truehigh_noise_loraoptionalstringURL to high noise LoRA model for style customization. Supports arbitrary .safetensors URLs from the Internet.
nullhigh_noise_lora_scaleoptionalnumberControls high noise LoRA influence strength. 0.0 = disabled, 1.0 = full strength, 2.0 = maximum.
1Range: 0 - 2low_noise_loraoptionalstringURL to low noise LoRA model for style customization. Supports arbitrary .safetensors URLs from the Internet.
nulllow_noise_lora_scaleoptionalnumberControls low noise LoRA influence strength. 0.0 = disabled, 1.0 = full strength, 2.0 = maximum.
1Range: 0 - 2negative_promptoptionalstringText describing what you want to avoid in the video. Helps improve quality by excluding unwanted elements.
""num_framesoptionalintegerTotal frames in the video. 81 frames offer optimal quality.
81Range: 81 - 100resolutionoptionalstringSelect video resolution. Choose 480p for faster renders, 720p for quality.
"480p""480p""720p"sample_shiftoptionalnumberControls frame sample shift. Increase for more motion variation.
12Range: 1 - 20seedoptionalintegerRandom seed for reproducibility. Use a fixed seed for consistent outputs or leave blank for randomness.
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