POST
javascript
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 const axios = require('axios'); const fs = require('fs'); const path = require('path'); async function toB64(imgPath) { const data = fs.readFileSync(path.resolve(imgPath)); return Buffer.from(data).toString('base64'); } const api_key = "YOUR API-KEY"; const url = "https://api.segmind.com/v1/segmind-scenecraft-v01"; const data = { "image": "toB64('https://segmind-resources.s3.amazonaws.com/input/ea6c55f7-f97d-49e4-964f-09cfd27082f5-sofa_WSFABLZPN3FRAB_2.png')", "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.", "negative_prompt": "blur, CGI, animated", "seed": -1, "steps": 40, "guidance_scale": 7, "x_value": 50, "y_value": 50, "scale": 0.65, "megapixel": 1.5, "aspect_ratio": "16:9 (Panorama)", "dropshadow": true, "upscale": false, "image_format": "jpeg", "image_quality": 90 }; (async function() { try { const response = await axios.post(url, data, { headers: { 'x-api-key': api_key } }); console.log(response.data); } catch (error) { console.error('Error:', error.response.data); } })();
RESPONSE
image/jpeg
HTTP Response Codes
200 - OKImage Generated
401 - UnauthorizedUser authentication failed
404 - Not FoundThe requested URL does not exist
405 - Method Not AllowedThe requested HTTP method is not allowed
406 - Not AcceptableNot enough credits
500 - Server ErrorServer had some issue with processing

Attributes


imageimage *

Specifies the URL for the product image. Use high-quality images for best results.


promptstr *

Main directive for generating the image. Use specific requests for detailed images.


negative_promptstr ( default: blur, CGI, animated )

Specifies elements to avoid in the image. Useful for excluding undesired features.


seedint ( default: -1 )

Seed number for reproducibility in image generation. Use -1 for random variance.


stepsint ( default: 40 )

Defines the granularity of image generation. More steps result in finer detail.

min : 1,

max : 50


guidance_scalefloat ( default: 7 )

Controls how closely the image matches the prompt. Higher values increase prompt adherence.

min : 1,

max : 20


x_valuefloat ( default: 50 )

X-axis coordinate for image positioning. Adjust for specific scene framing.

min : 1,

max : 100


y_valuefloat ( default: 50 )

Y-axis coordinate for image positioning. Use to modify vertical framing.

min : 1,

max : 100


scalefloat ( default: 0.65 )

Adjusts the size of the generated image. Fine-tune the scale for detail or abstraction.

min : 0,

max : 1


megapixelenum:str ( default: 1.5 )

Sets the image resolution in megapixels. Use higher settings for crisp images.

Allowed values:


aspect_ratioenum:str ( default: 16:9 (Panorama) )

Determines the image's width-to-height ratio. Choose based on the desired output shape.

Allowed values:


dropshadowbool ( default: true )

Adds a shadow for depth perception. Ideal for enhancing image realism.


upscalebool ( default: 1 )

Increases the image resolution for sharper outputs. Recommended for print-quality images.


image_formatenum:str ( default: jpeg )

Selects the output file format. Use PNG for lossless quality.

Allowed values:


image_qualityint ( default: 90 )

Determines the compression level; higher values retain more detail.

min : 10,

max : 100

To keep track of your credit usage, you can inspect the response headers of each API call. The x-remaining-credits property will indicate the number of remaining credits in your account. Ensure you monitor this value to avoid any disruptions in your API usage.

Discovering Segmind SceneCraft v0.1: Elevate Product Photography with Generative AI

SceneCraft is a generative AI model by Segmind designed to transform isolated product images into visually compelling, photorealistic scenes. Whether you're working with a product on a plain white background or need to elevate existing shots, SceneCraft intelligently builds natural environments around the object. It understands spatial context, lighting dynamics, and stylistic cues to generate high-quality lifestyle or contextual visuals that look like they were captured by a professional photographer. This makes it ideal for e-commerce, social media ads, and catalog design, where visual appeal directly impacts conversion.

SceneCraft works with a variety of product types: from furniture and home decor to electronics and packaged goods. Users can guide the output using simple prompts to control the style of the scene: cozy living room, modern office, rustic kitchen, and more. The model supports variations such as close-up views, scene changes, and even seasonal or thematic adaptations. With built-in realism and design intelligence, SceneCraft eliminates the need for physical staging or 3D mockups, helping brands create rich, consistent imagery at scale with just one click.