Scaling In-the-Wild Training for Diffusion-based Illumination Harmonization and Editing by Imposing Consistent Light Transport

Lvmin Zhang, Anyi Rao, Maneesh AgrawalaICLR 2025

Image relighting—the ability to change the illumination of an object while perfectly preserving its geometry, texture, and original colors (albedo)—remains a highly sought-after capability in computer vision and graphics. While modern diffusion models excel at generating high-quality images, they often lack the precise control required for accurate relighting.

When researchers attempt to scale up training for relighting using massive, "in-the-wild" datasets, they typically encounter two major hurdles. First, without strict physical constraints, the model acts as a structure-guided random generator, arbitrarily altering textures or facial features instead of just modifying the light. Second, the stochastic nature of diffusion models often leads to the "hallucination" of new details or the alteration of intrinsic properties, rather than simply casting a new shadow or adding a highlight.

To solve this, researchers have introduced IC-Light (Imposing Consistent Light), a novel framework that scales diffusion-based image relighting to over 10 million images by enforcing a fundamental physical law: the linearity of light transport.

Complex shadow relighting generated by IC-Light, demonstrating the model's ability to cast intricate shadows while preserving facial identity and textures.

Methodology: Physics as a Regularizer

The core innovation of IC-Light is Light Transport Consistency. In the physical world, light is additive. If you photograph an object under Light A and then under Light B, the appearance of the object under both lights combined (A+B) should be the mathematical sum of its appearances under the individual lights.

The authors incorporate this physical principle directly into the diffusion training process:

  • The Consistency Constraint: During training, the model predicts the noise for an object under two distinct lighting conditions ($L_1$ and $L_2$) as well as a merged condition ($L_1 + L_2$). A specialized loss function penalizes the model if the merged output does not align with the sum of the individual outputs. By forcing the model to obey this linearity, the framework effectively "locks" the object's identity, preventing the network from altering the underlying albedo or geometry.
  • The MLP Bridge: Diffusion models typically operate in non-linear latent spaces or Low Dynamic Range (LDR) pixel spaces, whereas light transport is strictly linear only in High Dynamic Range (HDR) space. To bridge this gap, the authors employ a small, learnable Multi-Layer Perceptron (MLP) to map between these domains.
  • Architecture: Standard backbones, such as Stable Diffusion XL (SDXL) or Flux, are modified to accept an environment map as a prompt embedding and a "degradation image" (the original, unlit image) as an additional input channel.

Scaling with Massive Datasets

To achieve true "in-the-wild" robustness, the researchers curated a massive dataset of over 10 million samples across three distinct categories. The MLP-based consistency loss allows the model to learn from HDR, LDR, and Latent data simultaneously, unifying these disparate sources:

  1. In-the-wild Augmentation (6M): Arbitrary images were synthetically "degraded" with random shadows and lighting artifacts to create robust training pairs.
  2. 3D Rendered Data (4M): Utilizing the Objaverse dataset, 3D objects were rendered under diverse HDR environment maps to provide ground-truth geometric lighting.
  3. Light Stage Data: High-quality, real-world captures of objects and faces under "One-Light-At-a-Time" (OLAT) conditions were included for maximum physical accuracy.

Key Results and Applications

IC-Light demonstrates superior detail preservation compared to previous state-of-the-art models like Relightful Harmonization or SwitchLight. Qualitative results show that it maintains complex textures—such as the weave of a fabric or skin pores—without hallucinating unwanted features. Quantitatively, IC-Light outperformed competitors in perceptual metrics (LPIPS) and structural similarity (SSIM) on unseen 3D rendering benchmarks.

IC-Light excels at illumination harmonization, seamlessly integrating a subject into a bright, sunlit beach environment while maintaining realistic lighting cues.

Beyond simple relighting, the model excels at Illumination Harmonization, making a foreground object look as though it naturally belongs in a new background environment. Furthermore, the method scales exceptionally well; it was successfully applied to massive transformer-based diffusion models like Flux.1-dev, proving that the consistency constraint remains effective at scale.

A fascinating byproduct of this physically grounded relighting model is its ability to perform Normal Estimation. Because the model can accurately relight an object from various directional angles (left, right, top, bottom), researchers can mathematically derive the 3D surface normals of every pixel directly from the generated relit images.

Limitations and Future Work

While highly effective, the framework does have limitations. Training on 10 million images with large backbones like Flux requires significant computational resources, utilizing complex multi-stage training strategies on clusters of H100 GPUs. Additionally, the quality of the relighting remains somewhat tethered to the inherent capabilities of the underlying base diffusion model. Finally, while the generated normal maps are visually excellent, they are an "empirical" derivation from relighting rather than being explicitly optimized for ground-truth geometry. Future work may involve integrating more explicit geometric constraints and optimizing the speed of the multi-inference process required for normal map generation.

Summary updated

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