Qwen Image Fast Serverless API

Qwen-Image expertly generates stunning images with complex text integration, especially for Chinese typography.

~5.54s
~$0.018
 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

POSThttps://api.segmind.com/v1/qwen-image-fast

Parameters

promptrequired
string

Describe imaginative scenes for image creation.

Default: "A serene lakeside with glowing fireflies under a moonlit sky."
stepsrequired
integer

Number of steps for image refinement. More steps enhance quality; 8-16 is a good range.

Default: 8Range: 1 - 16
aspect_ratiooptional
string

Selects image shape. Use 16:9 for cinematic view, 1:1 for balanced look.

Default: "1:1"
Allowed values :
"1:1""16:9""9:16""4:3""3:4""3:2""2:3"
base64optional
boolean

Outputs as base64 string for embedding. Enable for integration, disable for standalone files.

Default: false
guidanceoptional
number

Sets prompt adherence level. Use 1.0 for creative outcomes, 3.0 for precise results.

Default: 1Range: 1 - 20
image_formatoptional
string

Choose format for image storage. 'jpeg' for compact files, 'png' for clarity.

Default: "png"
Allowed values :
"png""jpeg""webp"
qualityoptional
integer

Sets image detail level. Use 80 for web content, 100 for high-quality prints.

Default: 90Range: 10 - 100
seedoptional
integer

Seed controls image uniqueness. Use -1 for new variations or a fixed number for consistency.

Default: -1

Response Type

Returns: Text/JSON

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