TL;DR
When you digitally paste an object into an indoor photo, current AI models usually miss how lighting shifts from a sunny tabletop to a shadowy corner. LOCO solves this by turning ordinary, publicly available videos into a massive training ground—reinterpreting moving camera positions as virtual spotlights to teach a diffusion model how local lighting actually behaves. The result is an image compositor that naturally adapts an object’s shadows, brightness, and color to its exact placement in a room, without losing the object's original identity.
What Problem Does This Paper Address?
Look around the room you’re in right now. The light isn’t uniform; a spot right under a desk lamp has crisp shadows and a warm glow, while the floor under the desk is dim and cool. In computer vision, this is called spatially varying illumination.
Generative diffusion models have gotten remarkably good at "object compositing"—inserting a user-provided object into a background image. However, if you paste the same soda can onto three different spots in a single room, existing models make the can look almost identical in all three places. Why? Because they lack the right training data. Capturing real-world photos of the same object moved across thousands of lighting setups is wildly expensive, synthetic 3D game engines require painstaking manual scene design, and standard image-inpainting datasets accidentally erase local ground shadows when masking out objects.
Methods
Instead of staging elaborate real-world photoshoots, the authors introduce LOCO (LOcal light-aware object COmpositing), a clever data-augmentation pipeline combined with a standard conditional diffusion setup (built on a Flux1-Dev DiT backbone using LoRA).
What is novel here is how they generate training data on the fly from everyday monocular videos of static scenes:
- Offline Scene Prep: They take videos where a camera moves around an object, segment and inpaint-away the foreground object to get a clean background, and estimate the 3D geometry, camera poses, and surface reflectance (how shiny or matte things are, via a simplified Disney BRDF).
- Cameras as Virtual Spotlights: Here is the magic trick. Because a video camera moves through empty space while pointing at the scene, every video frame's camera pose is a guaranteed valid, unobstructed place to put a light! During training, LOCO picks a reference frame and turns other frames from the same video into virtual spotlights with randomized colors, beam shapes, and intensities. Using fast, rasterization-based shadow mapping (checking depth maps to see what blocks the light), it relights both the empty background and the composite image together.
- Batch Permutation: Within a training batch, LOCO mixes and matches an object from one viewpoint/lighting setup with a relit background from another. Because the input object’s lighting no longer matches the target background, the diffusion model is forced to stop "copy-pasting" the original shading and actually read the local lighting cues of the scene.
Datasets
- Training Data: LOCO extracts ~24K relightable objects (~671K unaugmented triplets) from public static-scene video datasets (uCO3D, DL3DV-10K, Mip-NeRF 360, and Tanks & Temples), mixed in a 4:1 ratio with high-resolution prior compositing datasets (AnyDoor, AnyInsertion, ORIDa, and DreamFuse).
- Evaluation Benchmarks: They test identity preservation on ORIDa (which lacks spatially varying light) and local lighting on Laval Indoor SV HDR (inserting DreamBooth objects into HDR-mapped rooms, though Laval lacks ground-truth composite photos).
- New Benchmark — LOCO-bench: To evaluate against real physics, the authors built LOCO-bench: 760 physically captured ground-truth triplets across 49 indoor scenes using 62 real objects. Each object is photographed in multiple spots within the exact same room (e.g., on a lit kitchen counter vs. inside a dark lower cabinet).
Key Insights and Ideas
- Free-space camera trajectories solve light placement: Guessing where to place virtual lights in estimated 3D geometry often leads to lights stuck inside walls. Using other frames' camera poses guarantees the virtual spotlights sit in open space and point right at the action.
- Physically based relighting doesn't have to bottleneck training: Because scene geometry and base shading are cached offline, the on-the-fly rasterization relighting adds a tiny 1.5% overhead to each training step.
- Complementary data roles: Ablation studies show a clean division of labor—LOCO’s video-augmented data teaches the model how to dramaticallly shift lighting and cast directional shadows, while mixing in 20% traditional compositing data keeps fine object textures (like tiny text or facial features on a toy) crisp.
Key Results
Across quantitative metrics and human studies, LOCO outperforms state-of-the-art baselines (including Insert Anything, DreamFuse, UniCombine, and AnyDoor):
- Perceptual Accuracy: On LOCO-bench, LOCO achieves the best perceptual similarity to physically captured ground truth, lowering DreamSim distance to 0.265 (beating the strongest baseline, Insert Anything, at 0.312).
- Lighting & Color Precision: Compared to the best baselines on LOCO-bench, LOCO cuts light-direction angular error by 12% (down to 23.00°), brightness error by 38%, and hue error by 22%.
- Illumination Consistency (IC): Using a reference-free PSNR metric comparing local light before and after insertion, LOCO scores 15.04 on Laval (vs. DreamFuse’s 13.27) and 13.99 on LOCO-bench (vs. UniCombine’s 11.80).
- Human Preference: In pairwise user studies on both Laval and LOCO-bench, human raters strongly preferred LOCO over every baseline for lighting harmony and overall quality (winning 67%–98% of quality matchups), while tying the sharpest baseline (Insert Anything, 43% to 43%) on object identity preservation.
Limitations and Future Work
- Geometry & Material Limits: Because the training pipeline estimates 3D depth and surface properties from regular videos, thin structures and highly mirror-like (specular) surfaces can suffer from shading artifacts.
- No Glass or Liquids: The simplified Disney BRDF models light bouncing off surfaces, not passing through them—leaving transparent and translucent objects out of scope for now.
- Indoors Only: Virtual spotlights with distance falloff mimic indoor lamps and windows well, but don't model outdoor scenes lit by a distant sun with near-parallel light rays. Extending this paradigm to outdoor lighting and transmissive materials remains an open frontier for future work.
Summary updated