HyperAI

IC-Light Image Lighting Tool, Natural Background Fusion Replacement

Project Introduction

IC-Light  IC-Light is a project that aims to achieve image relighting through machine learning models. Its full name is Imposing Consistent Light. It provides two main types of models: text-conditional lighting model and background-conditional model, which adjust the lighting of foreground images according to text prompts or background content respectively. The project is easy to use through the Gradio interface and automatically downloads pre-trained models. IC-Light fuses light sources in high dynamic range (HDR) space to achieve highly consistent lighting effects, which is suitable for light and shadow adjustment of various image scenes.

IC-Light Features include:

  • Model Diversity: Provides text-conditioned and background-conditioned lighting models to adjust the foreground lighting by text cues or background images, respectively.
  • Consistency: Based on the mixing of HDR spatial light sources, highly consistent lighting and shadow effects are achieved.
  • Non-intrusive: Produces consistent images without subtle cues.
  • High-quality relighting: Even images with different lighting conditions can maintain consistency and generate natural light and shadow effects.

Effect examples


Model framework

IC-Light  The model framework is mainly based on the latent diffusion model in machine learning. Among them, the text conditional model generates light and shadow effects based on the text prompts entered by the user, and the background conditional model determines the lighting of the foreground through the background image. Both models perform lighting adjustment in the latent space through a multi-layer perceptron (MLP) to ensure lighting consistency.


Run steps

1. Click "Clone" in the upper right corner of the project, and then click "Next" to complete the following steps: Basic Information > Select Computing Power > Review. Finally, click "Continue" to open the project in your personal container.

2. After the resource allocation is completed, the background will automatically initialize the model (about 80 seconds), and then you can directly use the API address provided by the platform to access the operation page (real-name authentication must have been completed, and there is no need to open the workspace for this step)

3. Upload the target image and background image to insert the background image.

IC-Light  The strength of guidance for the generated image can be controlled based on the input CFG Scale. Specifically, it determines how closely the model follows the input prompt or description. Higher CFG values will make the generated image closer to the prompt content, but may cause the image to lose some naturalness; lower values will generate more diverse and natural images, but may deviate from the prompt. By adjusting the CFG scale, users can find a balance between generation effect and prompt consistency.

  • The optional parameters are as follows:
  • The custom parameters are as follows: