Qwen Image Edit Fast Serverless API

Qwen-Image-Edit enables precise bilingual image editing for seamless localization and professional content creation.

~8.73s
~$0.036
 1import requests
 2import json
 3
 4url = "https://api.segmind.com/v1/qwen-image-edit-fast"
 5headers = {
 6    "x-api-key": "YOUR_API_KEY",
 7    "Content-Type": "application/json"
 8}
 9
10data = {
11    "image": "https://segmind-resources.s3.amazonaws.com/input/354cdf06-8901-4f0c-a9e0-8bf72bcb2859-5769d60b13eeba42135ff0c65db49c14.png",
12    "prompt": "Change '1000$' to '5$' in the poster",
13    "steps": 8,
14    "guidance": 1,
15    "seed": 760941192,
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-edit-fast

Parameters

imagerequired
string (uri)

Input Image URL or file reference. Use a recognizable sign for editing text.

promptrequired
string

Describes what to edit in the image. Be clear about text changes or other edits needed.

stepsrequired
integer

Defines the precision of editing. Use 8 for balanced speed and quality.

Default: 8Range: 1 - 20
base64optional
boolean

Outputs image as text. Set true if integration with text-based systems needed.

Default: false
guidanceoptional
number

Controls adherence to prompt. Set 4 for stronger influence on changes.

Default: 1Range: 1 - 25
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

Ensures reproducibility of edits. Use -1 for random creative results.

Default: 760941192Range: -1 - 999999999999999

Response Type

Returns: Image

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