Skip to main content
QUICK REVIEW

[论文解读] Latent Consistency Models: Synthesizing High-Resolution Images with Few-Step Inference

Simian Luo, Yiqin Tan|ArXiv.org|Oct 6, 2023
Generative Adversarial Networks and Image Synthesis被引用 37
一句话总结

LCMs 将预训练潜在扩散模型蒸馏为潜在一致性模型,以实现快速的少步(甚至1步)高分辨率图像生成,带有无分类器引导的引导,以及一种用于定制的微调方法。

ABSTRACT

Latent Diffusion models (LDMs) have achieved remarkable results in synthesizing high-resolution images. However, the iterative sampling process is computationally intensive and leads to slow generation. Inspired by Consistency Models (song et al.), we propose Latent Consistency Models (LCMs), enabling swift inference with minimal steps on any pre-trained LDMs, including Stable Diffusion (rombach et al). Viewing the guided reverse diffusion process as solving an augmented probability flow ODE (PF-ODE), LCMs are designed to directly predict the solution of such ODE in latent space, mitigating the need for numerous iterations and allowing rapid, high-fidelity sampling. Efficiently distilled from pre-trained classifier-free guided diffusion models, a high-quality 768 x 768 2~4-step LCM takes only 32 A100 GPU hours for training. Furthermore, we introduce Latent Consistency Fine-tuning (LCF), a novel method that is tailored for fine-tuning LCMs on customized image datasets. Evaluation on the LAION-5B-Aesthetics dataset demonstrates that LCMs achieve state-of-the-art text-to-image generation performance with few-step inference. Project Page: https://latent-consistency-models.github.io/

研究动机与目标

  • 以扩散模型实现快速、高分辨率图像合成为动机,而不需要繁重的多步采样。
  • 在预训练自编码器(Stable Diffusion)的潜在空间中利用一致性模型,以实现少步推理。
  • 引入一步引导蒸馭 distillation 高效方法,整合 classifier-free 指引。
  • 提出 Latent Consistency Fine-tuning (LCF) 以在保持快速推理的同时,将 LCM 适配到定制数据集。

提出的方法

  • 将 Latent Consistency Distillation (LCD) 公式化,以在潜在空间中将预训练 SD 蒸馏成潜在一致性模型。
  • 定义一个一致性函数 f_theta,直接在潜在空间(z_t)预测 PF-ODE 的 x0 解,并将其表示为 f_theta(z,c,t)=c_skip(t) z + c_out(t) F_theta(z,c,t)。
  • 通过 CFG 的无分类器引导的求解一个扩展的 PF-ODE,使在潜在空间实现 2–4 步或 1 步采样。
  • 使用跳步技巧(k)通过强制从 t_{n+k} 到 t_n 的一致性来加速收敛,而不是从 t_{n+1} 到 t_n,通常将 k 设为 20。
  • 用一步引导蒸馏目标进行训练,使学生 CM 与 EMA 教师通过在 t_{n+k} 的 f_theta 与从 z_{t_n 推断的 f_theta 的 EMA 之间的相似性损失对齐。
  • 提出 Latent Consistency Fine-tuning (LCF) 以在不重新训练教师扩散模型的情况下将预训练 LCM 适应到定制数据集。

实验结果

研究问题

  • RQ1 latent consistency 模型是否能够在像 Stable Diffusion 这样的预训练潜在扩散模型上实现高质量、少步(2–4、甚至1步)的文本到图像生成?
  • RQ2单阶段引导蒸馏是否能有效融合 classifier-free 指引并在大幅减少采样步数的情况下保持保真性?
  • RQ3跳步蒸馏(t_{n+k} 到 t_n)对快速收敛和高质量输出是否至关重要?
  • RQ4Latent Consistency Fine-tuning 是否能够在保持快速推理的同时,有效将 LCMs 适配到定制数据集?

主要发现

模型(512×512)FID↓CLIP 分数↑1 步2 步4 步8 步1 步2 步4 步8 步
DDIM (Song et al., 2020a)183.2981.0522.3813.836.0314.1325.8929.29
DPM (Lu et al., 2022a)185.7872.8118.5312.246.3515.1026.6429.54
DPM++ (Lu et al., 2022b)185.7872.8118.4312.206.3515.1026.6429.55
Guided-Distill (Meng et al., 2023)108.2133.2515.1213.8912.0822.7127.2528.17
LCM (Ours)35.3613.3111.1011.8424.1427.8328.6928.84
(empty placeholder)
(empty placeholder)
  • LCMs 在少步范畴(2–4 步)上实现了在 LAION-5B-Aesthetics 上的文本到图像生成的 state-of-the-art,且在 512×512 与 768×768 分辨率下超越基线。
  • 使用 LCD 训练大约需要 32 个 A100 GPU 小时用于 2–4 步采样,显著低于此前的两阶段引导蒸馏方法。
  • 通过扩展 PF-ODE 的 CFG 和单阶段蒸馏实现高质量图像,且在更大的 CFG 参数下保持高效采样。
  • 跳步技术(k 约为 20)在多种 ODE 求解器(DDIM、DPM、DPM++)上加速收敛,同时对质量的损失很小。
  • LCF 能在定制数据集(如宝可梦、辛普森家庭)上实现高效微调,在少量步骤中生成风格,而无需重新训练教师模型。
  • 实证结果显示 LCM 在 1–4 步范围内优于 DDIM、DPM、DPM++ 与 Guided-Distill 基线,且 CLIP/FID 指标相当或更好。

更好的研究,从现在开始

从论文设计到论文写作,大幅缩短您的研究时间。

无需绑定信用卡

本解读由 AI 生成,并经人工编辑审核。