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
40
41
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/ai-product-photography";
const data = {
"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",
"lighting_prompt": "natural day lighting, shadows",
"negative_prompt": "CGI, Unreal, Airbrushed, Digital, Blur",
"image": "toB64('https://segmind-sd-models.s3.us-east-1.amazonaws.com/display_images/ppv5-ip-v2.jpg')",
"megapixel": 1,
"aspect_ratio": "8:5 (Cinematic View)",
"x_value": 50,
"y_value": 65,
"scale": 0.7,
"steps": 10,
"guidance_scale": 2,
"seed": 98522,
"detailer_mode": "soft_light",
"lighting": false,
"detailtransfer": false,
"image_format": "png",
"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);
}
})();
The main prompt for the image generation
Additional prompt for lighting and environment
Negative prompt to avoid unwanted elements
URL of the product image
Select the megapixel setting
Allowed values:
Aspect ratio for image generation
Allowed values:
X-axis coordinate value
min : 1,
max : 100
Y-axis coordinate value
min : 1,
max : 100
Scaling factor
min : 0,
max : 1
Number of inference steps
min : 1,
max : 20
Guidance scale for controlling how closely the generation matches the prompt
min : 1,
max : 20
Random seed for image generation (-1 for random)
Mode for detail restoration
Allowed values:
Enable lighting enhancements
Enable detail transfer from input to output
Output image format
Allowed values:
Image quality setting for output
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.
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.
Intuitive Prompt Customization: Create unique, tailored inputs to guide the AI model in generating precisely the images you envision.
Utilize a range of lighting options to showcase your products in their best light, creating an authentic and inviting atmosphere for your product presentations.
Achieve crystal-clear product images which are sharp, detailed, and suitable for various digital platforms and print media.
Fine-tune your images with exact X and Y value adjustments and scale settings. This level of control allows you to achieve the perfect focus and framing for each product, highlighting its best features.
Optimal Aspect Ratio Selection: The model offers a range of aspect ratios for image outputs, each with its own unique characteristics and use cases
Detailer Mode Enhance the depth and nuance of your product images. This feature adds professional-looking enhancements that make your products more appealing and true-to-life.
Cost-Effective Solution: Reduce the need for expensive photography equipment and studio setups.
Time-Saving: Generate multiple product images quickly, streamlining your content creation process.
Consistency: Maintain a uniform look across your product catalog with ease.
Customization: Easily adapt images for different seasons, promotions, or target markets.
Scalability: Create high-quality images for large product catalogs without compromising on quality.