VSDiffusion: Taming Ill-Posed Shadow Generation via Visibility-Constrained Diffusion
Organizations: East China University of Science and Technology, Shanghai, China
Abstract
Generating realistic cast shadows for inserted foreground objects is a crucial yet challenging problem in image composition, where maintaining geometric consistency of shadow and object in complex scenes remains difficult due to the ill-posed nature of shadow formation. To address this issue, we propose VSDiffusion, a visibility-constrained two-stage framework designed to narrow the solution space by incorporating visibility priors. In Stage I, we predict a coarse shadow mask to localize plausible shadow generated regions. And in Stage II, conditional diffusion is performed guided by lighting and depth cues estimated from the composite to generate accurate shadows. In VSDiffusion, we inject visibility priors through two complementary pathways. First, a visibility control branch with shadow-gated cross attention that provides multi-scale structural guidance. Then, a learned soft prior map that reweights training loss in error-prone regions to enhance geometric correction. Additionally, we also introduce high-frequency guided enhancement module to sharpen boundaries and improve texture interaction with the background. Experiments on widely used public DESOBAv2 dataset demonstrated that our proposed VSDiffusion can generate accurate shadow, and establishes new SOTA results across most evaluation metrics.
Figures & tables
| Method | BOS Test Images | BOS-free Test Images | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| GR | LR | GS | LS | GB | LB | GR | LR | GS | LS | GB | LB | |
| ShadowGAN [ 48 ] | 7.511 | 67.464 | 0.961 | 0.197 | 0.446 | 0.890 | 17.325 | 76.508 | 0.901 | 0.060 | 0.425 | 0.842 |
| Mask-SG [ 16 ] | 8.997 | 79.418 | 0.951 | 0.180 | 0.500 | 1.000 | 19.338 | 94.327 | 0.906 | 0.044 | 0.500 | 1.000 |
| AR-SG [ 23 ] | 7.335 | 58.037 | 0.961 | 0.241 | 0.383 | 0.682 | 16.067 | 63.713 | 0.908 | 0.104 | 0.349 | 0.682 |
| SGRNet [ 15 ] | 7.184 | 68.255 | 0.964 | 0.206 | 0.301 | 0.596 | 15.596 | 60.350 | 0.909 | 0.100 | 0.271 | 0.534 |
| DMASNet [ 40 ] | 8.256 | 59.380 | 0.961 | 0.228 | 0.276 | 0.547 | 18.725 | 86.694 | 0.913 | 0.055 | 0.297 | 0.574 |
| VCB | HFGE | SWL | GR | LR | GS | LS | GB | LB |
|---|---|---|---|---|---|---|---|---|
| 6.655 | 50.598 | 0.962 | 0.364 | 0.221 | 0.438 | |||
| ✓ | 6.592 | 48.265 | 0.963 | 0.366 | 0.203 | 0.403 | ||
| ✓ | ✓ | 6.571 | 48.147 | 0.964 | 0.374 | 0.193 | 0.381 | |
| ✓ | ✓ | ✓ | 6.422 | 46.542 | 0.964 | 0.377 | 0.182 | 0.360 |
| Method | GR | LR | GS | LS | GB | LB |
|---|---|---|---|---|---|---|
| Baseline | 6.655 | 50.598 | 0.962 | 0.364 | 0.221 | 0.438 |
| w/o light | 6.545 | 48.149 | 0.963 | 0.373 | 0.197 | 0.390 |
| w/o depth | 6.456 | 47.990 | 0.963 | 0.371 | 0.187 | 0.369 |
| Ours | 6.422 | 46.542 | 0.964 | 0.377 | 0.182 | 0.360 |
Compositional Image Generation
Compositional image generation studies how to combine objects, attributes, spatial relations, and visual references into coherent, controllable images.
See all 85 papers