PS-Diffusion: Photorealistic Subject-Driven Image Editing with Disentangled Control and Attention

Weicheng Wang, Guoli Jia, Zhongqi Zhang, Liang Lin, Jufeng YangCVPR 2025

Abstract

Subject-driven image editing (SDIE) aims to integrate a specific object from a reference image into a target scene. While current diffusion models excel at maintaining semantic identity, they often fail to achieve physical consistency, resulting in objects that appear "pasted" without proper shadows, reflections, or lighting. We introduce PS-Diffusion, a novel framework that achieves photorealistic editing by explicitly modeling physical interactions. By disentangling foreground lighting control from background environmental effects and employing a specialized attention mechanism, PS-Diffusion ensures that inserted objects blend seamlessly into their new environments while preserving their original identity.

Introduction

The core challenge in subject-driven image editing is achieving "photorealism"—the seamless blending of a target object into a source scene's unique lighting and environmental context. Most existing tools either ignore physical effects like shadows and reflections, leading to a "floating" appearance, or inadvertently alter the background excessively. PS-Diffusion recognizes that a realistic edit must affect pixels both inside and outside the user-defined mask to account for environmental interactions.

Methodology

PS-Diffusion utilizes a "disentangled control" strategy to handle the complexities of the editing process through three primary components:

  1. Foreground Effect Condition Branch (FECB): This module focuses on the object's appearance. It employs intrinsic image decomposition to separate the source scene's lighting (shading) from its colors (albedo). By estimating the scene's lighting parameters, the model can "reshade" the new object to match the environment's illumination.
  2. Background Effect Control Branch (BECB): This branch manages the area outside the user-provided mask. It predicts an "effect map" to identify where shadows and reflections should appear. A "rough mask" estimated from the LAB color space guides the initial learning of brightness changes.
  3. Effect Attention Module (EAM): Standard attention mechanisms often conflate subject features with interaction features (e.g., shadows). EAM is a specialized module within the denoising U-Net that decouples these elements, allowing the model to learn environmental interactions without distorting the object's identity.

Datasets and Evaluation

To address the lack of high-quality paired data, the authors introduced Replace-5K, a synthetic dataset of 5,000 image pairs created using the Blender 3D engine. This dataset provides perfect ground truth for shadows, reflections, and lighting behavior during object replacement. Additionally, the model was evaluated on real-world benchmarks, including the DreamBooth and DreamEdit datasets.

Key Results

PS-Diffusion achieves state-of-the-art performance across both quantitative and qualitative metrics. On the Replace-5K dataset, it significantly outperformed competitors such as IP-Adapter and AnyDoor, improving PSNR by over 1.0.

Qualitative comparison of PS-Diffusion results across various physical effects and datasets.

Qualitatively, the model produces much more realistic physical interactions. As shown in the results above, PS-Diffusion correctly generates shadows that follow the direction of the scene's light source and creates accurate reflections on polished surfaces, whereas baseline models often produce physically impossible results or no effects at all.

Conclusion and Future Work

PS-Diffusion demonstrates that disentangling lighting and background effects is crucial for photorealistic subject-driven editing. While highly effective, the model faces challenges in extreme lighting conditions or highly complex scene geometries. Future research will focus on incorporating 3D geometry estimation and more sophisticated lighting estimators to further enhance realism in complex environments.

Summary updated

BibTeX
@inproceedings{wang2025ps,
  author = {Weicheng Wang and Guoli Jia and Zhongqi Zhang and Liang Lin and Jufeng Yang},
  title = {{PS-Diffusion: Photorealistic Subject-Driven Image Editing with Disentangled Control and Attention}},
  booktitle = {IEEE/CVF Conference on Computer Vision and Pattern Recognition},
  year = {2025},
  doi = {10.1109/cvpr52734.2025.01706},
}
Figure