Bria Product Shadow Serverless API
Bria Product Shadow enhances product images with realistic shadows for professional eCommerce presentations.
1import requests
2import json
3
4url = "https://api.segmind.com/v1/bria-product-shadow"
5headers = {
6 "x-api-key": "YOUR_API_KEY",
7 "Content-Type": "application/json"
8}
9
10data = {
11 "image_url": "https://segmind-resources.s3.amazonaws.com/input/a146bc0b-0223-444b-850b-08271689e74e-bae580eab92a46be381d5d16e53a82c9.jpeg",
12 "type": "regular",
13 "background_color": "#8C92AC",
14 "shadow_color": "#000000",
15 "shadow_intensity": 75,
16 "preserve_alpha": true
17}
18
19response = requests.post(url, headers=headers, json=data)
20
21if response.status_code == 200:
22 result = response.json()
23 print(json.dumps(result, indent=2))
24else:
25 print(f"Error: {response.status_code}")
26 print(response.text) 1import requests
2import json
3
4url = "https://api.segmind.com/v1/bria-product-shadow"
5headers = {
6 "x-api-key": "YOUR_API_KEY",
7 "Content-Type": "application/json"
8}
9
10data = {
11 "image_url": "https://segmind-resources.s3.amazonaws.com/input/a146bc0b-0223-444b-850b-08271689e74e-bae580eab92a46be381d5d16e53a82c9.jpeg",
12 "type": "regular",
13 "background_color": "#8C92AC",
14 "shadow_color": "#000000",
15 "shadow_intensity": 75,
16 "preserve_alpha": true
17}
18
19response = requests.post(url, headers=headers, json=data)
20
21if response.status_code == 200:
22 result = response.json()
23 print(json.dumps(result, indent=2))
24else:
25 print(f"Error: {response.status_code}")
26 print(response.text)API Endpoint
https://api.segmind.com/v1/bria-product-shadowParameters
background_coloroptionalstringBackground color for image as hex code. Use '#FFFFFF' for white background.
"#8C92AC"content_moderationoptionalbooleanCheck for inappropriate content. Use 'true' for screening.
falseforce_rmbgoptionalbooleanRemove background even if alpha exists. Use 'true' to force.
falseimage_urloptionalstring (uri)URL for product image with transparent background. Example: use 'png' for optimal results.
"https://segmind-resources.s3.amazonaws.com/input/a146bc0b-0223-444b-850b-08271689e74e-bae580eab92a46be381d5d16e53a82c9.jpeg"preserve_alphaoptionalbooleanKeep transparency from input image. Set 'false' to discard.
trueshadow_bluroptionalintegerAdjust shadow blur edges. '10' for sharper look.
15shadow_coloroptionalstringSet shadow color using hex code. Example: '#000000' for black shadow.
"#000000"shadow_heightoptionalintegerControl shadow height, in pixels. Example: '80' for more height.
80shadow_intensityoptionalintegerControl shadow darkness, 0 to 100. Example: '75' for darker shadow.
75Range: 0 - 100shadow_widthoptionalintegerSet shadow width in pixels. Example: '100' for more width.
0skuoptionalstringUnique SKU identifier for product. Example: 'SKU12345'.
typeoptionalstringChoose shadow style: 'regular' or 'float'. Use 'float' for 3D effect.
"regular""regular""float"Response 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