Wan 2.7 Reference to Video Serverless API
Generate character-consistent videos from reference images with multi-subject support and voice cloning up to 1080P.
1import requests
2import json
3
4url = "https://api.segmind.com/v1/wan2.7-r2v"
5headers = {
6 "x-api-key": "YOUR_API_KEY",
7 "Content-Type": "application/json"
8}
9
10data = {
11 "prompt": "Image1 walks through a lush green garden with blooming flowers, smiling warmly at the camera, golden hour lighting",
12 "reference_images": "https://segmind-resources.s3.amazonaws.com/input/wan2.7-r2v-ref-image.jpg",
13 "negative_prompt": "blurry, low quality, distorted, watermark",
14 "resolution": "720P",
15 "duration": 5,
16 "seed": 42
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) 1import requests
2import json
3
4url = "https://api.segmind.com/v1/wan2.7-r2v"
5headers = {
6 "x-api-key": "YOUR_API_KEY",
7 "Content-Type": "application/json"
8}
9
10data = {
11 "prompt": "Image1 walks through a lush green garden with blooming flowers, smiling warmly at the camera, golden hour lighting",
12 "reference_images": "https://segmind-resources.s3.amazonaws.com/input/wan2.7-r2v-ref-image.jpg",
13 "negative_prompt": "blurry, low quality, distorted, watermark",
14 "resolution": "720P",
15 "duration": 5,
16 "seed": 42
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
https://api.segmind.com/v1/wan2.7-r2vParameters
promptrequiredstringText prompt describing the scene, referencing characters as Image1, Image2, Video1, etc. For single character: 'Image1 walks through a park smiling.' For multi-character: 'Image1 and Image2 shake hands in an office.'
"Image1 walks through a lush green garden with blooming flowers, smiling warmly at the camera, golden hour lighting"durationoptionalintegerLength of the generated video in seconds (2-15). Use 3-5s for social clips and product demos; 10-15s for narrative scenes or explainer segments.
5negative_promptoptionalstringDescribe what to exclude from the video. Use for common artifacts like 'blurry, distorted face, extra limbs' or to block unwanted styles.
"blurry, low quality, distorted, watermark"reference_imagesoptionalstring (uri)Public image URL of a character reference. Each image maps to Image1, Image2, etc. in the prompt. Use clear, front-facing portraits for best identity consistency. Add up to 5 images.
"https://segmind-resources.s3.amazonaws.com/input/wan2.7-r2v-ref-image.jpg"reference_videosoptionalstring (uri)Public video URL of a character reference clip. Each video maps to Video1, Video2, etc. in the prompt. Short clips (3-10s) with a single subject work best. Add up to 5 videos.
nullreference_voiceoptionalstring (uri)Public URL of a 1-10 second audio clip to clone the character's voice timbre. Ideal for dubbed content; use a clean, noise-free recording for best results.
nullresolutionoptionalstringOutput video resolution. 720P is faster and lower cost; use 1080P for final deliverables, client previews, or broadcast-quality output.
"720P""720P""1080P"seedoptionalintegerSet a fixed seed integer for reproducible outputs. Leave null for random variation; reuse a known seed to regenerate the same result with tweaked prompts.
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