CFG-Zero*: Improved Classifier-Free Guidance for Flow Matching Models
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)
67e21d3484513315a9169aae
Weichen Fan
claimed_verified
2025-03-25T08:20:22.659Z
6481764e8af4675862efb22e
/avatars/fc2e076bc861693f598a528a068a696e.svg
weichenfan
user
weepiess2383
67e21d3484513315a9169aaf
Amber Yijia Zheng
claimed_verified
2025-03-25T14:36:26.742Z
6429ac8e8136224fee087253
/avatars/f7e4f0885e8c4a90c75c4e36ae3fba6e.svg
Amber Yijia Zheng
user
amberyzheng
67e21d3484513315a9169ab0
Raymond A. Yeh
claimed_verified
2025-07-16T08:16:31.345Z
62dac2dff014388f90897039
/avatars/33b5b1e18512d624b41d72cf4879e509.svg
Raymond Yeh
user
raymondyeh
67e21d3484513315a9169ab1
Ziwei Liu
CFG-Zero*: Improved Classifier-Free Guidance for Flow Matching Models
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* enhances classifier-free guidance in flow matching models by correcting velocity inaccuracies and zeroing early ODE solver steps, improving fidelity and controllability in text-to-image and text-to-video tasks.
classifier-free guidance diffusion models flow matching models Gaussian mixtures flow estimation velocity ODE solver text-to-image text-to-video Lumina-Next Stable Diffusion 3 Flux Wan-2.1 CFG-Zero*