Bria Lifestyle Product Shot by Text Serverless API
Transform isolated product images into dynamic lifestyle scenes with AI-driven contextual realism.
1import requests
2import json
3
4url = "https://api.segmind.com/v1/bria-lifestyle-shot-by-text"
5headers = {
6 "x-api-key": "YOUR_API_KEY",
7 "Content-Type": "application/json"
8}
9
10data = {
11 "fast": true,
12 "image_url": "https://segmind-resources.s3.amazonaws.com/input/e7c734c4-9c4a-42f6-8df0-dc946b863191-45d0cf11ce028ea08ddf7aca1c2c38ad.jpeg",
13 "scene_description": "A classroom setting with desks and books",
14 "optimize_description": true,
15 "exclude_elements": "no people",
16 "placement_type": "automatic",
17 "original_quality": false,
18 "force_rmbg": false,
19 "content_moderation": false
20}
21
22response = requests.post(url, headers=headers, json=data)
23
24if response.status_code == 200:
25 result = response.json()
26 print(json.dumps(result, indent=2))
27else:
28 print(f"Error: {response.status_code}")
29 print(response.text) 1import requests
2import json
3
4url = "https://api.segmind.com/v1/bria-lifestyle-shot-by-text"
5headers = {
6 "x-api-key": "YOUR_API_KEY",
7 "Content-Type": "application/json"
8}
9
10data = {
11 "fast": true,
12 "image_url": "https://segmind-resources.s3.amazonaws.com/input/e7c734c4-9c4a-42f6-8df0-dc946b863191-45d0cf11ce028ea08ddf7aca1c2c38ad.jpeg",
13 "scene_description": "A classroom setting with desks and books",
14 "optimize_description": true,
15 "exclude_elements": "no people",
16 "placement_type": "automatic",
17 "original_quality": false,
18 "force_rmbg": false,
19 "content_moderation": false
20}
21
22response = requests.post(url, headers=headers, json=data)
23
24if response.status_code == 200:
25 result = response.json()
26 print(json.dumps(result, indent=2))
27else:
28 print(f"Error: {response.status_code}")
29 print(response.text)API Endpoint
https://api.segmind.com/v1/bria-lifestyle-shot-by-textParameters
aspect_ratiooptionalstringDefines output image proportions. Set '16:9' for widescreen or '1:1' for a square frame.
"1:1""2:3""3:2""3:4""4:3""4:5""5:4""9:16""16:9"content_moderationoptionalbooleanApplies moderation to visuals. Enable for content checks before generation or disable for faster processing.
falseexclude_elementsoptionalstringSpecifies elements to exclude from the scene. Use 'no people' to remove human figures.
"no people"fastoptionalbooleanFast mode balances speed and quality. Set to true for quick generation or false for detailed results.
trueforce_rmbgoptionalbooleanForces removal of backgrounds. Use true to cleanly isolate product images from noisy backgrounds.
falseimage_urloptionalstring (uri)URL of the product image to blend in a scene. Use high-res images for quality outputs.
"https://segmind-resources.s3.amazonaws.com/input/e7c734c4-9c4a-42f6-8df0-dc946b863191-45d0cf11ce028ea08ddf7aca1c2c38ad.jpeg"optimize_descriptionoptionalbooleanEnables AI to enhance scene details. Set true to enhance scene realism or false to use the basic description.
trueoriginal_qualityoptionalbooleanMaintains image quality if true. Toggle on to preserve details in original placement mode.
falseplacement_typeoptionalstringDetermines product placement control. Choose 'original' for fixed spots or 'automatic' for varied angles.
"automatic""original""automatic""manual_placement""manual_padding""custom_coordinates""automatic_aspect_ratio"scene_descriptionoptionalstringDescribes the scene for the product. Use vivid settings like 'modern office desk' for best results.
"A classroom setting with desks and books"skuoptionalstringOptional SKU identifier for tracking products. Use unique codes for easier inventory management.
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