# SDEdit

**SDEdit**（随机微分编辑，Stochastic Differential Editing）是一种图像合成与编辑方法：它接收一张输入图像以及任意类型的用户引导（例如手绘彩色笔画），向图像中添加噪声，再通过扩散模型生成先验对结果去噪，从而产出一张既真实又忠实于引导的图像。该方法由陈林·孟（Chenlin Meng）、何雨桐（Yutong He）、宋阳（Yang Song）、宋佳明（Jiaming Song）、吴佳俊（Jiajun Wu）、朱俊彦（Jun-Yan Zhu）和[斯特凡诺·埃尔蒙](https://www.edgepedia.org/zh/stefano-ermon)（Stefano Ermon）在2021年8月的arXiv论文《SDEdit：基于随机微分方程的引导式图像合成与编辑》中提出，并发表于ICLR 2022。<sup>[1](https://arxiv.org/abs/2108.01073)</sup><sup> • </sup><sup>[2](https://openreview.net/pdf?id=aBsCjcPu_tE)</sup>

| 关键事实 | 详情 |
|---|---|
| 核心操作 | 向输入图像添加噪声，再通过随机微分方程（SDE）先验迭代去噪，以提升真实感<sup>[1](https://arxiv.org/abs/2108.01073)</sup> |
| 训练需求 | 无需任务专用训练，也无需GAN反演；以预训练扩散模型作为生成先验即可工作<sup>[1](https://arxiv.org/abs/2108.01073)</sup> |
| 关键机制 | 逆向SDE不仅可以从t\(_{0}\) = 1求解，还可以从(0, 1)区间内任意中间时刻t\(_{0}\)求解，作者称此前的基于SDE的生成模型未曾研究过这一做法<sup>[3](https://tomesphere.com/paper/2108.01073)</sup> |
| 报告增益 | 在人类感知研究中，真实感最高超出当时最先进的基于GAN的方法98.09%，整体满意度最高超出91.72%<sup>[1](https://arxiv.org/abs/2108.01073)</sup> |
| 任务 | 基于笔画的图像合成与编辑，以及图像合成拼接<sup>[1](https://arxiv.org/abs/2108.01073)</sup> |
| 主要控制旋钮 | 开始去噪时的噪声水平（时间步）；它决定了对输入忠实度与输出真实感之间的权衡<sup>[4](https://ucladeepvision.github.io/CS163-Projects-2025Fall/2025/11/18/team37-diffusion-image-editing.html)</sup> |
| 发表 | arXiv 2021年8月2日（v2，2022年1月5日）；ICLR 2022会议论文<sup>[1](https://arxiv.org/abs/2108.01073)</sup><sup> • </sup><sup>[2](https://openreview.net/pdf?id=aBsCjcPu_tE)</sup> |

## 工作原理

该方法建立在扩散模型的数学原理之上：前向SDE用高斯噪声逐步破坏数据，学习得到的逆向SDE则将样本去噪、送回数据分布。按论文记号，\( \mathbf{x}(0) \sim p_{0} = p_{\text{data}} \)是来自数据分布的一个样本，前向SDE通过高斯扩散对\( t \in (0, 1] \)生成\( \mathbf{x}(t) \)。<sup>[3](https://tomesphere.com/paper/2108.01073)</sup>

编辑的诀窍在于从这条轨迹的中途启动逆向过程。给定一张带有用户引导的输入图像，SDEdit先添加噪声，将输入带到某个中间噪声水平，然后从该点求解逆向SDE。论文指出，逆向SDE不仅可以从\( t_{0} = 1 \)求解——即像普通生成那样从纯噪声出发——还可以从任意中间时刻\( t_{0} \in (0, 1) \)求解，作者称此前的基于SDE的生成模型未曾研究过这一做法。<sup>[3](https://tomesphere.com/paper/2108.01073)</sup>所选的噪声水平成为唯一的控制量，在两项相互竞争的目标之间取得平衡：对用户输入的忠实度，以及合成图像的真实感。<sup>[1](https://arxiv.org/abs/2108.01073)</sup>

由于引导仅通过加噪后的输入进入，SDEdit不需要任务专用训练、不需要额外的损失函数、也不需要GAN反演；作者将此与条件GAN及GAN反演方法作对比，后者往往需要额外训练数据或针对每个应用的损失函数。<sup>[1](https://arxiv.org/abs/2108.01073)</sup>

## 原始结果

论文在基于笔画的图像合成、基于笔画的编辑和图像合成拼接上评估了SDEdit。根据一项人类感知研究，它以较大幅度击败了领先的GAN方法，真实感增益达98.09%，整体满意度增益达91.72%。<sup>[1](https://arxiv.org/abs/2108.01073)</sup>作者还用模拟人类绘画的笔触画进行了测试，报告称SDEdit能从这些输入生成高质量图像，而基线方法未能取得可比的结果。<sup>[5](https://jiajunwu.com/papers/sdedit_iclr.pdf)</sup>

## 作为基线及后续比较

在随后的扩散编辑方法浪潮中，SDEdit成为标准基线。后来的论文在固定加噪强度下（常用0.5和0.75）将其与[Prompt-to-Prompt](https://www.edgepedia.org/zh/prompt-to-prompt)、DiffEdit、Pix2pix-zero、MasaCtrl和[InstructPix2Pix](https://www.edgepedia.org/zh/instructpix2pix)等方法进行比较。<sup>[6](https://openaccess.thecvf.com/content/CVPR2024/papers/Liu_Towards_Understanding_Cross_and_Self-Attention_in_Stable_Diffusion_for_Text-Guided_CVPR_2024_paper.pdf)</sup>加州大学洛杉矶分校（UCLA）的一门课程综述概括了它的特点：编辑主要通过噪声水平控制；由于逆向扩散锚定在输入的一个轻度扰动版本上，结构保持度高；无需重新训练；但语义特异性低，细粒度或局部编辑较为困难。<sup>[4](https://ucladeepvision.github.io/CS163-Projects-2025Fall/2025/11/18/team37-diffusion-image-editing.html)</sup>

InstructPix2Pix的作者曾直接与其比较，观察到当内容大致不变而风格改变时，SDEdit效果尚可，但在保持身份特征和分离单个对象方面表现吃力，尤其是当希望做出较大改动时。<sup>[7](https://openaccess.thecvf.com/content/CVPR2023/papers/Brooks_InstructPix2Pix_Learning_To_Follow_Image_Editing_Instructions_CVPR_2023_paper.pdf)</sup>定量方面，ECCV 2024的一项评估报告称，在其基准上SDEdit的FID为21.67，而InstructPix2Pix为17.87，PromptDiffusion为13.75。<sup>[8](https://www.ecva.net/papers/eccv_2024/papers_ECCV/papers/12016.pdf)</sup>后续工作还指出，在扩散的后期阶段，含噪潜变量保留了输入的全局信息但缺乏局部细节，因为SDEdit依赖的正是含噪潜变量中的信息。<sup>[9](https://www.ecva.net/papers/eccv_2024/papers_ECCV/papers/05512.pdf)</sup>

## 保真度与质量的权衡，以及SDE与ODE

噪声水平将保真度与质量耦合在一起：噪声越多，模型越有自由生成真实图像，但破坏的输入也越多；噪声越少，越能保留输入，但输出的改善空间也越受限。后续工作将这种耦合视为经典SDEdit的主要局限。

2023年的一篇分析文章《随机性的福音：在通用的扩散式图像编辑中，SDE优于ODE》给出了偏好随机形式的理论理由。在基于扩散的编辑的统一概率表述中，作者证明两个SDE的边缘分布之间的KL散度（Kullback-Leibler divergence）随时间趋近于零而逐渐减小，而常微分方程（ODE）对应的散度则保持不变，这表明SDE在图像编辑中大有可为。在此基础上，他们为图像修复和图像到图像翻译等任务中广泛使用的ODE基线提供了SDE对应版本，SDE版本表现出一致且显著的提升，他们还提出了SDE-Drag——一种建立在SDE表述之上的基于点的内容拖拽方法。<sup>[10](https://arxiv.org/abs/2311.01410)</sup>

## 在扩散编辑中的位置

扩散模型已成为图像、视频、3D和4D生成与编辑的事实标准，而SDEdit是将预训练扩散模型重新用于编辑而不需重新训练的早期且最简单的方式之一。<sup>[11](https://web.stanford.edu/~gordonwz/diffusion/)</sup>它的噪声水平旋钮在实践中延续下来，成为基于[Stable Diffusion](https://www.edgepedia.org/zh/stable-diffusion)构建的工具中图像到图像翻译的“去噪强度”：将部分加噪的图像作为输入，去噪后产生编辑结果。<sup>[7](https://openaccess.thecvf.com/content/CVPR2023/papers/Brooks_InstructPix2Pix_Learning_To_Follow_Image_Editing_Instructions_CVPR_2023_paper.pdf)</sup>后继方法以不同方式解决其弱点：Prompt-to-Prompt操纵交叉注意力以实现基于提示的控制，InstructPix2Pix则在合成的指令-图像对上训练条件扩散模型，以单次前向传播遵循书面编辑指令。<sup>[4](https://ucladeepvision.github.io/CS163-Projects-2025Fall/2025/11/18/team37-diffusion-image-editing.html)</sup><sup> • </sup><sup>[12](https://arxiv.org/abs/2211.09800)</sup>

## References

1. [Chenlin Meng, Yutong He, Yang Song, Jiaming Song, Jiajun Wu, Jun-Yan Zhu, Stefano Ermon (2021). SDEdit: Guided Image Synthesis and Editing with Stochastic Differential Equations. arXiv:2108.01073.](https://arxiv.org/abs/2108.01073)
2. [SDEdit: Guided Image Synthesis and Editing with Stochastic Differential Equations, ICLR 2022 conference paper.](https://openreview.net/pdf?id=aBsCjcPu_tE)
3. [SDEdit paper summary with method details (Section 3, Guided Image Synthesis and Editing with SDEdit).](https://tomesphere.com/paper/2108.01073)
4. [Diffusion Models for Image Editing: A Study of SDEdit, Prompt-to-Prompt, and InstructPix2Pix, UCLA CS163 project (2025).](https://ucladeepvision.github.io/CS163-Projects-2025Fall/2025/11/18/team37-diffusion-image-editing.html)
5. [SDEdit ICLR 2022 paper with supplementary implementation details, Jiajun Wu's page.](https://jiajunwu.com/papers/sdedit_iclr.pdf)
6. [Liu et al. (2024). Towards Understanding Cross and Self-Attention in Stable Diffusion for Text-Guided Image Editing. CVPR 2024.](https://openaccess.thecvf.com/content/CVPR2024/papers/Liu_Towards_Understanding_Cross_and_Self-Attention_in_Stable_Diffusion_for_Text-Guided_CVPR_2024_paper.pdf)
7. [Tim Brooks, Aleksander Holynski, Alexei A. Efros (2023). InstructPix2Pix: Learning to Follow Image Editing Instructions. CVPR 2023.](https://openaccess.thecvf.com/content/CVPR2023/papers/Brooks_InstructPix2Pix_Learning_To_Follow_Image_Editing_Instructions_CVPR_2023_paper.pdf)
8. [Z. Meng, C. Yang et al. (2024). ECCV 2024 paper comparing SDEdit, InstructPix2Pix, and PromptDiffusion.](https://www.ecva.net/papers/eccv_2024/papers_ECCV/papers/12016.pdf)
9. [ECCV 2024 paper with quantitative 2D image editing evaluation comparing against DiffEdit and SDEdit.](https://www.ecva.net/papers/eccv_2024/papers_ECCV/papers/05512.pdf)
10. [The Blessing of Randomness: SDE Beats ODE in General Diffusion-based Image Editing. arXiv:2311.01410.](https://arxiv.org/abs/2311.01410)
11. [Ryan Po et al. (2024). State of the Art on Diffusion Models for Visual Computing. Computer Graphics Forum 43(2), e15063.](https://web.stanford.edu/~gordonwz/diffusion/)
12. [InstructPix2Pix: Learning to Follow Image Editing Instructions. arXiv:2211.09800.](https://arxiv.org/abs/2211.09800)

---
*Initially written Oct 15, 2026*

Topic: 技术与人造世界 › 计算技术与数字系统 › 现代人工智能：基础模型、生成式人工智能与人工智能产业 › Foundation-model methods and training › Generative media methods: diffusion, flow, and autoregressive generation

Copyright 2026 Edgepedia

License: Edgepedia Community License 1.0, https://www.edgepedia.org/edgepedia/license

Source: https://www.edgepedia.org/zh/sdedit

English original: https://www.edgepedia.org/sdedit
