Segmind Relighting Serverless API
Prompts to auto-magically relight your images.
~10.34s
$0.05 per generation
1import requests
2import json
3
4url = "https://api.segmind.com/v1/segmind-relighting"
5headers = {
6 "x-api-key": "YOUR_API_KEY",
7 "Content-Type": "application/json"
8}
9
10data = {
11 "image": "https://segmind-resources.s3.amazonaws.com/output/53d92d7d-b9fe-49e4-a1b8-84fcac2c396a-dull_image.jpg",
12 "light_direction": "top",
13 "light_type": "ambient",
14 "light_temperature": "neutral",
15 "light_intensity": "medium"
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/segmind-relighting"
5headers = {
6 "x-api-key": "YOUR_API_KEY",
7 "Content-Type": "application/json"
8}
9
10data = {
11 "image": "https://segmind-resources.s3.amazonaws.com/output/53d92d7d-b9fe-49e4-a1b8-84fcac2c396a-dull_image.jpg",
12 "light_direction": "top",
13 "light_type": "ambient",
14 "light_temperature": "neutral",
15 "light_intensity": "medium"
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
POST
https://api.segmind.com/v1/segmind-relightingParameters
imagerequiredstring (uri)Input Image.
light_directionrequiredstringSpecifies direction of the light coming in.
Default:
"top"Allowed values :
"left""right""top""back"light_intensityrequiredstringSpecifies the intensity of the light coming in.
Default:
"medium"Allowed values :
"mood""bright""medium""strong"light_temperaturerequiredstringSpecifies temprature or color of the light coming in.
Default:
"neutral"Allowed values :
"warm""cool""neutral""sunset"light_typerequiredstringSpecifies source of the light coming in.
Default:
"ambient"Allowed values :
"softbox""sunlight""spotlight""ambient"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