Skip to main content
QUICK REVIEW

[论文解读] InstaFlow: One Step is Enough for High-Quality Diffusion-Based Text-to-Image Generation

Xingchao Liu, Xiwen Zhang|arXiv (Cornell University)|Sep 12, 2023
Generative Adversarial Networks and Image SynthesisComputer Science被引用 20
一句话总结

InstaFlow 将 Stable Diffusion 转变为一个高质量的一步文本到图像生成器,使用 Rectified Flow 和蒸馏,在大约 0.09s 每张图像实现 SD 级图像质量,训练成本低。

ABSTRACT

Diffusion models have revolutionized text-to-image generation with its exceptional quality and creativity. However, its multi-step sampling process is known to be slow, often requiring tens of inference steps to obtain satisfactory results. Previous attempts to improve its sampling speed and reduce computational costs through distillation have been unsuccessful in achieving a functional one-step model. In this paper, we explore a recent method called Rectified Flow, which, thus far, has only been applied to small datasets. The core of Rectified Flow lies in its \emph{reflow} procedure, which straightens the trajectories of probability flows, refines the coupling between noises and images, and facilitates the distillation process with student models. We propose a novel text-conditioned pipeline to turn Stable Diffusion (SD) into an ultra-fast one-step model, in which we find reflow plays a critical role in improving the assignment between noise and images. Leveraging our new pipeline, we create, to the best of our knowledge, the first one-step diffusion-based text-to-image generator with SD-level image quality, achieving an FID (Frechet Inception Distance) of $23.3$ on MS COCO 2017-5k, surpassing the previous state-of-the-art technique, progressive distillation, by a significant margin ($37.2$ $ ightarrow$ $23.3$ in FID). By utilizing an expanded network with 1.7B parameters, we further improve the FID to $22.4$. We call our one-step models \emph{InstaFlow}. On MS COCO 2014-30k, InstaFlow yields an FID of $13.1$ in just $0.09$ second, the best in $\leq 0.1$ second regime, outperforming the recent StyleGAN-T ($13.9$ in $0.1$ second). Notably, the training of InstaFlow only costs 199 A100 GPU days. Codes and pre-trained models are available at \url{github.com/gnobitab/InstaFlow}.

研究动机与目标

  • 以单步扩散过程推动超快速、高质量的文本到图像生成。
  • 解决由于噪声-图像耦合性差而导致的大型扩散模型蒸馏困难的问题。
  • 利用 Rectified Flow 的 reflow 使概率轨迹变直并提高蒸馏的可行性。
  • 在大型数据集上展示与GANs相当的一步生成性能。
  • 量化相对于先前蒸馏扩散方法的训练成本与推理速度。

提出的方法

  • 采用 Rectified Flow 学习一个文本条件的速度场,在一步中将噪声输运到图像分布。
  • 应用 reflow 过程使ODE轨迹变直,在保持目标分布的同时改善耦合。
  • 在 Stable Diffusion 上进行微调以获得 k-Rectified Flow,然后使用相似性损失(LPIPS)蒸馏为一步模型。
  • 将文本条件速度场结合Classifier-Free Guidance 以平衡质量与多样性(α 参数)。
  • 从 SD 1.4 扩展到 SD 1.5,采用扩展的网络和分阶段的 reflow/蒸馏管线以获得更高保真度。

实验结果

研究问题

  • RQ1在大型数据集上,一步扩散式文本到图像模型是否能达到 Stable Diffusion 的质量?
  • RQ2Rectified Flow 的 reflow 是否能充分改善噪声-图像耦合,从而实现有效的一步蒸馏?
  • RQ3文本条件和引导对一步生成性能的影响是什么?
  • RQ4大型一一步 SD 模型可实现的训练成本与推理速度是多少?

主要发现

  • 一步 InstaFlow 在 MS COCO 2017-5k 上达到 SD 级图像质量,FID 为 23.3,优于渐进蒸馏(37.2→23.3)。
  • 使用扩展的 1.7B 参数网络,在 MS COCO 2017-5k 上获得 FID 22.4,0.09s/图像。
  • 在 MS COCO 2014-30k 上,InstaFlow 在 0.09s 内得到 FID 13.1,优于 StyleGAN-T(0.1s 得到 13.9)。
  • 训练 InstaFlow 的成本为 199 A100 GPU 天,明显低于训练 SD 或基于 GAN 的同行。
  • Reflow 是关键:直接从 SD 蒸馏失败,而 2-Rectified Flow 能实现有效蒸馏和高质量的一步结果。
  • 该管线支持文本条件的 reflow 和蒸馏,在纯监督学习下也能取得有竞争力的结果。

阅读本论文

在 Nubint 阅读器中打开原文,边读边就任意段落提问。

在 Nubint 中阅读本论文

本解读由 AI 根据论文原文生成,引用前请核对原文。