LightLab: Controlling Light Sources in Images with Diffusion Models

Nadav Magar, Amir Hertz, Eric Tabellion, Yael Pritch, Alex Rav-Acha, Ariel Shamir, Yedid Hoshen

Abstract

LightLab is a novel diffusion-based framework designed to provide users with precise, parametric control over individual light sources within a single image. By leveraging a data-centric approach that combines real-world "on/off" photograph pairs with large-scale synthetic 3D renders, the model learns to manipulate light intensity and color while maintaining physically plausible shadows and reflections. LightLab bridges the gap between the creative flexibility of generative models and the physical accuracy required for realistic image relighting.

1. Introduction

Relighting a single photograph is a classic "ill-posed" problem in computer vision. Achieving realistic results traditionally requires detailed knowledge of 3D geometry, surface reflectance (materials), and complex light transport. While traditional 3D graphics can simulate these effects, reconstructing a perfect 3D model from a single 2D image is computationally expensive and often results in uncanny artifacts.

Conversely, modern latent diffusion models excel at generating realistic textures but lack precise control mechanisms. Standard text-to-image models often fail to isolate specific lighting changes, frequently altering the entire scene composition or style when prompted to adjust a single lamp. LightLab addresses this by introducing a framework that treats light as a controllable, additive parameter, providing a "light switch" interface for generative AI.

2. Methodology

LightLab is built by fine-tuning a latent diffusion model (based on the SDXL architecture) using three core principles:

2.1 Light Arithmetic

The framework operates on the principle of light linearity. In a linear color space, the total illumination of a scene is the sum of its individual components. If $I_{off}$ represents a scene with a specific light source turned off and $I_{on}$ represents the same scene with it on, the specific contribution of that light source is $L = I_{on} - I_{off}$. By training on these difference maps, LightLab learns to add or subtract specific light contributions mathematically, allowing for precise intensity and color adjustments.

2.2 Multi-Modal Conditioning

To ensure spatial and structural consistency, the model is steered by multiple inputs:

  • Input Image: The original photograph serving as the base.
  • Depth Maps: Automatically generated maps that provide the model with an understanding of the 3D environment.
  • Segmentation Masks: User-defined or automatically generated masks that specify which light source is being targeted for modification.

2.3 Tone-Mapping Awareness

Standard cameras apply non-linear tone-mapping to map high-dynamic-range scenes to displayable images. LightLab incorporates tone-mapping strategy conditioning, allowing the model to understand how a light's appearance changes relative to the overall exposure of the scene. This prevents the "washed out" or "crushed" look common in naive relighting attempts.

3. Dataset Composition

The researchers utilized a hybrid dataset to balance physical accuracy with real-world realism:

  • Real-World Data: 600 pairs of raw photographs captured via mobile devices (e.g., Pixel 9, Samsung S24). These pairs capture the nuances of real sensors, including lens flare and sensor noise.
  • Synthetic Data: 16,000 base renders from 20 diverse indoor scenes created in Blender. Using light arithmetic, these were expanded into a dataset of approximately 600,000 images with randomized light positions, colors, and intensities.

4. Results and Evaluation

LightLab was evaluated against state-of-the-art models including IC-Light and OmniGen using the IIW (Intrinsic Images in the Wild) dataset and a custom real-world test set.

4.1 Quantitative Performance

In binary "on/off" tasks, LightLab achieved a Peak Signal-to-Noise Ratio (PSNR) of 23.2. This significantly outperforms IC-Light (12.2) and OmniGen (15.1), demonstrating a much higher fidelity in reconstructing the ground truth lighting state.

4.2 Qualitative and Human Evaluation

A user study revealed that participants preferred LightLab’s results 83% to 89% of the time compared to baseline models. Users specifically noted the physical plausibility of shadows and the lack of unwanted changes to the rest of the image. Furthermore, the model supports sequential editing, allowing users to chain multiple adjustments—such as turning off a window light and then turning on a desk lamp—while maintaining consistency.

4.3 Efficiency

The model maintains high performance without sacrificing speed, completing inference in approximately 5 seconds on a standard v4 TPU.

5. Discussion and Limitations

While LightLab represents a significant step forward, it faces certain limitations. The model occasionally exhibits dataset bias, such as misidentifying small light sources (like candles) as larger fixtures (like light tubes) due to the distribution of the training data. Additionally, the current implementation offers relative control (e.g., "make it twice as bright") rather than absolute physical units like Lumens. Future work will focus on extending the model’s capabilities to complex outdoor environments and absolute radiometric control.

6. Conclusion

LightLab demonstrates that by combining the physical principles of light arithmetic with the generative power of diffusion models, it is possible to achieve high-fidelity, parametric control over image lighting. This approach provides a practical tool for photographers and digital artists to relight scenes with professional-grade precision while preserving the integrity of the original photograph.

Summary updated

BibTeX
@inproceedings{magar2025lightlab,
  author = {Nadav Magar and Amir Hertz and Eric Tabellion and Yael Pritch and Alex Rav-Acha and Ariel Shamir and Yedid Hoshen},
  title = {{LightLab: Controlling Light Sources in Images with Diffusion Models}},
  booktitle = {SIGGRAPH (Conference Paper Track)},
  year = {2025},
  doi = {10.1145/3721238.3730696},
}
Figure