explaingit

lllyasviel/ic-light

8,421PythonAudience · researcherComplexity · 3/5Setup · moderate

TLDR

IC-Light is an AI tool that changes the lighting in photos. You describe the lighting you want in text, or supply a background image, and it relights your subject to match.

Mindmap

mindmap
  root((ic-light))
    What it does
      Text-driven relight
      Background relight
      Normal map extraction
    Tech stack
      Python conda
      PyTorch model
      Gradio demo
    Use cases
      Product photography
      Portrait editing
      Research baseline
    Setup
      Clone and install
      Auto model download
      HuggingFace demo
Click or tap to explore — scroll the page freely

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

Things people build with this

USE CASE 1

Relight a product or portrait photo using a text prompt like 'sunshine from window' or 'neon light, city'.

USE CASE 2

Composite a subject onto a new background with physically coherent lighting derived from that background.

USE CASE 3

Extract surface normal maps from relit images for downstream 3D or shading analysis.

Tech stack

PythonPyTorchHuggingFaceGradioconda

Getting it running

Difficulty · moderate Time to first run · 30min

Requires conda and a GPU, model weights download automatically on first run. A hosted HuggingFace demo is available if you want to skip local setup.

In plain English

IC-Light is a Python project that changes the lighting in photos using AI. The name stands for "Imposing Consistent Light," which refers to the technique it uses to keep lighting changes believable and physically coherent across an image. The project offers two modes. In the first mode, you describe the lighting you want in plain text, such as "sunshine from window" or "neon light, city," and the model adjusts the image to match that description. In the second mode, you provide a background image, and the tool figures out how that background's lighting would fall on your subject. Both modes take a foreground image, like a person or object, and produce a relit version. Setting it up requires cloning the repository, creating a Python environment with conda, installing a handful of packages, and running a Python script that opens a browser-based demo. The models download themselves automatically when you first run the demo. There is also an official demo hosted on HuggingFace Spaces if you want to try it without installing anything locally. Under the hood, the project applies a mathematical property of light: different light sources can be blended together, and their combined effect on a scene matches what you would get if all those light sources were present at once. The team built this consistency into the training of the AI models, which means the relighting results are coherent enough that you can even extract surface normal maps from them, something the models were not explicitly trained to do. This is a research release aimed at people who want to experiment with AI-driven image relighting. It is not a polished commercial product. The repository notes clearly that a third-party website using a similar name is unaffiliated and should not be trusted.

Copy-paste prompts

Prompt 1
I want to relight a portrait photo using IC-Light with a text prompt. Walk me through setting up the conda environment and running the Gradio demo locally.
Prompt 2
Show me how to use IC-Light's background relighting mode to composite a product image onto a studio background image.
Prompt 3
I want to batch-process multiple foreground images with the same lighting prompt using IC-Light. Write a Python script that calls the model in a loop.
Prompt 4
How does IC-Light's light superposition principle work, and why does it allow the model to produce surface normal maps it was never explicitly trained to generate?
Open on GitHub → Explain another repo

← lllyasviel on gitmyhub — every repo by this author, as a profile.

Verify against the repo before relying on details.