title: CFG-Zero*: Improved Classifier-Free Guidance for Flow Matching Models
summary: 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)
paper_authors._id: 67e21d3484513315a9169aae
paper_authors.name: Weichen Fan
paper_authors.status: claimed_verified
paper_authors.statusLastChangedAt: 2025-03-25T08:20:22.659Z
paper_authors._id: 6481764e8af4675862efb22e
paper_authors.avatarUrl: /avatars/fc2e076bc861693f598a528a068a696e.svg
paper_authors.fullname: weichenfan
paper_authors.type: user
paper_authors.user: weepiess2383
paper_authors._id: 67e21d3484513315a9169aaf
paper_authors.name: Amber Yijia Zheng
paper_authors.status: claimed_verified
paper_authors.statusLastChangedAt: 2025-03-25T14:36:26.742Z
paper_authors._id: 6429ac8e8136224fee087253
paper_authors.avatarUrl: /avatars/f7e4f0885e8c4a90c75c4e36ae3fba6e.svg
paper_authors.fullname: Amber Yijia Zheng
paper_authors.type: user
paper_authors.user: amberyzheng
paper_authors._id: 67e21d3484513315a9169ab0
paper_authors.name: Raymond A. Yeh
paper_authors._id: 67e21d3484513315a9169ab1
paper_authors.name: Ziwei Liu
paper_title: CFG-Zero*: Improved Classifier-Free Guidance for Flow Matching Models
paper_summary: 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)
paper_ai_summary: 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.
paper_ai_keywords: 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*