Semantic Editing with Coupled Stochastic Differential Equations

Jianxin Zhang, Clayton Scott

Introduction

While text-to-image models like Stable Diffusion and Flux can generate stunning visuals, precisely editing existing images remains a significant challenge. The ideal editing tool modifies specific semantic elements (e.g., changing a "spoon" to a "fork") while perfectly preserving the original lighting, textures, and background. Existing methods often struggle with this balance. Techniques like SDEdit introduce excess noise that distorts the original structure, while attention-sharing methods are tied to specific neural architectures (like Transformers) and can be difficult to tune. High-fidelity alternatives often require slow, computationally expensive test-time optimization.

To address this, researchers introduce sync-SDE, a training-free, architecture-agnostic method that uses coupled stochastic differential equations (SDEs) to guide the sampling process. By driving both the source and edited images with the same correlated noise, sync-SDE achieves near-pixel-level structural consistency while faithfully following new text prompts.

Methodology: Synchronous Coupling and Sync-SDE

The core innovation of sync-SDE lies in the mathematics of Coupled SDEs. Every generative SDE consists of a drift component (the signal guided by the text prompt) and a diffusion component (the noise, or Brownian motion). The authors realized that stochastic noise in a diffusion model is not just random variation; it encodes the fine-grained structural "DNA" of an image. By using the exact same noise path to drive two different generation processes, the processes remain synchronized in their fluctuations.

The workflow operates in two main steps:

  1. Inversion: The source image is inverted to extract the specific Brownian motion path that produced it.
  2. Coupled Sampling: A second generative process is run using the target prompt, forced to follow the exact inverted noise path from the source image.

Mathematically, this sync-SDE approach is proven to be a greedy choice for optimal bicausal Monge transport. It represents the mathematically optimal way to transition from one image distribution to another while minimizing local changes at every step. The authors also introduce a more stable variant, Resampling-ODE, which evolves the difference between the two images to reduce sensitivity to hyperparameters.

Crucially, this method is "plug-and-play." It requires no fine-tuning or auxiliary networks and works out-of-the-box with any model that can be sampled via SDEs, including state-of-the-art models like Flux.1[dev].

Datasets and Evaluation

To evaluate sync-SDE, the researchers utilized both standard and custom datasets:

  • Custom Benchmark: A dataset of 306 image-prompt triplets, utilizing 91 high-resolution (1024x1024) images sourced from Pexels.com. These images were uploaded after the release of the Flux model to prevent data leakage.
  • Standard Benchmarks: Div2K and PIE-Bench, widely used for image restoration and editing tasks.
  • Prompting Strategy: Source prompts were generated using the BLIP model and manually refined to ensure high descriptive accuracy, which is critical for the inversion process.

Key Results

The method consistently achieves a superior "editing budget"—the optimal trade-off between prompt adherence and source fidelity—compared to previous state-of-the-art methods.

  • Quantitative Performance: In evaluations plotting CLIP score (prompt alignment) against LPIPS (perceptual distance/distortion), sync-SDE consistently occupies the optimal "upper-left" quadrant, indicating high prompt fidelity with minimal distortion to the original image.
  • Qualitative Fidelity: Sync-SDE preserves minute details that competing methods (such as FlowEdit or RF-Edit) often alter. Examples include maintaining a subject's exact eye color when adding glasses or preserving the specific foam pattern on a latte when changing the time on a nearby digital clock.
  • Efficiency: The process is highly practical for real-world applications, taking approximately 15–25 seconds to process a 1024x1024 image on an NVIDIA H100 GPU.

Limitations and Future Directions

While powerful, sync-SDE has notable limitations. Because it acts as a "greedy" optimizer, it can sometimes preserve too much of the original structure. For instance, when attempting to remove an object entirely, the model may instead morph it into a similarly shaped background element rather than deleting it.

Additionally, the quality of the edit is highly sensitive to the accuracy of the source prompt; an inaccurate source prompt degrades the transport between the image distributions. Future work may explore non-identity coupling—finding an optimal orthonormal matrix to handle more radical semantic changes while maintaining structural ties—though this approach currently remains computationally expensive.

Summary updated

BibTeX
@inproceedings{zhang2026semantic,
  author = {Jianxin Zhang and Clayton Scott},
  title = {{Semantic Editing with Coupled Stochastic Differential Equations}},
  booktitle = {International Conference on Machine Learning},
  year = {2026},
  url = {https://openreview.net/forum?id=kaOPDyq5sv},
}
Figure