Qwen Image 2512 Serverless API

Qwen-Image-2512 generates highly realistic images from text descriptions, excelling in human depiction and environmental detail.

~19.74s
~$0.014
 1import requests
 2import json
 3
 4url = "https://api.segmind.com/v1/qwen-image-2512"
 5headers = {
 6    "x-api-key": "YOUR_API_KEY",
 7    "Content-Type": "application/json"
 8}
 9
10data = {
11    "prompt": "A 20-year-old East Asian girl with delicate, charming features and large, bright brown eyes—expressive and lively, with a cheerful or subtly smiling expression. Her naturally wavy long hair is either loose or tied in twin ponytails. She has fair skin and light makeup accentuating her youthful freshness. She wears a modern, cute dress or relaxed outfit in bright, soft colors—lightweight fabric, minimalist cut. She stands indoors at an anime convention, surrounded by banners, posters, or stalls. Lighting is typical indoor illumination—no staged lighting—and the image resembles a casual iPhone snapshot: unpretentious composition, yet brimming with vivid, fresh, youthful charm.",
12    "steps": 6,
13    "seed": -1,
14    "height": 1024,
15    "width": 1024,
16    "image_format": "webp",
17    "quality": 90,
18    "base_64": 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-2512

Parameters

promptrequired
string

Text prompt describing the desired image

base_64optional
boolean

Return image as base64 encoded string

Default: false
heightoptional
integer

Output image height in pixels

Default: 1024Range: 256 - 2048
image_formatoptional
string

Output image format

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

Output image quality (1-100)

Default: 90Range: 1 - 100
seedoptional
integer

Random seed for reproducibility. Use -1 for random

Default: -1Range: -1 - 92147483647
stepsoptional
integer

Number of inference steps

Default: 6Range: 1 - 75
widthoptional
integer

Output image width in pixels

Default: 1024Range: 256 - 2048

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