Change the lighting of a product or portrait photograph to match a reference image without reshooting in a different environment.
Apply a precisely controlled light setup from a Blender Cycles scene to a real photograph for physically accurate relighting.
Batch-process a folder of images to apply consistent new lighting conditions using a single command-line call.
Requires Python 3.11 and a conda environment, model weights download automatically from Hugging Face on first run but carry a non-commercial license.
PIXLRelight is a Python tool from researchers at the University of Oxford that takes a single photograph and changes its lighting to match a target illumination you provide. You give it a source photo and either another photo showing the lighting you want, or a set of 3D render outputs from a program called Blender, and it produces a new version of your source photo lit as if it were in that new environment. The whole process takes less than a tenth of a second. The tool has two main ways to specify the new lighting. In the first mode, you provide a real reference photograph, and the system automatically extracts information about the light conditions from it using a separate built-in model. In the second mode, you supply output files from Blender Cycles, a 3D rendering engine, which lets you define exactly where lights are placed and how they behave. This second mode is for users who want precise, physically accurate control over the final result. Installation requires Python 3.11 and a conda environment. The model weights download automatically from Hugging Face on first use. Running inference is a single command pointing at an input folder. The tool handles both single images and batches, and automatically determines which mode to use based on what files are present in each sample folder. The underlying approach connects physically based rendering with a neural image model. A transformer-based neural renderer reads intrinsic image properties, things like diffuse shading and specular reflections extracted from either the reference photo or the Blender render passes, and uses them to relight the source image while preserving fine detail at the original resolution. The code is released under the MIT license, and the model weights carry a non-commercial Creative Commons license, so commercial use of the weights is not permitted.
← mlfarinha on gitmyhub — every repo by this author, as a profile.
Verify against the repo before relying on details.