Qwen Image Edit Fast Serverless API
Qwen-Image-Edit enables precise bilingual image editing for seamless localization and professional content creation.
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) 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
https://api.segmind.com/v1/qwen-image-edit-fastParameters
imagerequiredstring (uri)Input Image URL or file reference. Use a recognizable sign for editing text.
promptrequiredstringDescribes what to edit in the image. Be clear about text changes or other edits needed.
stepsrequiredintegerDefines the precision of editing. Use 8 for balanced speed and quality.
8Range: 1 - 20base64optionalbooleanOutputs image as text. Set true if integration with text-based systems needed.
falseguidanceoptionalnumberControls adherence to prompt. Set 4 for stronger influence on changes.
1Range: 1 - 25image_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 - 100seedoptionalintegerEnsures reproducibility of edits. Use -1 for random creative results.
760941192Range: -1 - 999999999999999Response Type
Returns: Image
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