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.

~11.67s
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)

API Endpoint

POSThttps://api.segmind.com/v1/ai-product-photography

Parameters

imagerequired
string (uri)

URL of the product image

Default: "https://segmind-sd-models.s3.us-east-1.amazonaws.com/display_images/ppv5-ip-v2.jpg"
promptrequired
string

The main prompt for the image generation

Default: "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_ratiooptional
string

Aspect ratio for image generation

Default: "8:5 (Cinematic View)"
Allowed values (23 total):
"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 more
detailer_modeoptional
string

Mode for detail restoration

Default: "soft_light"
Allowed values (11 total):
"add""multiply""screen""overlay""soft_light""hard_light""color_dodge""color_burn""difference""exclusion"+1 more
detailtransferoptional
boolean

Enable detail transfer from input to output

Default: true
guidance_scaleoptional
integer

Guidance scale for controlling how closely the generation matches the prompt

Default: 2Range: 1 - 20
image_formatoptional
string

Output image format

Default: "png"
Allowed values :
"jpeg""png""webp"
image_qualityoptional
integer

Image quality setting for output

Default: 90Range: 10 - 100
lightingoptional
boolean

Enable lighting enhancements

Default: true
lighting_promptoptional
string

Additional prompt for lighting and environment

Default: "natural day lighting, shadows"
megapixeloptional
number

Select the megapixel setting

Default: 1
Allowed values :
0.10.5
1.01
1.5
2.02
2.12.22.32.42.5
negative_promptoptional
string

Negative prompt to avoid unwanted elements

Default: "CGI, Unreal, Airbrushed, Digital, Blur"
scaleoptional
number

Scaling factor

Default: 0.63Range: 0 - 1
seedoptional
integer

Random seed for image generation (-1 for random)

Default: -1
stepsoptional
integer

Number of inference steps

Default: 8Range: 1 - 20
x_valueoptional
number

X-axis coordinate value

Default: 50Range: 1 - 100
y_valueoptional
number

Y-axis coordinate value

Default: 65Range: 1 - 100

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. 1
    POST /v2/ai-product-photography

    Submitreturns request_id, status_url, response_url

  2. 2
    GET /v2/requests/{id}/status

    Polluntil COMPLETED or FAILED

  3. 3
    GET /v2/requests/{id}

    Resultfinal response body

Status states

QUEUEDAccepted, waiting for a worker
PROCESSINGRunning on a worker
COMPLETEDDone — result body is ready
FAILEDErrored (incl. content/RAI blocks)
  • 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.

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