DiT4Edit: Diffusion Transformer for Image Editing

Kunyu Feng, Yue Ma, Bingyuan Wang, Chenyang Qi, Haozhe Chen, Qifeng Chen, Zeyu Wang

Abstract

DiT4Edit is a novel, tuning-free image editing framework that leverages Diffusion Transformers (DiT) to overcome the limitations of traditional UNet-based architectures. By utilizing global self-attention and patch-based processing, DiT4Edit enables high-fidelity, shape-aware editing and supports arbitrary resolutions up to 1024×2048. Technical innovations including DPM-Solver inversion and patch merging allow for significantly faster inference speeds while maintaining superior structural integrity and text alignment.

Introduction

The current landscape of image editing is dominated by UNet-based diffusion models. While effective for texture-heavy tasks, these models suffer from local bias due to the nature of convolutional layers, making long-range structural changes (e.g., pose alterations) difficult. Furthermore, UNets are typically constrained to the resolutions they were trained on, often resulting in artifacts or structural collapse when applied to high-resolution or non-square images.

DiT4Edit addresses these challenges by adopting a Diffusion Transformer (DiT) backbone. Unlike UNets, transformers treat images as sequences of patches, allowing global self-attention to capture long-range dependencies. This architectural shift enables "shape-aware" editing and seamless handling of high-resolution, multi-aspect ratio images.

Methodology

DiT4Edit is a tuning-free framework that integrates three key technical advancements:

  1. DPM-Solver Inversion: Traditional DDIM inversion is slow and often inaccurate for complex transformer latents. DiT4Edit utilizes a high-order DPM-Solver to achieve precise inversion in only 30 steps, ensuring the edited image preserves the original's background and fine details.
  2. Unified Attention Control: To balance fidelity to the source image with adherence to the new text prompt, DiT4Edit controls both Self-Attention and Cross-Attention. By strategically swapping attention features during the denoising process, the model can modify specific subjects while keeping the rest of the scene intact.
  3. Patch Merging: Transformers are computationally intensive. DiT4Edit employs a patch merging strategy that identifies and combines visually redundant patches. This optimization reduces the computational load, making DiT4Edit faster than many existing UNet-based editing pipelines.

Results and Discussion

DiT4Edit was evaluated against several state-of-the-art baselines, including SDEdit, MasaCtrl, and InfEdit, across various resolutions.

DiT4Edit demonstrates versatile editing capabilities across multiple resolutions and tasks, including object replacement (VW to Jeep), background modification (field to beach), and character attribute changes (hair color/length).

Performance Metrics

Quantitative analysis shows that DiT4Edit achieves the lowest FID scores and highest CLIP scores, indicating superior image quality and better alignment with user prompts. Qualitatively, the model excels at "non-rigid" editing—such as changing an object's pose or shape—where convolutional models often fail.

High-Resolution Consistency

A standout feature of DiT4Edit is its ability to handle high-resolution images (up to 1024×2048) without the "doubling" artifacts common in UNet models. By processing the image as a sequence of patches with global attention, the model maintains a coherent global structure regardless of the aspect ratio.

Inference Efficiency

Despite the complexity of transformers, DiT4Edit is highly efficient. At 512×512 resolution, it completes an edit in ~5.15 seconds, significantly faster than competitors like Pix2Pix-Zero (~31s).

Conclusion

DiT4Edit represents a significant step forward in image editing by demonstrating the advantages of transformer architectures over traditional UNets. While limitations remain regarding text encoder precision and minor color shifts, the framework's ability to perform fast, shape-aware, and high-resolution editing makes it a powerful tool for the next generation of generative AI applications. Future work will focus on scaling the architecture and extending these techniques to the video domain.

Summary updated

BibTeX
@inproceedings{feng2025dit,
  author = {Kunyu Feng and Yue Ma and Bingyuan Wang and Chenyang Qi and Haozhe Chen and Qifeng Chen and Zeyu Wang},
  title = {{DiT4Edit: Diffusion Transformer for Image Editing}},
  booktitle = {AAAI Conference on Artificial Intelligence},
  year = {2025},
  doi = {10.1609/aaai.v39i3.32304},
}
Figure