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
const axios = require('axios');
const api_key = "YOUR API-KEY";
const url = "https://api.segmind.com/v1/segmind-relighting-v2";
const data = {
"image": "https://segmind-resources.s3.amazonaws.com/output/b9b4e651-ecfb-4dd8-a121-6663f63cca8e-5e23ecbb-6875-4296-9b05-481c03eac5bf.png",
"light_direction": "back",
"light_type": "spotlight",
"light_temperature": "warm",
"light_intensity": "strong",
"size": "auto",
"quality": "high",
"background": "opaque",
"output_compression": 100,
"output_format": "png"
};
(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);
}
})();
Provide the URL of the image to be relit. Use a URL from cloud storage like S3.
Set the direction of lighting. For dramatic effects, choose 'back' or 'left'.
Allowed values:
Select the lighting source for desired mood. 'Spotlight' creates a focused beam effect.
Allowed values:
Choose light color to affect mood. 'Warm' is cozy while 'cool' suits tech themes.
Allowed values:
Adjust light brightness. Choose 'strong' for well-lit images and 'mood' for softer settings.
Allowed values:
Determine output resolution. 'Auto' allows the model to decide optimal resolution.
Allowed values:
Set visual quality of the output image. 'High' suits professional needs.
Allowed values:
Select if the image background should be transparent or not; 'opaque' for regular use.
Allowed values:
Adjust compression level. Lower numbers mean smaller file size but risk quality loss.
Decide the format for the output image; 'webp' for balanced quality and size.
Allowed values:
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.
Segmind Relighting V2 is a cutting-edge AI model developed to transform image lighting with photorealistic finesse. Built upon the robust IC-Light architecture, it offers users the ability to fine-tune lighting conditions using simple text prompts, providing unparalleled creative flexibility for developers, creators, and executives alike.
With Segmind Relighting V2, users can intuitively specify the direction, type, color, and intensity of lighting through natural language prompts. This functionality simplifies the creative process, allowing creators to experiment with lighting scenarios without extensive manual adjustments. For developers, the inclusion of text-conditioned input facilitates seamless integration into existing digital workflows.
Maintaining the integrity of details, texture, and tonal balance, Segmind Relighting V2 excels in producing images where the lighting appears natural and cohesive. This feature is particularly beneficial for industries such as digital art and product visualization where visual authenticity is paramount.
The model's interoperability with tools like SDXL ControlNet and CodeFormer paves the way for comprehensive creative pipelines. Whether it’s enhancing photographs, prototyping film scenes, or animating sequences, Segmind Relighting V2 can adapt to a variety of tasks and improve production efficiency.
To maximize the model's potential, specificity in text prompts is crucial. Gradual changes allow for fine-tuning and avoid potential artifacts. For large-scale projects, such as product catalogs or digital art collections, batch processing can ensure consistent relighting across multiple images.
Segmind Relighting V2 stands as a powerful tool, delivering ease of use, seamlessly integrated lighting changes, and adaptability, thus empowering your projects with remarkable visual enhancements tailored to specific creative and business needs.