Qwen Image Edit Serverless API
Transform images effortlessly through semantic context and pixel-perfect appearance changes.
1import requests
2import json
3
4url = "https://api.segmind.com/v1/qwen-image-edit"
5headers = {
6 "x-api-key": "YOUR_API_KEY",
7 "Content-Type": "application/json"
8}
9
10data = {
11 "prompt": "sample text",
12 "negative_prompt": "None",
13 "steps": 30,
14 "seed": 760941192,
15 "base64": false
16}
17
18response = requests.post(url, headers=headers, json=data)
19
20if response.status_code == 200:
21 result = response.json()
22 print(json.dumps(result, indent=2))
23else:
24 print(f"Error: {response.status_code}")
25 print(response.text) 1import requests
2import json
3
4url = "https://api.segmind.com/v1/qwen-image-edit"
5headers = {
6 "x-api-key": "YOUR_API_KEY",
7 "Content-Type": "application/json"
8}
9
10data = {
11 "prompt": "sample text",
12 "negative_prompt": "None",
13 "steps": 30,
14 "seed": 760941192,
15 "base64": false
16}
17
18response = requests.post(url, headers=headers, json=data)
19
20if response.status_code == 200:
21 result = response.json()
22 print(json.dumps(result, indent=2))
23else:
24 print(f"Error: {response.status_code}")
25 print(response.text)API Endpoint
https://api.segmind.com/v1/qwen-image-editParameters
imagerequiredimageInput Image URL or file reference.
promptrequiredstringDescribes what to edit in the image
base64optionalbooleanOutputs base64. True if image as text needed.
falseguidanceoptionalfloatInfluence of prompt. Use 4 for stronger control.
4Range: 1 - 25negative_promptoptionalstringAvoid specific traits. 'Avoid noise' removes unwanted noise.
"None"seedoptionalintegerSeed stabilizes output. Try -1 for randomness.
760941192Range: -1 - 999999999999999stepsoptionalintegerAdjust denoising steps. Use 50 for more detail.
30Range: 10 - 100Response 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