Wan 2.7 Image Generation Pro Serverless API
Wan 2.7 Pro generates 4K images with chain-of-thought reasoning, multilingual text rendering, and multi-reference consistency control.
1import requests
2import json
3
4url = "https://api.segmind.com/v1/wan2.7-image-pro"
5headers = {
6 "x-api-key": "YOUR_API_KEY",
7 "Content-Type": "application/json"
8}
9
10data = {
11 "prompt": "A breathtaking aerial view of a futuristic city at golden hour, towering glass skyscrapers with lush vertical gardens, flying vehicles, cinematic lighting, ultra-detailed, photorealistic",
12 "negative_prompt": "blurry, low quality, distorted, watermark, text",
13 "size": "2K",
14 "seed": 42,
15 "watermark": false
16}
17
18response = requests.post(url, headers=headers, json=data)
19
20if response.status_code == 200:
21 result = response.json()
22 print(json.dumps(result, indent=2))
23else:
24 print(f"Error: {response.status_code}")
25 print(response.text) 1import requests
2import json
3
4url = "https://api.segmind.com/v1/wan2.7-image-pro"
5headers = {
6 "x-api-key": "YOUR_API_KEY",
7 "Content-Type": "application/json"
8}
9
10data = {
11 "prompt": "A breathtaking aerial view of a futuristic city at golden hour, towering glass skyscrapers with lush vertical gardens, flying vehicles, cinematic lighting, ultra-detailed, photorealistic",
12 "negative_prompt": "blurry, low quality, distorted, watermark, text",
13 "size": "2K",
14 "seed": 42,
15 "watermark": false
16}
17
18response = requests.post(url, headers=headers, json=data)
19
20if response.status_code == 200:
21 result = response.json()
22 print(json.dumps(result, indent=2))
23else:
24 print(f"Error: {response.status_code}")
25 print(response.text)API Endpoint
https://api.segmind.com/v1/wan2.7-image-proParameters
promptrequiredstringDescribe the image you want to generate in detail. Include subject, lighting, style, and mood for best results — supports up to 5000 characters.
"A breathtaking aerial view of a futuristic city at golden hour, towering glass skyscrapers with lush vertical gardens, flying vehicles, cinematic lighting, ultra-detailed, photorealistic"imageoptionalstring (uri)Upload a reference image to guide editing or style transfer. Use for character consistency, background matching, or image-to-image refinements.
nullnegative_promptoptionalstringDescribe elements to exclude from the output. Use to remove artifacts, unwanted styles, colors, or subjects that often appear uninstructed.
"blurry, low quality, distorted, watermark, text"seedoptionalintegerSet a fixed seed to reproduce an exact output. Increment slightly to create variations of the same composition. Range: 0-2147483647.
42sizeoptionalstringSet the output resolution. Use 1K for fast previews, 2K for web-ready outputs, and 4K for print-grade or high-DPI deliverables.
"2K""1K""2K""4K"watermarkoptionalbooleanOverlays an AI-generated watermark on the output. Set to false for clean professional deliverables; enable for content attribution workflows.
falseResponse Type
Returns: Text/JSON
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