2025-03-25 · 进阶 · 机器学习 · 计算机视觉

CFG-Zero*: Improved Classifier-Free Guidance for Flow Matching Models

这篇论文提出了一种改进的无分类器引导方法CFG-Zero⋆,用于流匹配模型,通过优化比例尺和零初始化技术提高了图像和视频生成的质量和可控性。

更新于 2025-03-25。作者:Weichen Fan、Amber Yijia Zheng、Raymond A. Yeh、Ziwei Liu。

中文摘要

无分类器引导(CFG)是扩散/流模型中广泛采用的一种技术,用于提高图像保真度和可控性。在这项工作中,我们首先分析了CFG对训练在高斯混合模型上的流匹配模型的影响,其中真实流可以推导出来。我们观察到,在训练的早期阶段,当流估计不准确时,CFG会将样本引导到错误的轨迹上。基于这一观察,我们提出了CFG-Zero*,这是一种改进的CFG,具有两项贡献:(a)优化尺度,通过优化一个标量来校正估计速度的不准确性,因此命名为*;(b)零初始化,涉及将常微分方程求解器的第一步几步设置为0。在文本到图像(Lumina-Next、Stable Diffusion 3和Flux)和文本到视频(Wan-2.1)生成上的实验表明,CFG-Zero*在性能上始终优于CFG,突显了其在指导流匹配模型上的有效性。(代码可在github.com/WeichenFan/CFG-Zero-star获取)

英文摘要

Classifier-Free Guidance (CFG) is a widely adopted technique in diffusion/flow models to improve image fidelity and controllability. In this work, we first analytically study the effect of CFG on flow matching models trained on Gaussian mixtures where the ground-truth flow can be derived. We observe that in the early stages of training, when the flow estimation is inaccurate, CFG directs samples toward incorrect trajectories. Building on this observation, we propose CFG-Zero*, an improved CFG with two contributions: (a) optimized scale, where a scalar is optimized to correct for the inaccuracies in the estimated velocity, hence the * in the name; and (b) zero-init, which involves zeroing out the first few steps of the ODE solver. Experiments on both text-to-image (Lumina-Next, Stable Diffusion 3, and Flux) and text-to-video (Wan-2.1) generation demonstrate that CFG-Zero* consistently outperforms CFG, highlighting its effectiveness in guiding Flow Matching models. (Code is available at github.com/WeichenFan/CFG-Zero-star)

解读

一句话总结

这篇论文提出了一种改进的无分类器引导方法CFG-Zero⋆,用于流匹配模型,通过优化比例尺和零初始化技术提高了图像和视频生成的质量和可控性。

问题1:这篇论文想要解决什么具体问题?

问题2:论文的核心创新点是什么?

问题3:实验结果如何验证了方法的有效性?

问题4:这个研究的实际应用价值是什么?

来源