Realistic shadow generation is a critical component for high-quality image compositing and visual effects, yet existing methods suffer from certain limitations: Physics-based approaches require a 3D scene geometry, which is often unavailable, while learning-based techniques struggle with control and visual artifacts. We introduce a novel method for fast, controllable, and background-free shadow generation for 2D object images. We create a large synthetic dataset using a 3D rendering engine to train a diffusion model for controllable shadow generation, generating shadow maps for diverse light source parameters. Through extensive ablation studies, we find that rectified flow objective achieves high-quality results with just a single sampling step enabling real-time applications. Furthermore, our experiments demonstrate that the model generalizes well to real-world images. To facilitate further research in evaluating quality and controllability in shadow generation, we release a new public benchmark containing a diverse set of object images and shadow maps in various settings. The project page is available at https://gojasper.github.io/controllable-shadow-generation-project/
翻译:逼真的阴影生成是高质量图像合成与视觉特效的关键组成部分,然而现有方法存在一定局限:基于物理的方法需要三维场景几何信息,而这通常难以获取;基于学习的技术则在控制性和视觉伪影方面存在不足。本文提出一种针对二维物体图像的快速、可控且背景无关的阴影生成新方法。我们利用三维渲染引擎创建大规模合成数据集,训练扩散模型以实现可控阴影生成,该模型可为不同光源参数生成阴影贴图。通过大量消融实验,我们发现修正流目标函数仅需单次采样步骤即可获得高质量结果,从而支持实时应用。此外,实验表明该模型能很好地泛化至真实世界图像。为促进阴影生成质量与可控性评估的进一步研究,我们发布了包含多种场景下多样化物体图像与阴影贴图的新公开基准数据集。项目页面详见 https://gojasper.github.io/controllable-shadow-generation-project/