One Stone with Two Birds: A Null-Text-Null Frequency-Aware Diffusion Models for Text-Guided Image Inpainting
Haipeng Liu, Yang Wang, Meng Wang
TL;DR
NTN-Diff tackles the dual challenges of preserving unmasked regions and achieving semantic consistency between masked and unmasked areas in text-guided image inpainting. It introduces a null-text-null frequency-aware diffusion framework that decouples semantics by frequency bands and diffusion stages, using a three-branch early-stage denoising (low- and mid-frequency) guided by null-text and text prompts, followed by a late-stage refinement with unmasked-region preservation. Core ideas include adaptive low- and mid-frequency masking via DCT-based band separation, replacement of bands across branches, and a final text-guided pass that enforces cross-band semantic alignment. Empirical results on BrushBench and EditBench show NTN-Diff outperforms state-of-the-art diffusion models in both inpainting and outpainting, with Ablation studies validating the contributions of each denoising pathway and the importance of adaptive frequency extraction; code is released for reproducibility.
Abstract
Text-guided image inpainting aims at reconstructing the masked regions as per text prompts, where the longstanding challenges lie in the preservation for unmasked regions, while achieving the semantics consistency between unmasked and inpainted masked regions. Previous arts failed to address both of them, always with either of them to be remedied. Such facts, as we observed, stem from the entanglement of the hybrid (e.g., mid-and-low) frequency bands that encode varied image properties, which exhibit different robustness to text prompts during the denoising process. In this paper, we propose a null-text-null frequency-aware diffusion models, dubbed \textbf{NTN-Diff}, for text-guided image inpainting, by decomposing the semantics consistency across masked and unmasked regions into the consistencies as per each frequency band, while preserving the unmasked regions, to circumvent two challenges in a row. Based on the diffusion process, we further divide the denoising process into early (high-level noise) and late (low-level noise) stages, where the mid-and-low frequency bands are disentangled during the denoising process. As observed, the stable mid-frequency band is progressively denoised to be semantically aligned during text-guided denoising process, which, meanwhile, serves as the guidance to the null-text denoising process to denoise low-frequency band for the masked regions, followed by a subsequent text-guided denoising process at late stage, to achieve the semantics consistency for mid-and-low frequency bands across masked and unmasked regions, while preserve the unmasked regions. Extensive experiments validate the superiority of NTN-Diff over the state-of-the-art diffusion models to text-guided diffusion models. Our code can be accessed from https://github.com/htyjers/NTN-Diff.
