Relighting

Prompts to auto-magically relight your images.


API

If you're looking for an API, you can choose from your desired programming language.

POST
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 import requests api_key = "YOUR_API_KEY" url = "https://api.segmind.com/v1/ic-light" # Prepare data and files data = {} files = {} data['cfg'] = 2 data['seed'] = 42 data['steps'] = 25 data['width'] = 512 data['height'] = 640 data['prompt'] = "cat, photoshoot, 4k" data['light_source'] = "None" data['highres_scale'] = 1.5 data['output_format'] = "webp" # For parameter "subject_image", you can send a raw file or a URI: # files['subject_image'] = open('IMAGE_PATH', 'rb') # To send a file # data['subject_image'] = 'IMAGE_URI' # To send a URI data['lowres_denoise'] = 0.9 data['output_quality'] = 80 data['appended_prompt'] = "best quality" data['highres_denoise'] = 0.5 data['negative_prompt'] = "lowres, bad anatomy, bad hands, cropped, worst quality" data['number_of_images'] = 1 headers = {'x-api-key': api_key} response = requests.post(url, data=data, files=files, headers=headers) print(response.content) # The response is the generated image
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


cfgfloat ( default: 2 )

Classifier-Free Guidance scale - higher values encourage adherence to prompt, lower values encourage more creative interpretation

min : 1,

max : 32


seedint ( default: 42 )

A fixed random seed for reproducible results (omit this parameter for a randomized seed)


stepsint ( default: 25 )

The number of diffusion steps to perform during generation (more steps generally improves image quality but increases processing time)

min : 1,

max : 100


widthenum:int ( default: 512 )

An enumeration.

Allowed values:


heightenum:int ( default: 640 )

An enumeration.

Allowed values:


promptstr *

A text description guiding the relighting and generation process


light_sourceenum:str ( default: None )

An enumeration.

Allowed values:


highres_scalefloat ( default: 1.5 )

The multiplier for the final output resolution relative to the initial latent resolution

min : 1,

max : 3


output_formatenum:str ( default: webp )

An enumeration.

Allowed values:


subject_imagestr *

The main foreground image to be relighted


lowres_denoisefloat ( default: 0.9 )

Controls the amount of denoising applied when generating the initial latent from the background image (higher = more adherence to the background, lower = more creative interpretation)

min : 0.1,

max : 1


output_qualityint ( default: 80 )

The image compression quality (for lossy formats like JPEG and WebP). 100 = best quality, 0 = lowest quality.

min : 0,

max : 100


appended_promptstr ( default: best quality )

Additional text to be appended to the main prompt, enhancing image quality


highres_denoisefloat ( default: 0.5 )

Controls the amount of denoising applied when refining the high resolution output (higher = more adherence to the upscaled latent, lower = more creative details added)

min : 0.1,

max : 1


negative_promptstr ( default: lowres, bad anatomy, bad hands, cropped, worst quality )

A text description of attributes to avoid in the generated images


number_of_imagesint ( default: 1 )

The number of unique images to generate from the given input and settings

min : 1,

max : 12

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.

Relighting

Relighting transforms image illumination with unparalleled control and realism. Relighting model is based on IC-Light, short for "Imposing Consistent Light," leverages cutting-edge AI to manipulate lighting within your images, ensuring seamless integration with existing light conditions.

Text-Driven Illumination Control: Imagine effortlessly adjusting the lighting in your photos using simple text prompts. Relighting model operates as a text-conditioned relighting model, allowing you to specify the desired lighting direction – left, right, top, or bottom. With this intuitive interface, you can instantly relight your images, creating dramatic shadows, adding warmth, or creating a bright and airy feel.

Realism at its Finest: Relighting model goes beyond basic manipulation. The underlying AI models are meticulously trained to understand the physics of light, ensuring that relit images maintain a natural and believable appearance. This translates to seamless merging with existing lighting conditions within the image, eliminating awkward transitions or unrealistic shadows.

Benefits of Relighting in AI Photo Editing

  • Effortless Lighting Control: Text-based prompts provide a user-friendly way to adjust image illumination, empowering even non-technical users to achieve stunning results.

  • Unparalleled Realism: Relighting model leverages advanced AI, trained on real-world lighting scenarios, to produce photorealistic relighting effects.

  • Enhanced Image Storytelling: With the ability to manipulate lighting, Relighting unlocks a world of creative possibilities. Craft specific moods and atmospheres, emphasize key elements, or simply add a touch of artistic flair to your images.

  • Increased Efficiency: Eliminate time-consuming manual editing processes. Relighting automates relighting, allowing you to focus on the creative aspects of image manipulation.

Whether you're a professional photographer, a creative hobbyist, or simply looking to enhance your existing photos, Relighting provides the tools to bring your vision to life.