Recently, various methods have been proposed to address the inconsistency issue of DDIM inversion to enable image editing, such as EDICT [36] and Null-text inversion [22]. However, the above methods introduce considerable computational overhead. In this paper, we propose a new technique, named \emph{bi-directional integration approximation} (BDIA), to perform exact diffusion inversion with neglible computational overhead. Suppose we would like to estimate the next diffusion state $\boldsymbol{z}_{i-1}$ at timestep $t_i$ with the historical information $(i,\boldsymbol{z}_i)$ and $(i+1,\boldsymbol{z}_{i+1})$. We first obtain the estimated Gaussian noise $\hat{\boldsymbol{\epsilon}}(\boldsymbol{z}_i,i)$, and then apply the DDIM update procedure twice for approximating the ODE integration over the next time-slot $[t_i, t_{i-1}]$ in the forward manner and the previous time-slot $[t_i, t_{t+1}]$ in the backward manner. The DDIM step for the previous time-slot is used to refine the integration approximation made earlier when computing $\boldsymbol{z}_i$. A nice property of BDIA-DDIM is that the update expression for $\boldsymbol{z}_{i-1}$ is a linear combination of $(\boldsymbol{z}_{i+1}, \boldsymbol{z}_i, \hat{\boldsymbol{\epsilon}}(\boldsymbol{z}_i,i))$. This allows for exact backward computation of $\boldsymbol{z}_{i+1}$ given $(\boldsymbol{z}_i, \boldsymbol{z}_{i-1})$, thus leading to exact diffusion inversion. It is demonstrated with experiments that (round-trip) BDIA-DDIM is particularly effective for image editing. Our experiments further show that BDIA-DDIM produces markedly better image sampling qualities than DDIM for text-to-image generation. BDIA can also be applied to improve the performance of other ODE solvers in addition to DDIM. In our work, it is found that applying BDIA to the EDM sampling procedure produces new SOTA performance over CIFAR10.
翻译:近年来,针对DDIM逆过程存在的不一致性问题(该问题旨在支持图像编辑),学界提出了多种方法,例如EDICT [36]和空文本逆过程 [22]。然而,上述方法引入了显著的计算开销。本文提出了一种名为“双向积分逼近”(BDIA)的新技术,能够在几乎不增加计算开销的情况下实现精确的扩散逆过程。假设我们希望利用历史信息$(i,\boldsymbol{z}_i)$和$(i+1,\boldsymbol{z}_{i+1})$来估计时间步$t_i$处的下一个扩散状态$\boldsymbol{z}_{i-1}$。我们首先获取估计的高斯噪声$\hat{\boldsymbol{\epsilon}}(\boldsymbol{z}_i,i)$,随后对DDIM更新过程进行两次应用:一次用于近似正向传播中下一时间段$[t_i, t_{i-1}]$的ODE积分,另一次用于近似反向传播中上一时间段$[t_i, t_{t+1}]$的ODE积分。其中,针对上一时间段的DDIM步骤用于修正先前计算$\boldsymbol{z}_i$时所做的积分逼近。BDIA-DDIM的一个优良特性在于,$\boldsymbol{z}_{i-1}$的更新表达式是$(\boldsymbol{z}_{i+1}, \boldsymbol{z}_i, \hat{\boldsymbol{\epsilon}}(\boldsymbol{z}_i,i))$的线性组合。这使得在已知$(\boldsymbol{z}_i, \boldsymbol{z}_{i-1})$的情况下能够精确反向计算$\boldsymbol{z}_{i+1}$,从而实现精确的扩散逆过程。实验表明,(往返)BDIA-DDIM在图像编辑任务中尤为有效。进一步实验显示,在文本到图像生成中,BDIA-DDIM所产生的图像采样质量显著优于DDIM。除DDIM外,BDIA还可用于提升其他ODE求解器的性能。本研究发现,将BDIA应用于EDM采样过程后,其在CIFAR10数据集上取得了新的最优性能。