Qwen Image Fast Serverless API
Qwen-Image expertly generates stunning images with complex text integration, especially for Chinese typography.
1import requests
2import json
3
4url = "https://api.segmind.com/v1/qwen-image-fast"
5headers = {
6 "x-api-key": "YOUR_API_KEY",
7 "Content-Type": "application/json"
8}
9
10data = {
11 "prompt": "FASHION magazine cover featuring a stunning elegant woman, glamorous confident pose, couture dress, flawless glowing skin, luxury jewelry, cinematic studio lighting, glossy print photography aesthetic, ultra-detailed, crisp focus, only the word FASHION at the top, no other text anywhere",
12 "steps": 8,
13 "seed": -1,
14 "guidance": 1,
15 "aspect_ratio": "3:4",
16 "image_format": "png",
17 "quality": 90,
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) 1import requests
2import json
3
4url = "https://api.segmind.com/v1/qwen-image-fast"
5headers = {
6 "x-api-key": "YOUR_API_KEY",
7 "Content-Type": "application/json"
8}
9
10data = {
11 "prompt": "FASHION magazine cover featuring a stunning elegant woman, glamorous confident pose, couture dress, flawless glowing skin, luxury jewelry, cinematic studio lighting, glossy print photography aesthetic, ultra-detailed, crisp focus, only the word FASHION at the top, no other text anywhere",
12 "steps": 8,
13 "seed": -1,
14 "guidance": 1,
15 "aspect_ratio": "3:4",
16 "image_format": "png",
17 "quality": 90,
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
https://api.segmind.com/v1/qwen-image-fastParameters
promptrequiredstringDescribe imaginative scenes for image creation.
"A serene lakeside with glowing fireflies under a moonlit sky."stepsrequiredintegerNumber of steps for image refinement. More steps enhance quality; 8-16 is a good range.
8Range: 1 - 16aspect_ratiooptionalstringSelects image shape. Use 16:9 for cinematic view, 1:1 for balanced look.
"1:1""1:1""16:9""9:16""4:3""3:4""3:2""2:3"base64optionalbooleanOutputs as base64 string for embedding. Enable for integration, disable for standalone files.
falseguidanceoptionalnumberSets prompt adherence level. Use 1.0 for creative outcomes, 3.0 for precise results.
1Range: 1 - 20image_formatoptionalstringChoose format for image storage. 'jpeg' for compact files, 'png' for clarity.
"png""png""jpeg""webp"qualityoptionalintegerSets image detail level. Use 80 for web content, 100 for high-quality prints.
90Range: 10 - 100seedoptionalintegerSeed controls image uniqueness. Use -1 for new variations or a fixed number for consistency.
-1Response 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