API
If you're looking for an API, you can choose from your desired programming language.
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
import requests
import base64
# Use this function to convert an image file from the filesystem to base64
def image_file_to_base64(image_path):
with open(image_path, 'rb') as f:
image_data = f.read()
return base64.b64encode(image_data).decode('utf-8')
# Use this function to fetch an image from a URL and convert it to base64
def image_url_to_base64(image_url):
response = requests.get(image_url)
image_data = response.content
return base64.b64encode(image_data).decode('utf-8')
# Use this function to convert a list of image URLs to base64
def image_urls_to_base64(image_urls):
return [image_url_to_base64(url) for url in image_urls]
api_key = "YOUR_API_KEY"
url = "https://api.segmind.com/v1/segmind-relighting-v2"
# Request payload
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"
}
headers = {'x-api-key': api_key}
response = requests.post(url, json=data, headers=headers)
print(response.content) # The response is the generated image
Attributes
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.
Utilizing Segmind Relighting V2 for Enhanced Image Illumination
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.
Key Features and Integration Benefits
Text-Conditioned Relighting
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.
Photorealistic and Seamless Output
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.
Extensive Model Integration
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.
Practical Application and Tips
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.
Other Popular Models
sdxl-img2img
SDXL Img2Img is used for text-guided image-to-image translation. This model uses the weights from Stable Diffusion to generate new images from an input image using StableDiffusionImg2ImgPipeline from diffusers

idm-vton
Best-in-class clothing virtual try on in the wild

face-to-many
Turn a face into 3D, emoji, pixel art, video game, claymation or toy

sd2.1-faceswapper
Take a picture/gif and replace the face in it with a face of your choice. You only need one image of the desired face. No dataset, no training
