AdapEdit: Spatio-Temporal Guided Adaptive Editing Algorithm for Text-Based Continuity-Sensitive Image Editing

Zhiyuan Ma, Guoli Jia, Bowen Zhou

Abstract

While text-conditioned diffusion models have revolutionized image generation, precise text-driven editing remains a significant challenge. Current methods often struggle with "soft editing"—fine-grained semantic changes like altering poses or actions—while focusing primarily on "hard editing" tasks like object replacement. We introduce AdapEdit, a spatio-temporal guided adaptive editing algorithm that addresses these limitations. By employing a soft-attention strategy to dynamically adjust guidance degrees across both temporal and spatial dimensions, AdapEdit achieves high-fidelity edits without requiring model training, fine-tuning, or per-image optimization. Our results demonstrate that AdapEdit significantly outperforms existing state-of-the-art methods in preserving model priors and handling complex, continuity-sensitive instructions.

The Soft Editing Dilemma

The field of text-based image editing has largely focused on discrete, "hard" changes—adding, removing, or replacing specific objects. However, users often require "soft" edits: subtle, continuous adjustments to a subject's posture, size, or specific attributes (e.g., changing a "sitting dog" to a "jumping dog").

Conceptual distribution of Hard vs Soft Editing.

Existing methods face three primary hurdles:

  1. The Soft Editing Dilemma: Difficulty in executing fine-grained semantic adjustments without losing subject identity.
  2. Spatio-Temporal Continuity Dilemma: Applying uniform guidance across all pixels and time steps often results in artifacts or unintended global changes.
  3. The Training Dilemma: Many high-performing editors require resource-intensive fine-tuning or optimization, which can degrade the original model's creative capabilities.

Methodology: Spatio-Temporal Guidance

AdapEdit is a training-free, deterministic algorithm designed to plug directly into existing diffusion models like Stable Diffusion. It introduces two core mechanisms to manage guidance dynamically:

Flexible Word-Level Temporal (FWT) Adjustment

Not all tokens in a prompt should influence the denoising process simultaneously. FWT calculates unique temporal scales ($\tau$) for each word. This ensures that the global structure of the original image is preserved during the early stages of denoising, while specific semantic changes (like "spreading wings") are introduced at the optimal time steps.

Dynamic Pixel-Level Spatial (DPS) Weighting

To prevent "semantic leakage"—where an edit to one object inadvertently affects the background—DPS calculates spatial guidance scales. By evaluating the semantic similarity between new text tokens and visual features, it generates a precise mask that localizes the editing influence to the relevant pixels.

Key Results and Evaluation

AdapEdit was evaluated against several prominent baselines, including Prompt-to-Prompt, SDEdit, InstructPix2Pix, and MasaCtrl, using a subset of the InstructPix2Pix dataset.

Visual results of AdapEdit across various hard and soft editing tasks.

Quantitative Performance

AdapEdit achieved state-of-the-art results on key metrics:

  • CLIP Score: 27.08 (the highest among tested methods).
  • CLIP Directional Similarity: 0.13. These scores indicate that AdapEdit's outputs align more closely with the target text prompts than those of competing algorithms.

Qualitative Superiority

In complex "soft editing" scenarios, such as transforming a "sitting dog" into a "jumping dog," AdapEdit successfully modified the subject's pose while maintaining its visual identity and the integrity of the background. In contrast, baseline methods often failed to execute the pose change or completely altered the subject's appearance.

Conclusion

AdapEdit provides a robust, efficient solution for continuity-sensitive image editing. By treating text guidance as a dynamic variable in both space and time, it overcomes the limitations of uniform guidance strategies. As a training-free plug-in with $O(n)$ time overhead, it offers a practical path for high-fidelity generative AI applications. Future work will explore extending this adaptive logic to video editing, where temporal continuity is paramount.

Summary updated

BibTeX
@inproceedings{ma2024adapedit,
  author = {Zhiyuan Ma and Guoli Jia and Bowen Zhou},
  title = {{AdapEdit: Spatio-Temporal Guided Adaptive Editing Algorithm for Text-Based Continuity-Sensitive Image Editing}},
  booktitle = {AAAI Conference on Artificial Intelligence},
  year = {2024},
  url = {https://openreview.net/forum?id=jk6jvVpewJ},
}
Figure