Focus-and-Disperse: A Fine-to-Broad Context Aggregation for Image Inpainting
Jia Qin, Yue Lv, Shuangjiao Zhai, Zanxia Jin, Mengli Wang, Pinle QinAlthough generative models have achieved impressive visual plausibility in image inpainting, they still face challenges in high-fidelity content restoration, as the generated structures may deviate from real-world appearances. In this paper, to achieve accurate inpainting results, we propose the Focus-and-Disperse Inpainting (FDInpaint), a fine-to-broad context aggregation network that follows a focus-and-disperse paradigm. Specifically, FDInpaint first focuses on accurately identifying and reconstructing subtle details and textures through optimized gradient propagation, and subsequently disperses these refined cues across the entire image to seamlessly integrate restored regions with known content, thereby maintaining global visual consistency. Firstly, considering that image textures are intrinsically characterized by local intensity variations and geometric transitions, gradient information provides essential structural priors for accurately recovering missing content. By capturing complementary edge variations and curvature changes, gradient propagation effectively guides the reconstruction of sharp boundaries, delicate textures, and coherent structures, while reducing ambiguity and artifacts introduced during content generation. According to that, we design the Multi-Granularity Gradient-based Detail Perceptron (MGDP) within a scale-cross augmentation framework to explicitly localize and restore subtle micro-structures that are difficult to recover through semantic features alone. Furthermore, we propose the Patch-based Hybrid Consistency Aggregation (PHCA), a hierarchical consistency propagation module that progressively enlarges the optimization region from small local patches to larger contextual patches and ultimately the whole image. Through this patch-to-image aggregation process, PHCA continuously aligns reconstructed content with known regions by modeling local details and global dependencies, thereby achieving seamless transitions and maintaining global visual consistency. This refinement process enables seamless transitions between inpainted and known areas while maintaining global structural coherence without relying on stochastic sampling. Extensive experiments on Places2, CelebA-HQ, ICDAR, and COCO datasets demonstrate that FDInpaint achieves superior restoration accuracy and visual quality compared with state-of-the-art inpainting methods.