PostEdit: Posterior Sampling for Efficient Zero-Shot Image Editing

Feng Tian, Yixuan Li, Yichao Yan, Shanyan Guan, Yanhao Ge, Xiaokang Yang

Overview

PostEdit is a novel, zero-shot image editing framework that leverages posterior sampling to achieve blazing-fast, high-quality edits without the need for model training or slow image inversion. By treating the original image as a "measurement" to guide the diffusion process, it perfectly balances prompt controllability, background preservation, and high efficiency, completing edits in just 1.5 seconds.

The Trilemma of Image Editing

When using text-to-image diffusion models to edit existing images, researchers face a frustrating trilemma: balancing controllability (matching the edit to the text prompt), background preservation (keeping the unedited regions intact), and efficiency (speed of the process).

Currently, there are two main approaches, both with significant drawbacks:

  1. Inversion-based methods: These carefully reverse the diffusion process to turn an image into noise, then denoise it with a new prompt. Because of the math behind Classifier-Free Guidance (CFG), this naturally introduces errors that alter the background. Fixing this requires heavy, time-consuming optimization, often taking minutes per image.
  2. Inversion-free methods: These skip the slow inversion step to achieve fast edits. However, without a mathematical anchor to the original image, they lack theoretical guarantees for keeping the background intact.
Comparison of editing paradigms

The authors of PostEdit ask: Can we achieve the speed of inversion-free methods while maintaining the strict background consistency of inversion-based methods?

The PostEdit Approach

To solve this, the authors introduce PostEdit, an inversion-free and training-free method that frames image editing as an inverse problem solved via posterior sampling.

Here is how the framework operates:

  • Skipping DDIM Inversion: Instead of slowly inverting an image step-by-step through a neural network, PostEdit simply adds random Gaussian noise directly to the latent representation of the original image in a single step.
  • Posterior Sampling: During the fast denoising process (utilizing efficient solvers like Latent Consistency Models, or LCMs), PostEdit estimates the clean image at each step. It then applies a mathematical correction using a "measurement" term—essentially a randomly masked version of the original image.
  • Langevin Dynamics: The method uses gradient descent and Langevin dynamics to pull the generated image toward the original image's background, actively correcting the drift caused by CFG.
  • Weighted Feature Injection: The authors found that applying posterior sampling to massive models like Stable Diffusion often scrambles the image's layout. To fix this, they introduce a weighted process that explicitly injects a small fraction of the original image's latent features into the estimated clean image at each step, anchoring the layout.

Key Insights

  • CFG is the culprit for background drift: The unconditional score term in Classifier-Free Guidance inherently introduces bias during standard diffusion inversion. This is the root cause of why unedited regions magically change during text-guided editing.
  • Editing as an Inverse Problem: Inverse problems (like fixing a blurry or masked image) rely on a known "measurement" to guide the reconstruction. By treating the unedited background of an image as this measurement, posterior sampling can mathematically force the diffusion model to preserve those regions.
  • The Generalization vs. Layout Trade-off: Standard posterior sampling works perfectly on narrow models (like FFHQ for faces) but fails on massive models (like Stable Diffusion) because the vast latent space allows the layout to shift wildly. The authors' simple trick of injecting weighted initial features elegantly bridges this gap.

Key Results

Evaluated primarily on the PIE-Bench dataset (700 images across 10 editing types), PostEdit demonstrates exceptional performance across the board.

Quantitative comparison of PostEdit against baseline methods
  • State-of-the-Art Quality: PostEdit achieved the highest CLIP similarity scores on the PIE-Bench dataset (26.76 for the whole image, 24.14 for the edited region), proving it aligns incredibly well with target prompts.
  • High Efficiency: The method requires only ~1.5 seconds and 18 GB of VRAM on a single NVIDIA A100 GPU. This is orders of magnitude faster than popular inversion-based methods like NTI (which takes ~120 seconds).
  • Background Preservation: Among all highly efficient methods (running in under 2 seconds), PostEdit achieved the best Mean Squared Error (MSE) for background preservation.

Limitations and Future Work

While highly effective, the authors acknowledge a few limitations. PostEdit struggles with highly specific, structural scene changes (e.g., "a man raising his hand"), where methods using explicit spatial conditions (like ControlNet) still perform better. Additionally, while vastly improved for its speed class, background preservation is not absolutely flawless. Finally, the generation quality and inference speed are fundamentally bottlenecked by the underlying diffusion model, meaning future upgrades to faster baselines (like SDXL-Turbo) could yield even greater performance gains.

Summary updated

BibTeX
@inproceedings{tian2025postedit,
  author = {Feng Tian and Yixuan Li and Yichao Yan and Shanyan Guan and Yanhao Ge and Xiaokang Yang},
  title = {{PostEdit: Posterior Sampling for Efficient Zero-Shot Image Editing}},
  booktitle = {International Conference on Learning Representations},
  year = {2025},
  url = {https://openreview.net/forum?id=J8YWCBPgx7},
}
Figure