Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
I

IC-Light

> 编程语言
Open source

More relighting!

8.5K stars0 likes2 views
WebsiteGitHub

About

More relighting!

IC-Light

IC-Light is a project to manipulate the illumination of images.

The name "IC-Light" stands for "Imposing Consistent Light" (we will briefly describe this at the end of this page).

Currently, we release two types of models: text-conditioned relighting model and background-conditioned model. Both types take foreground images as inputs.

Note that "iclightai dot com" is a scam website. They have no relationship with us. Do not give scam websites money! This GitHub repo is the only official IC-Light.

News

Alternative model for stronger illumination modifications.

Some news about flux is here. (A fix update is added at Nov 25, more demos will be uploaded soon.)

Get Started

Below script will run the text-conditioned relighting model:

bash
git clone https://github.com/lllyasviel/IC-Light.git
cd IC-Light
conda create -n iclight python=3.10
conda activate iclight
pip install torch torchvision --index-url https://download.pytorch.org/whl/cu121
pip install -r requirements.txt
python gradio_demo.py

Or, to use background-conditioned demo:

bash
python gradio_demo_bg.py

Model downloading is automatic.

Note that the "gradio_demo.py" has an official huggingFace Space here.

Screenshot

Text-Conditioned Model

(Note that the "Lighting Preference" are just initial latents - eg., if the Lighting Preference is "Left" then initial latent is left white right black.)


Prompt: beautiful woman, detailed face, warm atmosphere, at home, bedroom

Lighting Preference: Left


Prompt: beautiful woman, detailed face, sunshine from window

Lighting Preference: Left


beautiful woman, detailed face, neon, Wong Kar-wai, warm

Lighting Preference: Left


Prompt: beautiful woman, detailed face, sunshine, outdoor, warm atmosphere

Lighting Preference: Right


Prompt: beautiful woman, detailed face, sunshine, outdoor, warm atmosphere

Lighting Preference: Left


Prompt: beautiful woman, detailed face, sunshine from window

Lighting Preference: Right


Prompt: beautiful woman, detailed face, shadow from window

Lighting Preference: Left


Prompt: beautiful woman, detailed face, sunset over sea

Lighting Preference: Right


Prompt: handsome boy, detailed face, neon light, city

Lighting Preference: Left


Prompt: beautiful woman, detailed face, light and shadow

Lighting Preference: Left

(beautiful woman, detailed face, soft studio lighting)


Prompt: Buddha, detailed face, sci-fi RGB glowing, cyberpunk

Lighting Preference: Left


Prompt: Buddha, detailed face, natural lighting

Lighting Preference: Left


Prompt: toy, detailed face, shadow from window

Lighting Preference: Bottom


Prompt: toy, detailed face, sunset over sea

Lighting Preference: Right


Prompt: dog, magic lit, sci-fi RGB glowing, studio lighting

Lighting Preference: Bottom


Prompt: mysteriou human, warm atmosphere, warm atmosphere, at home, bedroom

Lighting Preference: Right


Background-Conditioned Model

The background conditioned model does not require careful prompting. One can just use simple prompts like "handsome man, cinematic lighting".



A more structured visualization:

Imposing Consistent Light

In HDR space, illumination has a property that all light transports are independent.

As a result, the blending of appearances of different light sources is equivalent to the appearance with mixed light sources:

Using the above light stage as an example, the two images from the "appearance mixture" and "light source mixture" are consistent (mathematically equivalent in HDR space, ideally).

We imposed such consistency (using MLPs in latent space) when training the relighting models.

As a result, the model is able to produce highly consistent relight - so consistent that different relightings can even be merged as normal maps! Despite the fact that the models are latent diffusion.

From left to right are inputs, model outputs relighting, devided shadow image, and merged normal maps. Note that the model is not trained with any normal map data. This normal estimation comes from the consistency of relighting.

You can reproduce this experiment using this button (it is 4x slower because it relight image 4 times)

Below are bigger images (feel free to try yourself to get more results!)

For reference, geowizard (geowizard is a really great work!):

And, switchlight (switchlight is another great work!):

Model Notes

  • iclight_sd15_fc.safetensors - The default relighting model, conditioned on text and foreground. You can use initial latent to influence the relighting.

  • iclight_sd15_fcon.safetensors - Same as "iclight_sd15_fc.safetensors" but trained with offset noise. Note that the default "iclight_sd15_fc.safetensors" outperform this model slightly in a user study. And this is the reason why the default model is the model without offset noise.

  • iclight_sd15_fbc.safetensors - Relighting model conditioned with text, foreground, and background.

Also, note that the original BRIA RMBG 1.4 is for non-commercial use. If you use IC-Light in commercial projects, replace it with other background replacer like BiRefNet.

Cite

@inproceedings{
    zhang2025scaling,
    title={Scaling In-the-Wild Training for Diffusion-based Illumination Harmonization and Editing by Imposing Consistent Light Transport},
    author={Lvmin Zhang and Anyi Rao and Maneesh Agrawala},
    booktitle={The Thirteenth International Conference on Learning Representations},
    year={2025},
    url={https://openreview.net/forum?id=u1cQYxRI1H}
}

Related Work

Also read ...

Total Relighting: Learning to Relight Portraits for Background Replacement

Relightful Harmonization: Lighting-aware Portrait Background Replacement

SwitchLight: Co-design of Physics-driven Architecture and Pre-training Framework for Human Portrait Relighting

Issues· 112 open

View all issuesOpen on GitHub
  • #147

    HOW CAN I RUN THIS ON CMD??

    Updated Mar 13, 2026
  • #114

    【ImportError和推理Error】能打开可视化页面,但是推理图片时报 error 的一种可能的解决方法

    Updated Dec 19, 2025
  • #37

    sdxl support

    Updated Oct 6, 2025
  • #135

    Alternative IC-Light V2 Model(s) for people who want **stronger illumination variations and modifications**.

    Updated Sep 3, 2025
  • #146

    Under the premise of using the same description, can this model generate outputs in batches for different images within a folder?

    Updated Aug 24, 2025
  • #145

    The processed image cannot be output correctly.

    Updated Aug 18, 2025
  • #133

    When will the model be able to adapt FLUX?

    Updated Aug 5, 2025
  • #134

    about training: how to train the envhdr_MLP?

    Updated Aug 5, 2025
  • #143

    May I ask when the ic-light v2 or luminabrush will be open in hugging face space?

    Updated Aug 5, 2025
  • #144

    can this work use to generate shadow?

    Updated Jul 28, 2025

> Tags

Python

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 30, 2026
Category编程语言
PricingOpen source

> Related tools

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言