Bria Product Shadow Serverless API
Bria Product Shadow enhances product images with realistic shadows for professional eCommerce presentations.
POST /v2/bria-product-shadow · submit + poll 1# pip install "segmind>=1.1.0"
2# export SEGMIND_API_KEY="YOUR_API_KEY"
3import segmind
4
5# Async (v2): submit to the queue and block until COMPLETED.
6# run() returns the final result dict (600s deadline, 1.0s poll by default).
7result = segmind.run(
8 "bria-product-shadow",
9 image_url="https://segmind-resources.s3.amazonaws.com/input/a146bc0b-0223-444b-850b-08271689e74e-bae580eab92a46be381d5d16e53a82c9.jpeg",
10 type="regular",
11 background_color="#8C92AC",
12 shadow_color="#000000",
13 shadow_intensity=75,
14 preserve_alpha=True,
15)
16print(result["status"]) # COMPLETED
17print(result.get("output")) # model output (e.g. media URL)
18print(result["metrics"]["inference_time"]) # server compute seconds
19
20# --- Or submit + poll manually (track request_id, control the cadence) ---
21from segmind import SegmindClient, InferenceFailed, InferenceTimeout
22
23client = SegmindClient() # reads SEGMIND_API_KEY
24payload = {
25 "image_url": "https://segmind-resources.s3.amazonaws.com/input/a146bc0b-0223-444b-850b-08271689e74e-bae580eab92a46be381d5d16e53a82c9.jpeg",
26 "type": "regular",
27 "background_color": "#8C92AC",
28 "shadow_color": "#000000",
29 "shadow_intensity": 75,
30 "preserve_alpha": True,
31}
32job = client.submit_async("bria-product-shadow", **payload)
33print(job.request_id) # available immediately
34try:
35 result = job.wait(timeout=600, interval=1.0)
36except InferenceTimeout as e:
37 print("still running:", e.request_id)
38except InferenceFailed as e:
39 print("failed:", e.detail) 1# pip install "segmind>=1.1.0"
2# export SEGMIND_API_KEY="YOUR_API_KEY"
3import segmind
4
5# Async (v2): submit to the queue and block until COMPLETED.
6# run() returns the final result dict (600s deadline, 1.0s poll by default).
7result = segmind.run(
8 "bria-product-shadow",
9 image_url="https://segmind-resources.s3.amazonaws.com/input/a146bc0b-0223-444b-850b-08271689e74e-bae580eab92a46be381d5d16e53a82c9.jpeg",
10 type="regular",
11 background_color="#8C92AC",
12 shadow_color="#000000",
13 shadow_intensity=75,
14 preserve_alpha=True,
15)
16print(result["status"]) # COMPLETED
17print(result.get("output")) # model output (e.g. media URL)
18print(result["metrics"]["inference_time"]) # server compute seconds
19
20# --- Or submit + poll manually (track request_id, control the cadence) ---
21from segmind import SegmindClient, InferenceFailed, InferenceTimeout
22
23client = SegmindClient() # reads SEGMIND_API_KEY
24payload = {
25 "image_url": "https://segmind-resources.s3.amazonaws.com/input/a146bc0b-0223-444b-850b-08271689e74e-bae580eab92a46be381d5d16e53a82c9.jpeg",
26 "type": "regular",
27 "background_color": "#8C92AC",
28 "shadow_color": "#000000",
29 "shadow_intensity": 75,
30 "preserve_alpha": True,
31}
32job = client.submit_async("bria-product-shadow", **payload)
33print(job.request_id) # available immediately
34try:
35 result = job.wait(timeout=600, interval=1.0)
36except InferenceTimeout as e:
37 print("still running:", e.request_id)
38except InferenceFailed as e:
39 print("failed:", e.detail)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
Asynchronous requests (v2)
Use Async for video, long-running (>~60s), or high-concurrency workloads; Sync is simplest for fast image & LLM calls. Async submits a request and you poll it to completion.
- 1
POST /v2/bria-product-shadowSubmit — returns request_id, status_url, response_url
- 2
GET /v2/requests/{id}/statusPoll — until COMPLETED or FAILED
- 3
GET /v2/requests/{id}Result — final response body
Status states
- A FAILED request is served as HTTP 422 — the body still carries the error detail.
- An unknown or expired request_id returns HTTP 404.
- Results are retained for 1 hour, then expire.
- Content / RAI blocks surface as FAILED, not a separate state.
- Track completion by polling the status endpoint.
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