Segmind SceneCraft v0.1 Serverless API
SceneCraft transforms plain or existing product images into visually rich, photorealistic scenes. Whether starting from a white background or enhancing existing settings, it works seamlessly across furniture, home decor, and consumer goods.
1import requests
2import json
3
4url = "https://api.segmind.com/v1/segmind-scenecraft-v01"
5headers = {
6 "x-api-key": "YOUR_API_KEY",
7 "Content-Type": "application/json"
8}
9
10data = {
11 "image": "https://segmind-resources.s3.amazonaws.com/input/ea6c55f7-f97d-49e4-964f-09cfd27082f5-sofa_WSFABLZPN3FRAB_2.png",
12 "prompt": "Create a close-up and mid-range product shot of a modern living room sofa with a matte fabric texture and detailed stitching. The scene is set in a warm, cozy living space with soft ambient lighting coming from a side window filtered through sheer linen curtains. Accentuate the sofa’s contours with gentle, natural shadows and subtle reflections on nearby decor elements like a coffee table and floor lamp. Use a color palette dominated by earthy tones — warm beige, soft greys, and muted olive — to create a harmonious and inviting atmosphere. Include a minimalistic rug, wooden flooring, and a few aesthetic accessories like throw pillows and a blanket to enhance lifestyle appeal. Emphasize depth of field for a realistic photographic finish.",
13 "negative_prompt": "blur, CGI, animated",
14 "seed": -1,
15 "steps": 40,
16 "guidance_scale": 7,
17 "x_value": 50,
18 "y_value": 50,
19 "scale": 0.65,
20 "megapixel": "1.5",
21 "aspect_ratio": "16:9 (Panorama)",
22 "dropshadow": true,
23 "upscale": false,
24 "image_format": "jpeg",
25 "image_quality": 90
26}
27
28response = requests.post(url, headers=headers, json=data)
29
30if response.status_code == 200:
31 result = response.json()
32 print(json.dumps(result, indent=2))
33else:
34 print(f"Error: {response.status_code}")
35 print(response.text) 1import requests
2import json
3
4url = "https://api.segmind.com/v1/segmind-scenecraft-v01"
5headers = {
6 "x-api-key": "YOUR_API_KEY",
7 "Content-Type": "application/json"
8}
9
10data = {
11 "image": "https://segmind-resources.s3.amazonaws.com/input/ea6c55f7-f97d-49e4-964f-09cfd27082f5-sofa_WSFABLZPN3FRAB_2.png",
12 "prompt": "Create a close-up and mid-range product shot of a modern living room sofa with a matte fabric texture and detailed stitching. The scene is set in a warm, cozy living space with soft ambient lighting coming from a side window filtered through sheer linen curtains. Accentuate the sofa’s contours with gentle, natural shadows and subtle reflections on nearby decor elements like a coffee table and floor lamp. Use a color palette dominated by earthy tones — warm beige, soft greys, and muted olive — to create a harmonious and inviting atmosphere. Include a minimalistic rug, wooden flooring, and a few aesthetic accessories like throw pillows and a blanket to enhance lifestyle appeal. Emphasize depth of field for a realistic photographic finish.",
13 "negative_prompt": "blur, CGI, animated",
14 "seed": -1,
15 "steps": 40,
16 "guidance_scale": 7,
17 "x_value": 50,
18 "y_value": 50,
19 "scale": 0.65,
20 "megapixel": "1.5",
21 "aspect_ratio": "16:9 (Panorama)",
22 "dropshadow": true,
23 "upscale": false,
24 "image_format": "jpeg",
25 "image_quality": 90
26}
27
28response = requests.post(url, headers=headers, json=data)
29
30if response.status_code == 200:
31 result = response.json()
32 print(json.dumps(result, indent=2))
33else:
34 print(f"Error: {response.status_code}")
35 print(response.text)API Endpoint
https://api.segmind.com/v1/segmind-scenecraft-v01Parameters
imagerequiredstring (uri)Specifies the URL for the product image. Use high-quality images for best results.
"https://segmind-resources.s3.amazonaws.com/input/ea6c55f7-f97d-49e4-964f-09cfd27082f5-sofa_WSFABLZPN3FRAB_2.png"promptrequiredstringMain directive for generating the image. Use specific requests for detailed images.
"Create a close-up and mid-range product shot of a modern living room sofa with a matte fabric texture and detailed stitching. The scene is set in a warm, cozy living space with soft ambient lighting coming from a side window filtered through sheer linen curtains. Accentuate the sofa’s contours with gentle, natural shadows and subtle reflections on nearby decor elements like a coffee table and floor lamp. Use a color palette dominated by earthy tones — warm beige, soft greys, and muted olive — to create a harmonious and inviting atmosphere. Include a minimalistic rug, wooden flooring, and a few aesthetic accessories like throw pillows and a blanket to enhance lifestyle appeal. Emphasize depth of field for a realistic photographic finish."aspect_ratiooptionalstringDetermines the image's width-to-height ratio. Choose based on the desired output shape.
"16:9 (Panorama)""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 moredropshadowoptionalbooleanAdds a shadow for depth perception. Ideal for enhancing image realism.
trueguidance_scaleoptionalnumberControls how closely the image matches the prompt. Higher values increase prompt adherence.
7Range: 1 - 20image_formatoptionalstringSelects the output file format. Use PNG for lossless quality.
"jpeg""png""jpeg""webp"image_qualityoptionalintegerDetermines the compression level; higher values retain more detail.
90Range: 10 - 100megapixeloptionalnumberSets the image resolution in megapixels. Use higher settings for crisp images.
1.50.10.511.522.12.22.32.42.5negative_promptoptionalstringSpecifies elements to avoid in the image. Useful for excluding undesired features.
"blur, CGI, animated"scaleoptionalnumberAdjusts the size of the generated image. Fine-tune the scale for detail or abstraction.
0.65Range: 0 - 1seedoptionalintegerSeed number for reproducibility in image generation. Use -1 for random variance.
-1stepsoptionalintegerDefines the granularity of image generation. More steps result in finer detail.
40Range: 1 - 50upscaleoptionalbooleanIncreases the image resolution for sharper outputs. Recommended for print-quality images.
falsex_valueoptionalnumberX-axis coordinate for image positioning. Adjust for specific scene framing.
50Range: 1 - 100y_valueoptionalnumberY-axis coordinate for image positioning. Use to modify vertical framing.
50Range: 1 - 100Response 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