Project Page | Paper | Colab | HuggingFace | ComfyUI | Diffusers
We introduce a simple yet effective technique for estimating lighting from a single low-dynamic-range (LDR) image by reframing the task as a chrome ball inpainting problem. This approach leverages a pre-trained diffusion model, Stable Diffusion XL, to overcome the generalization failures of existing methods that rely on limited HDR panorama datasets. While conceptually simple, the task remains challenging because diffusion models often insert incorrect or inconsistent content and cannot readily generate chrome balls in HDR format. Our analysis reveals that the inpainting process is highly sensitive to the initial noise in the diffusion process, occasionally resulting in unrealistic outputs. To address this, we first introduce DiffusionLight, which uses iterative inpainting to compute a median chrome ball from multiple outputs to serve as a stable, low-frequency lighting prior that guides the generation of a high-quality final result. To generate high-dynamic-range (HDR) light probes, an Exposure LoRA is fine-tuned to create LDR images at multiple exposure values, which are then merged. While effective, DiffusionLight is time-intensive, requiring approximately 30 minutes per estimation. To reduce this overhead, we introduce DiffusionLight-Turbo, which reduces the runtime to about 30 seconds with minimal quality loss. This 60x speedup is achieved by training a Turbo LoRA to directly predict the averaged chrome balls from the iterative process. Inference is further streamlined into a single denoising pass using a LoRA swapping technique. Experimental results that show our method produces convincing light estimates across diverse settings and demonstrates superior generalization to in-the-wild scenarios.
For Non-Researcher, we implemented other 2 different versions which are ComfyUI and Vanila diffusers.
For Researcher, This repository is based on the conference version of DiffusionLight. We use this repository for doing experiment, we include the code of turbo_sdedit, turbo_pred, and turbo_swapping for you to tinker around.
conda env create -f environment.yml
conda activate diffusionlight-turbo
pip install -r requirements.txt
python inpaint.py --dataset example --output_dir output
python ball2envmap.py --ball_dir output/square --envmap_dir output/envmap
python exposure2hdr.py --input_dir output/envmap --output_dir output/hdr
To setup the Python environment, you need to run the following commands in both Conda and pip:
conda env create -f environment.yml
conda activate diffusionlight-turbo
pip install -r requirements.txt
Note that Conda is optional. However, if you choose not to use Conda, you must manually install CUDA-toolkit and OpenEXR. Or you can use singularity container definition files singularity.def
as we provide.
Please resize the input image to 1024x1024. If the image is not square, we recommend padding it with a black border.
First, we predict the chrome ball in different exposure values (EV) using the following command:
python inpaint.py --dataset <input_directory> --output_dir <output_directory>
This command outputs three subdirectories: raw
, and square
The contents of each directory are:
raw
: Inpainted image with a chrome ball in the centersquare
: Square-cropped chrome ball (used for the next step)
Next, we project the chrome ball from the previous step to the LDR environment map using the following command:
python ball2envmap.py --ball_dir <output_directory>/square --envmap_dir <output_directory>/envmap
Finally, we compose an HDR image from multiple LDR environment maps using our custom exposure bracketing:
python exposure2hdr.py --input_dir <output_directory>/envmap --output_dir <output_directory>/hdr
The predicted light estimation will be located at <output_directory>/hdr
and can be used for downstream tasks such as object insertion. We will also use it to compare with other methods.
We use same evaluation method as the confernece version of DiffusionLight. Please visit evaluation repo DiffusionLight-evaluation for more information
@inproceedings{Chinchuthakun2025DiffusionLightTurbo,
author = {Chinchuthakun, Worameth and Phongthawee, Pakkapon and Raj, Amit and Jampani, Varun and Khungurn, Pramook and Suwajanakorn, Supasorn},
title = {DiffusionLight-Turbo: Accelerated Light Probes for Free via Single-Pass Chrome Ball Inpainting},
booktitle = {ArXiv},
year = {2025},
}