AI Product Photography Serverless API
Elevate your product imagery with our AI-powered photography model. Create stunning, professional-quality photos that boost engagement and sales. Perfect for e-commerce and digital marketing.
POST /v2/ai-product-photography · 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 "ai-product-photography",
9 prompt="A modern living room with a vibrant orange mid-century modern sofa as the centerpiece, featuring clean lines, soft cushions, and fabric upholstery in a bold sunflower-orange hue, sitting on light wooden legs. The sofa is placed on a neutral beige area rug, surrounded by Scandinavian-style furniture, including a small white coffee table with a green potted plant. The background showcases white walls with abstract artwork and a large window letting in natural light. Subtle shadows and warm, diffused sunlight illuminate the room, highlighting the textures of the fabric and wood. Created using: Canon EOS 5D, soft-focus lens, mid-century modern aesthetic, Scandinavian design, HDR, high-contrast light, ultra-sharp detailing, natural materials",
10 lighting_prompt="natural day lighting, shadows",
11 negative_prompt="CGI, Unreal, Airbrushed, Digital, Blur",
12 image="https://segmind-sd-models.s3.us-east-1.amazonaws.com/display_images/ppv5-ip-v2.jpg",
13 megapixel="1.0",
14 aspect_ratio="8:5 (Cinematic View)",
15 x_value=50,
16 y_value=65,
17 scale=0.7,
18 steps=10,
19 guidance_scale=2,
20 seed=98522,
21 detailer_mode="soft_light",
22 lighting=False,
23 detailtransfer=False,
24 image_format="png",
25 image_quality=90,
26)
27print(result["status"]) # COMPLETED
28print(result.get("output")) # model output (e.g. media URL)
29print(result["metrics"]["inference_time"]) # server compute seconds
30
31# --- Or submit + poll manually (track request_id, control the cadence) ---
32from segmind import SegmindClient, InferenceFailed, InferenceTimeout
33
34client = SegmindClient() # reads SEGMIND_API_KEY
35payload = {
36 "prompt": "A modern living room with a vibrant orange mid-century modern sofa as the centerpiece, featuring clean lines, soft cushions, and fabric upholstery in a bold sunflower-orange hue, sitting on light wooden legs. The sofa is placed on a neutral beige area rug, surrounded by Scandinavian-style furniture, including a small white coffee table with a green potted plant. The background showcases white walls with abstract artwork and a large window letting in natural light. Subtle shadows and warm, diffused sunlight illuminate the room, highlighting the textures of the fabric and wood. Created using: Canon EOS 5D, soft-focus lens, mid-century modern aesthetic, Scandinavian design, HDR, high-contrast light, ultra-sharp detailing, natural materials",
37 "lighting_prompt": "natural day lighting, shadows",
38 "negative_prompt": "CGI, Unreal, Airbrushed, Digital, Blur",
39 "image": "https://segmind-sd-models.s3.us-east-1.amazonaws.com/display_images/ppv5-ip-v2.jpg",
40 "megapixel": "1.0",
41 "aspect_ratio": "8:5 (Cinematic View)",
42 "x_value": 50,
43 "y_value": 65,
44 "scale": 0.7,
45 "steps": 10,
46 "guidance_scale": 2,
47 "seed": 98522,
48 "detailer_mode": "soft_light",
49 "lighting": False,
50 "detailtransfer": False,
51 "image_format": "png",
52 "image_quality": 90,
53}
54job = client.submit_async("ai-product-photography", **payload)
55print(job.request_id) # available immediately
56try:
57 result = job.wait(timeout=600, interval=1.0)
58except InferenceTimeout as e:
59 print("still running:", e.request_id)
60except InferenceFailed as e:
61 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 "ai-product-photography",
9 prompt="A modern living room with a vibrant orange mid-century modern sofa as the centerpiece, featuring clean lines, soft cushions, and fabric upholstery in a bold sunflower-orange hue, sitting on light wooden legs. The sofa is placed on a neutral beige area rug, surrounded by Scandinavian-style furniture, including a small white coffee table with a green potted plant. The background showcases white walls with abstract artwork and a large window letting in natural light. Subtle shadows and warm, diffused sunlight illuminate the room, highlighting the textures of the fabric and wood. Created using: Canon EOS 5D, soft-focus lens, mid-century modern aesthetic, Scandinavian design, HDR, high-contrast light, ultra-sharp detailing, natural materials",
10 lighting_prompt="natural day lighting, shadows",
11 negative_prompt="CGI, Unreal, Airbrushed, Digital, Blur",
12 image="https://segmind-sd-models.s3.us-east-1.amazonaws.com/display_images/ppv5-ip-v2.jpg",
13 megapixel="1.0",
14 aspect_ratio="8:5 (Cinematic View)",
15 x_value=50,
16 y_value=65,
17 scale=0.7,
18 steps=10,
19 guidance_scale=2,
20 seed=98522,
21 detailer_mode="soft_light",
22 lighting=False,
23 detailtransfer=False,
24 image_format="png",
25 image_quality=90,
26)
27print(result["status"]) # COMPLETED
28print(result.get("output")) # model output (e.g. media URL)
29print(result["metrics"]["inference_time"]) # server compute seconds
30
31# --- Or submit + poll manually (track request_id, control the cadence) ---
32from segmind import SegmindClient, InferenceFailed, InferenceTimeout
33
34client = SegmindClient() # reads SEGMIND_API_KEY
35payload = {
36 "prompt": "A modern living room with a vibrant orange mid-century modern sofa as the centerpiece, featuring clean lines, soft cushions, and fabric upholstery in a bold sunflower-orange hue, sitting on light wooden legs. The sofa is placed on a neutral beige area rug, surrounded by Scandinavian-style furniture, including a small white coffee table with a green potted plant. The background showcases white walls with abstract artwork and a large window letting in natural light. Subtle shadows and warm, diffused sunlight illuminate the room, highlighting the textures of the fabric and wood. Created using: Canon EOS 5D, soft-focus lens, mid-century modern aesthetic, Scandinavian design, HDR, high-contrast light, ultra-sharp detailing, natural materials",
37 "lighting_prompt": "natural day lighting, shadows",
38 "negative_prompt": "CGI, Unreal, Airbrushed, Digital, Blur",
39 "image": "https://segmind-sd-models.s3.us-east-1.amazonaws.com/display_images/ppv5-ip-v2.jpg",
40 "megapixel": "1.0",
41 "aspect_ratio": "8:5 (Cinematic View)",
42 "x_value": 50,
43 "y_value": 65,
44 "scale": 0.7,
45 "steps": 10,
46 "guidance_scale": 2,
47 "seed": 98522,
48 "detailer_mode": "soft_light",
49 "lighting": False,
50 "detailtransfer": False,
51 "image_format": "png",
52 "image_quality": 90,
53}
54job = client.submit_async("ai-product-photography", **payload)
55print(job.request_id) # available immediately
56try:
57 result = job.wait(timeout=600, interval=1.0)
58except InferenceTimeout as e:
59 print("still running:", e.request_id)
60except InferenceFailed as e:
61 print("failed:", e.detail)API Endpoint
https://api.segmind.com/v1/ai-product-photographyParameters
imagerequiredstring (uri)URL of the product image
"https://segmind-sd-models.s3.us-east-1.amazonaws.com/display_images/ppv5-ip-v2.jpg"promptrequiredstringThe main prompt for the image generation
"A modern living room with a vibrant orange mid-century modern sofa as the centerpiece, featuring clean lines, soft cushions, and fabric upholstery in a bold sunflower-orange hue, sitting on light wooden legs. The sofa is placed on a neutral beige area rug, surrounded by Scandinavian-style furniture, including a small white coffee table with a green potted plant. The background showcases white walls with abstract artwork and a large window letting in natural light. Subtle shadows and warm, diffused sunlight illuminate the room, highlighting the textures of the fabric and wood. Created using: Canon EOS 5D, soft-focus lens, mid-century modern aesthetic, Scandinavian design, HDR, high-contrast light, ultra-sharp detailing, natural materials"aspect_ratiooptionalstringAspect ratio for image generation
"8:5 (Cinematic View)""1:1 (Perfect Square)""2:3 (Classic Portrait)""3:4 (Golden Ratio)""3:5 (Elegant Vertical)""4:5 (Artistic Frame)""5:7 (Balanced Portrait)""5:8 (Tall Portrait)""7:9 (Modern Portrait)""9:16 (Slim Vertical)""9:19 (Tall Slim)"+13 moredetailer_modeoptionalstringMode for detail restoration
"soft_light""add""multiply""screen""overlay""soft_light""hard_light""color_dodge""color_burn""difference""exclusion"+1 moredetailtransferoptionalbooleanEnable detail transfer from input to output
trueguidance_scaleoptionalintegerGuidance scale for controlling how closely the generation matches the prompt
2Range: 1 - 20image_formatoptionalstringOutput image format
"png""jpeg""png""webp"image_qualityoptionalintegerImage quality setting for output
90Range: 10 - 100lightingoptionalbooleanEnable lighting enhancements
truelighting_promptoptionalstringAdditional prompt for lighting and environment
"natural day lighting, shadows"megapixeloptionalnumberSelect the megapixel setting
10.10.511.522.12.22.32.42.5negative_promptoptionalstringNegative prompt to avoid unwanted elements
"CGI, Unreal, Airbrushed, Digital, Blur"scaleoptionalnumberScaling factor
0.63Range: 0 - 1seedoptionalintegerRandom seed for image generation (-1 for random)
-1stepsoptionalintegerNumber of inference steps
8Range: 1 - 20x_valueoptionalnumberX-axis coordinate value
50Range: 1 - 100y_valueoptionalnumberY-axis coordinate value
65Range: 1 - 100Response 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/ai-product-photographySubmit — 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