One Light, Two Witnesses: Shadow–Shading Reciprocity for Generative Object Insertion

When an image editor pastes an object into a photograph, the result has to obey a simple accounting rule. The light that brightens the object's sunlit side is the same light that is missing from the ground where the object now casts its shadow. Light cannot be spent twice. Current generative insertion systems do not keep this account. One module adjusts how the object is lit, another paints its shadow, and each builds its own guess of where the light comes from. That is why inserted objects carry shadows pointing the wrong way, or look brightly lit while casting faint shadows. We propose a checkable invariant that ties these two pieces of evidence to a single light. The object's lit-to-dark brightness ratio and the ground's unshadowed-to-shadowed brightness ratio must imply the same direct-to-ambient light ratio. The object's shading and its cast shadow must also point along one light direction that agrees with shadows already in the scene. We turn this invariant into three things: a metric for illumination consistency, a guidance term applied while a diffusion model generates the image (a diffusion model is a generator that produces images by gradually removing noise), and an ablation that tests whether forcing one shared light estimate matters.

The connection to the quantum no-cloning theorem is a lens, not a mechanism, and we say so plainly. No-cloning forbids copying an unknown quantum state. The fields that live under it, such as networking, learning, and cryptography, have developed a discipline of treating information as a consumable resource with an explicit ledger. In quantum illumination, an absorbing target is detected through the background photons it removes, its "shadow" (Quantum illumination with a light absorbing target). Our physics is entirely classical. What we borrow is the stance: the scene's light is a single resource that cannot be independently copied into "the light on the object" and "the light behind the object." Today's editing pipelines effectively make that illegal copy.

Core Claim

The open problem in this area is that light transport runs in two directions. ObjectDrop learns object-to-scene effects such as shadows and reflections from counterfactual photo pairs. It explicitly does not harmonize the object to the scene, and it often produces realistic shadows pointing against the scene's existing shadows (ObjectDrop). SHINE shows that pretrained diffusion transformers such as FLUX can composite with plausible shadows and reflections without any training (Does FLUX Already Know How to Perform Physically Plausible Image Composition?). Its attention steering, however, gives no guarantee that object shading and cast shadow agree. DiPIR does enforce physical consistency through a differentiable renderer guided by a diffusion prior (Photorealistic Object Insertion with Diffusion-Guided Inverse Rendering). It requires a 3D asset of the object and per-scene fine-tuning, so it does not apply to the common asset-free 2D generative case.

Our claim is that a cheap, asset-free reciprocity check closes much of the gap between these regimes. It measures whether the object and its shadow are consistent witnesses to one light.

The check rests on a simple model. Suppose the light consists of a dominant direct component $D$ and an ambient component $A$, and surfaces are roughly matte (Lambertian). Then the brightness ratio between the object's lit and self-shadowed sides is $r_{\text{obj}} = 1 + (D/A)\cos\alpha$. The ratio between the open ground and the cast-shadow region is $r_{\text{gnd}} = 1 + (D/A)\cos\beta$. Here $\alpha$ and $\beta$ are the angles between the light direction and the object and ground surface normals. Surface reflectance (albedo) cancels within each ratio, which is why ratios rather than raw intensities are used. Each witness therefore yields its own estimate of $D/A$, and the reciprocity residual is

$$ R = \left|\log\frac{r_{\text{obj}}-1}{\cos\alpha} - \log\frac{r_{\text{gnd}}-1}{\cos\beta}\right| + \lambda\,\angle(\ell_{\text{shade}}, \ell_{\text{shadow}}, \ell_{\text{scene}}). $$

The second term penalizes angular disagreement among three light directions: the one implied by the object's shading gradient, the one implied by the cast-shadow geometry, and the one implied by pre-existing scene shadows. The weight $\lambda$ balances the two terms.

Surface normals come from monocular depth, using MiDaS as InseRF does (InseRF). Ratios are taken as robust medians over automatically segmented lit, self-shadow and cast-shadow regions. Interreflections, glossy materials and multiple lights all violate the model. We do not hide this: we report the regimes where the check is valid and where it is not.

Research Program

The work proceeds in three stages.

The first stage validates the verifier on synthetic scenes. Objects are rendered into PolyHaven environments, the indoor inverse-rendering benchmark DiPIR uses, under known lighting. We then inject controlled inconsistencies: rotated shadows, a mismatched direct-to-ambient ratio, and shadows removed or doubled. This tests whether $R$ ranks these failures correctly.

The second stage uses $R$ as guidance. The residual is computed on SHINE's predicted clean image at intermediate denoising steps, and its gradient is added to SHINE's existing loss terms. No model weights are trained.

The third stage is the ablation that carries the idea. In the shared-light variant, a single estimate $(\ell, D/A)$ is fit jointly to both witnesses and to the scene's existing shadows. In the cloned-light variant, the object term and the shadow term each fit their own light. If the benefit comes from the bookkeeping, the shared variant should win, and specifically on shadow direction and contrast agreement.

Baselines

The naive reference point is SHINE run unchanged with its default settings. It is training-free, so adding our guidance is a strictly additive comparison under identical models, prompts, bounding boxes and seeds. A cruder floor is copy-paste without any lighting effects, the same input ObjectDrop's bootstrapping starts from. SHINE is also the strongest asset-free competitor. Its reported advantage over AnyDoor and EEdit on ComplexCompo, measured with DreamSim and ImageReward, comes with no absolute numbers: no reported result found on Lacuna for SHINE's DreamSim or ImageReward values. We will rerun it ourselves.

ObjectDrop is the strongest data-driven competitor. The reported figures are a removal PSNR (peak signal-to-noise ratio) of 23.153 against about 21.2 for standard inpainting, and an insertion preference of 88.9% over AnyDoor in a blind user study (ObjectDrop). If ObjectDrop weights are unavailable, we report AnyDoor and state that substitution.

DiPIR is the physics-based upper reference, used only on scenes where a 3D asset exists. It was preferred over StyleLight and DiffusionLight more than 50% of the time across lighting conditions (DiPIR). It gets its full per-scene tuning budget, and we report its wall-clock time next to ours.

For the metric, the baseline is the large-multimodal-model (LMM) Score from EditEval, which correlates 0.8–0.9 with human judgment (Diffusion Model-Based Image Editing: A Survey). DreamSim and ImageReward serve as further metric baselines.

The cloned-light ablation is the baseline that isolates the key ingredient. We count the proposal as beating SHINE if guided SHINE reduces shadow-direction error and $R$ on ComplexCompo without loss in DreamSim and ImageReward, and wins a blind preference study. We count the verifier as beating LMM Score if it achieves higher AUC (area under the ROC curve) at detecting injected inconsistencies.

Why not just…?

Why not just use a differentiable renderer like DiPIR? DiPIR is physically better wherever it applies, and on asset scenes we expect it to match or beat us. It needs a 3D object model, per-scene LoRA fine-tuning (low-rank adaptation, a cheap way to fine-tune a large model) and heavy optimization, so it does not address insertion of generated or photographed objects. Our comparison restricted to asset scenes will show how much of DiPIR's consistency a 2D check recovers, and at what cost.

Why not just trust the foundation model, as SHINE does? SHINE's own result shows that the prior knows a great deal about light. Nothing in it couples the object's shading to its shadow. The guided-versus-unguided comparison settles whether that coupling still fails at FLUX scale. If unguided SHINE already scores low $R$, the proposal reduces to a metric contribution, and we will report it as such.

Why not just collect more counterfactual data, as ObjectDrop does? ObjectDrop's own limitations, unidirectional effects and wrong-direction shadows, survived 350,000 bootstrapped images. That suggests data alone does not teach that the two witnesses must agree. More data remains a real threat. Using $R$ as a filter on bootstrapped pairs is the natural follow-up if guidance helps.

Why not just ask a multimodal judge? LMM Score tracks human judgment overall. Whether it detects subtle ratio mismatches is untested, and the synthetic AUC comparison answers that directly.

Why not drop the quantum framing entirely? The method stands classically, and a reader may discard the lens. It earned its place by suggesting the ledger view and the shadow-as-witness test.

Decisive Checks

The idea fails if any of three things happens. On synthetic PolyHaven renders, $R$ might fail to beat LMM Score, DreamSim and ImageReward at detecting injected inconsistencies. The shared-light variant might fail to beat the cloned-light variant on shadow-direction error on ComplexCompo's 300 pairs. Or guided SHINE might lose in blind preference to unguided SHINE. We also report the fraction of ComplexCompo and EditEval images on which the matte single-light model is judged valid. If that fraction is small, the honest conclusion is that reciprocity is a narrow tool for outdoor, sunlit compositing.