Qwen Image Edit Plus Remove Lighting Serverless API
Automatically restores natural lighting and removes artificial effects for stunning, professional-quality images.
1import requests
2import json
3
4url = "https://api.segmind.com/v1/qwen-image-edit-plus-remove-lighting"
5headers = {
6 "x-api-key": "YOUR_API_KEY",
7 "Content-Type": "application/json"
8}
9
10data = {
11 "prompt": "Remove the shadows and use soft lighting to relight the image.",
12 "image_1": "https://segmind-resources.s3.amazonaws.com/input/e06e09ba-08d7-4812-bb76-315f8a64ca4d-Woman-with-shadow-of-hand-across-face-is20210206_Julia_Ali1266.jpg",
13 "lora": "remove_lighting",
14 "aspect_ratio": "match_input_image",
15 "seed": 87568756,
16 "image_format": "webp",
17 "quality": 95,
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-plus-remove-lighting"
5headers = {
6 "x-api-key": "YOUR_API_KEY",
7 "Content-Type": "application/json"
8}
9
10data = {
11 "prompt": "Remove the shadows and use soft lighting to relight the image.",
12 "image_1": "https://segmind-resources.s3.amazonaws.com/input/e06e09ba-08d7-4812-bb76-315f8a64ca4d-Woman-with-shadow-of-hand-across-face-is20210206_Julia_Ali1266.jpg",
13 "lora": "remove_lighting",
14 "aspect_ratio": "match_input_image",
15 "seed": 87568756,
16 "image_format": "webp",
17 "quality": 95,
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-plus-remove-lightingParameters
promptrequiredstringText prompt describing the desired image edit or generation
aspect_ratiooptionalstringOutput image aspect ratio
"match_input_image""1:1""2:3""3:2""3:4""4:3""4:5""5:4""9:16""16:9""21:9"+1 morebase64optionalbooleanReturn image as base64 encoded string
falseimage_1optionalstring (uri)Primary input image (URL or base64)
nullimage_2optionalstring (uri)Secondary input image (URL or base64)
nullimage_3optionalstring (uri)Tertiary input image (URL or base64)
nullimage_formatoptionalstringOutput image format
"webp""jpeg""png""webp"loraoptionalstringPre-configured LoRA model to apply
"remove_lighting""remove_lighting"lora_2_urloptionalstringAdditional LoRA model URL. Public direct url or huggingface url pointing to the lora file
nulllora_3_urloptionalstringAdditional LoRA model URL. Public direct url or huggingface url pointing to the lora file
nullqualityoptionalintegerOutput image quality (1-100)
95Range: 1 - 100seedoptionalintegerRandom seed for reproducibility. Use -1 for random
nullRange: -1 - 2147483647Response 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