SDM: Spatial Diffusion Model for Large Hole Image Inpainting

Wenbo Li, Xin Yu, Kun Zhou, Yibing Song, Zhe Lin, Jiaya Jia

Abstract

Generative adversarial networks (GANs) have made great success in image inpainting yet still have difficulties tackling large missing regions. In contrast, iterative probabilistic algorithms, such as autoregressive and denoising diffusion models, have to be deployed with massive computing resources for decent effect. To achieve high-quality results with low computational cost, we present a novel pixel spread model (PSM) that iteratively employs decoupled probabilistic modeling, combining the optimization efficiency of GANs with the prediction tractability of probabilistic models. As a result, our model selectively spreads informative pixels throughout the image in a few iterations, largely enhancing the completion quality and efficiency. On multiple benchmarks, we achieve new state-of-the-art performance. Code is released at https://github.com/fenglinglwb/PSM.

Introduction

Image inpainting—the process of reconstructing missing or corrupted parts of a photo—is a classic "ill-posed" problem in computer vision. The primary challenge lies in filling large "holes" in a way that maintains both local texture and global structural consistency. For years, the field has been divided between two paradigms: Generative Adversarial Networks (GANs), which are computationally efficient but prone to artifacts in large regions, and Denoising Diffusion Probabilistic Models (DDPMs), which produce high-quality results but require hundreds of iterations, making them slow and resource-intensive.

Figure 4: An example of the complex, large-hole masks used to evaluate the model's ability to reconstruct intricate urban scenes.

This paper introduces the Pixel Spread Model (PSM), a novel approach that achieves diffusion-level quality at a fraction of the cost. By iteratively "spreading" the most certain pixels into missing regions, PSM provides a middle ground that leverages the strengths of both GANs and probabilistic modeling.

Methodology

The core innovation of the PSM is Iteratively Decoupled Probabilistic Modeling. Instead of treating image generation as a single-step process, the authors decouple the prediction of content from the estimation of uncertainty.

Decoupled Modeling

The model simultaneously predicts an inpainted result (the mean) and an uncertainty map (the variance). The mean is optimized using implicit modeling (GAN and perceptual losses) to ensure visual realism, while the variance is trained explicitly using Gaussian regularization.

The Pixel Spread Strategy

Unlike standard diffusion models that refine every pixel at every step, PSM is selective. In each iteration, it predicts the entire hole but only retains the pixels with the lowest uncertainty scores. These "trusted" pixels act as anchors for the next iteration, gradually spreading information from the known edges into the center of the hole. This allows the model to achieve high-quality results in just 3 to 4 iterations.

Uncertainty-Guided Attention

The researchers modified the standard Transformer attention mechanism to incorporate the predicted uncertainty map. This allows the model to prioritize "listening" to informative pixels while ignoring noisy, unrefined regions, further enhancing structural consistency across large distances.

Experiments and Results

The PSM was evaluated on two major benchmarks: Places2 (diverse scenes) and CelebA-HQ (high-quality faces).

Figure 6: Qualitative comparison across multiple datasets, demonstrating the model's success in reconstructing landscapes, interiors, and facial features.

Key Findings

  • Efficiency: PSM is approximately 10x faster than Latent Diffusion Models (LDM), processing a 512x512 image in roughly 250ms.
  • Lightweight Architecture: The model achieves state-of-the-art results with only 20% of the parameters used by LDM.
  • Superior Quality: On the Places2 benchmark, PSM improved the FID score by 1.1 over LDM. Qualitative results show sharper structures and more realistic textures, particularly in complex architectural and facial tasks.

Conclusion

The Pixel Spread Model (PSM) represents a significant step forward in efficient image inpainting. By using uncertainty as a decision-making tool, the model filters out hallucinations and artifacts typical of single-shot GANs while avoiding the heavy computational burden of traditional diffusion models. Future work will explore extending this "pixel spread" logic to other generative tasks, such as text-to-image generation.

Summary updated

BibTeX
@misc{li2022sdm,
  author = {Wenbo Li and Xin Yu and Kun Zhou and Yibing Song and Zhe Lin and Jiaya Jia},
  title = {{SDM: Spatial Diffusion Model for Large Hole Image Inpainting}},
  year = {2022},
  eprint = {2212.02963},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2212.02963},
}
Figure