PFB-Diff: Progressive Feature Blending diffusion for text-driven image editing

Wenjing Huang, Shikui Tu, Lei Xu

TL;DR

This paper introduces PFB-Diff, a novel diffusion-based image editing method that tackles the challenge of generating consistent and high-quality edits by progressively blending features across multiple levels of a diffusion model. It also introduces an attention masking mechanism to precisely control where text prompts influence the image, significantly improving multi-object editing and background replacement.

What Problem Does This Paper Address?

Diffusion models have shown incredible promise for image generation, leading to interest in their application for image editing. However, existing diffusion-based editing methods often struggle with artifacts and inconsistencies, especially when editing specific regions or multiple objects. This is largely due to how they blend generated content with the original image at the latent level, which can lack the semantic understanding needed to maintain visual coherence. The authors aim to bridge this gap by developing a method that can perform precise, text-driven image edits while preserving the integrity of irrelevant regions and ensuring high-quality, semantically consistent results, all without requiring model fine-tuning.

Methods

PFB-Diff builds upon pre-trained latent diffusion models (LDMs) and operates in an optimization-free manner. Its core innovations are:

  • Progressive Feature Blending (PFB): Instead of blending at the noisy latent level, PFB operates on the deep feature maps within the diffusion model's noise prediction network. This blending is done progressively from high-level to low-level features, leveraging the rich semantics in these layers to ensure semantic and texture consistency.
  • Attention Masking (AM): To address issues in multi-object editing and background replacement where text prompts can have unintended influences, AM selectively adjusts attention maps. It uses user-provided masks to confine the impact of specific words to designated regions, thereby improving the accuracy of object placement and preventing interference between objects.
  • Pixel-level Blending: In the early stages of the denoising process, the authors also incorporate pixel-level blending to further preserve details in irrelevant regions, especially for object replacement tasks.

Datasets

  • Midjourney-generated dataset: A custom dataset created using over 50 text prompts designed to test various editing scenarios, including object replacement, background changes, and attribute editing. This dataset was primarily used for qualitative experiments.
  • COCO-animals-10k (COCOA-10k): A newly constructed dataset derived from the COCO dataset, containing 9,843 object replacement instances and 1,597 background replacement instances across 9 animal classes. This dataset was used for quantitative evaluation.

Key Insights and Ideas

  • Deep features are key for consistency: Editing at the deep feature level, rather than just noisy latents, is crucial for maintaining semantic and texture consistency in edited images.
  • Progressive blending is better than direct latent blending: Blending features progressively across multiple levels of the diffusion model's architecture leads to more seamless integration of new content.
  • Attention masking is vital for precise control: The AM mechanism is a powerful tool for directing the influence of text prompts, especially in complex scenarios like multi-object replacement, preventing unwanted artifacts and ensuring accurate placement.
  • Optimization-free methods can be highly effective: PFB-Diff demonstrates that achieving state-of-the-art editing results is possible without the need for computationally expensive fine-tuning or per-image optimization.

Key Results

  • Superior Editing Accuracy and Quality: PFB-Diff consistently outperforms existing methods in terms of editing accuracy, CLIP score (measuring text-image alignment), and CLIP-IQA (measuring image quality and perception) on the COCOA-10k dataset. For instance, it achieved an accuracy of 51.87% in object editing, outperforming other methods.
  • Effective Multi-Object and Background Editing: Qualitative results show PFB-Diff excels at replacing multiple objects simultaneously and performing background edits, even with imperfect or coarse masks, while preserving irrelevant regions.
  • High Efficiency: The method is optimization-free, allowing for fast editing without the need for training or fine-tuning.
  • Human Evaluation: A user study rated PFB-Diff's results as the best editing outcomes, considering alignment with text prompts, realism, and faithfulness.

Limitations and Future Work

  • Mask Dependency: PFB-Diff still relies on user-provided masks, which can be inconvenient. The authors acknowledge that mask-based approaches can lead to more accurate results but aim to explore ways to mitigate the inconvenience.
  • Small Object Masking: If the mask for a small object is too small (e.g., < 8x8 pixels in RGB space), its details might be lost due to downsampling.
  • Initial Noise Sensitivity: The method can be sensitive to the initial noise in diffusion models, potentially leading to artifacts like missing object parts or unwanted fur. This is inherited from the underlying Stable Diffusion model.
  • Future Work: The authors plan to explore more complex feature-level operations beyond mask-based blending, such as incorporating explicit geometric sizes for generated objects via trainable bounding box-image cross-attention layers, and investigating feature renormalization for style transfer. They also aim to address the initial noise sensitivity by using more robust diffusion models.

Summary updated

BibTeX
@article{huang2025pfb,
  author = {Wenjing Huang and Shikui Tu and Lei Xu},
  title = {{PFB-Diff: Progressive Feature Blending diffusion for text-driven image editing}},
  journal = {Neural Networks},
  year = {2025},
  doi = {10.1016/j.neunet.2024.106777},
}
Figure