TL;DR
PractiLight introduces a novel method for controlling lighting in generated images by leveraging the inherent understanding of light transport within foundational diffusion models. This approach offers practical, efficient, and generalizable relighting capabilities across diverse image domains, outperforming existing methods in terms of quality and control.
What Problem Does This Paper Address?
Controlling the lighting and shadows in generated images is a crucial but challenging task for establishing mood, tone, and guiding local emphasis. Existing methods often rely on extensive, domain-specific datasets, limiting their generalization and practical applicability. While foundational diffusion models show promise in understanding light, effectively extracting and controlling this knowledge for relighting without extensive fine-tuning has remained an open problem. This paper aims to bridge this gap by developing a practical and generalizable relighting approach that taps into the implicit light transport priors within these powerful generative models.
Methods
The core of PractiLight lies in its innovative use of a lightweight adapter, specifically a Low-Rank Adaptation (LoRA) module, trained to predict a "direct-irradiance map" from an input image. This LoRA is trained to leverage the self-attention layers of a pre-trained diffusion model (Stable Diffusion 1.5), as the authors found these layers to be most correlated with light phenomena.
The relighting process involves:
- Regressor Training: A LoRA is trained on synthetic data to estimate the direct-irradiance component of an image, effectively learning light features across diffusion timesteps.
- Control Signal Creation: A pseudo-3D scene is constructed from the input image using estimated depth, allowing for the creation of a novel light condition (represented as a direct-irradiance map).
- Relighting with Classifier Guidance: The trained regressor is used to guide the diffusion model's generation process towards the desired light condition. To preserve image identity and structure, the method employs query injection (leveraging self-attention activations from the original generation) and an edge-conditioned ControlNet.
Datasets
- Training: The authors created a modest set of 4000 synthetic images for training the LoRA regressor. These images depict simple geometric primitives with randomized materials and colors.
- Evaluation: A custom evaluation dataset was constructed from 2 million prompts from DiffusionDB, manually grouped into nine categories (Portrait, Portrait CG, Anime, Animal, Fantasy Landscape, Indoors, Outdoors, Painting, Sketch/Cartoon). The top 20 images per category, sorted by aesthetic score, were selected, resulting in 180 prompt-image pairs. Novel light conditions were generated for these images.
Key Insights and Ideas
- Self-Attention Layers Encode Light: The paper's central insight is that self-attention layers in diffusion models are highly correlated with light phenomena, more so than other layers. This suggests that the model's understanding of light is implicitly encoded within these attention mechanisms.
- Early Diffusion Timesteps are Crucial for Light: Light-related generation spans different timesteps, with early timesteps being important for low-frequency light intensity and reflections, and later timesteps for high-frequency details like shadows. This informs the guidance strategy.
- Lightweight Adapters Unlock Priors: Instead of fine-tuning the entire diffusion model, a lightweight LoRA adapter can effectively tap into the pre-existing light transport knowledge within the foundational model, leading to parameter and data efficiency.
- Identity Preservation is Key: Naively applying light control can lead to significant loss of identity and structure. PractiLight's combination of query injection and ControlNet is crucial for maintaining image content while relighting.
Key Results
- Qualitative: PractiLight demonstrates state-of-the-art performance in terms of relighting quality and identity preservation across diverse domains, including photorealistic imagery, cel-shading, sketches, CG art, and surrealistic paintings. Human subjects strongly preferred PractiLight's results over competing methods.
- Quantitative: The method achieves higher aesthetic scores and identity preservation compared to IC-Light and RGB↔x, while being on par in control adherence. It requires three orders of magnitude fewer parameters and less data for training.
- Efficiency: The LoRA-based approach is highly parameter-efficient (7.9e5 parameters) and data-efficient, requiring only 4000 synthetic images for training.
Limitations and Future Work
- Colored Light: The current method does not support colored light, as it requires significantly more data and can lead to global color drifts.
- High-Frequency Elements: While PractiLight handles high-frequency elements like shadows and highlights moderately well, removing them completely is more challenging.
- Global Illumination: Controlling global illumination phenomena (e.g., inter-reflections) is an open question and may require including higher-order illumination effects in training.
- Simpler Control: The authors suggest that there might be a simpler way to manipulate light directly within attention heads, without optimization, for surgical control.
- Extensibility: The approach is believed to be extensible to other diffusion architectures like DiT.
Summary updated