zsxkib / ic-light-background

πŸ–ΌοΈβœ¨Background images + prompts to auto-magically relights your images (+normal mapsπŸ—ΊοΈ)

  • Public
  • 9.9K runs
  • L40S
  • GitHub
  • License

Input

*file
Preview
subject_image

The main foreground image to be relighted

*file
Preview
background_image

The background image that will be used to relight the main foreground image

*string
Shift + Return to add a new line

A text description guiding the relighting and generation process

string
Shift + Return to add a new line

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

Default: "best quality"

string
Shift + Return to add a new line

A text description of attributes to avoid in the generated images

Default: "lowres, bad anatomy, bad hands, cropped, worst quality"

boolean

Whether to compute the normal maps (slower but provides additional output images)

Default: false

integer

The width of the generated images in pixels

Default: 512

integer

The height of the generated images in pixels

Default: 640

integer
(minimum: 1, maximum: 100)

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

Default: 25

number
(minimum: 1, maximum: 32)

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

Default: 2

number
(minimum: 1, maximum: 3)

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

Default: 1.5

number
(minimum: 0.1, maximum: 1)

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

Default: 0.5

string

The type and position of lighting to apply to the initial background latent

Default: "Use Background Image"

integer

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

integer
(minimum: 1, maximum: 12)

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

Default: 1

string

The image file format of the generated output images

Default: "webp"

integer
(minimum: 0, maximum: 100)

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

Default: 80

Output

output
Generated in

Run time and cost

This model costs approximately $0.025 to run on Replicate, or 40 runs per $1, but this varies depending on your inputs. It is also open source and you can run it on your own computer with Docker.

This model runs on Nvidia L40S GPU hardware. Predictions typically complete within 26 seconds. The predict time for this model varies significantly based on the inputs.

Readme

IC-Light Background: Illuminate Portraits with Stunning Backgrounds πŸŒ„βœ¨

Foreground (Subject) Image + Background Image + Prompt β†’ Subject in Background w/ Correct Lighting

Overview πŸ–ΌοΈ

IC-Light Background is a powerful AI-driven tool that takes portrait relighting to the next level by incorporating background images. As a companion to the IC-Light Text model, IC-Light Background allows you to relight your portraits using reference background images, ensuring a cohesive and visually stunning result. πŸŽ¨πŸ’‘

Getting Started πŸš€

To begin relighting your portraits with IC-Light Background:

  1. Upload your portrait image
  2. Provide a reference background image with the desired lighting
  3. Watch as IC-Light Background seamlessly applies the background lighting to your portrait! ✨

Background-Conditioned Relighting πŸ“ΈπŸŒ 

IC-Light Background harnesses the power of background images to guide the relighting process. By analyzing the lighting in your reference background, the model can intelligently apply the same illumination to your portrait, creating a harmonious and visually striking result. 🌈

Normal Map Estimation πŸ—ΊοΈ

One of the standout features of IC-Light Background is its ability to estimate normal maps from the relit portraits. By relighting the image from four different directions (left, right, top, bottom), the model can compute a detailed normal map that captures the 3D-like shading of your portrait. This adds an extra layer of depth and realism to your relit images. 🌍

Seamless Integration 🧩

IC-Light Background is designed to work hand-in-hand with the IC-Light Text model. While the text-conditioned model focuses on relighting portraits based on textual descriptions, IC-Light Background takes it a step further by incorporating reference background images. Together, these models provide a comprehensive and versatile portrait relighting solution. 🀝

Customization Options 🎚️

Just like its text-conditioned counterpart, IC-Light Background offers a wide range of customization options to fine-tune your relighting results. From adjusting the relighting strength to controlling the output resolution, you have the flexibility to create the perfect look for your portraits. πŸ”§

Cutting-Edge Technology 🧠

IC-Light Background is powered by state-of-the-art deep learning models, including Stable Diffusion v1.5 and the BriaRMBG model for foreground extraction. By leveraging advanced techniques such as variational autoencoders, U-Nets, and custom loss functions, IC-Light Background achieves unprecedented levels of relighting quality and consistency. πŸš€

Elevate Your Portraits πŸ“ˆ

With IC-Light Background, you can take your portrait photography to new heights. By harnessing the power of stunning background lighting, you can create portraits that truly stand out and captivate your audience. Get ready to unleash your creativity and explore a world of breathtaking portrait relighting possibilities! 🌟

Responsible Use πŸ™

As with any powerful tool, please use IC-Light Background responsibly. Respect the privacy and rights of the individuals in your photos, and always obtain necessary permissions before sharing or publishing relit images. πŸ“œ

Discover the magic of background-conditioned portrait relighting with IC-Light Background! 🎨✨


For text-conditioned portrait relighting, check out the IC-Light Text model. πŸ“πŸ’‘