Classifier-Free Guidance (CFG) has emerged as a central approach for enhancing semantic alignment in flow-based diffusion models. In this paper, we explore a unified framework called CFG-Ctrl, which reinterprets CFG as a control applied to the first-order continuous-time generative flow, using the conditional-unconditional discrepancy as an error signal to adjust the velocity field. From this perspective, we summarize vanilla CFG as a proportional controller (P-control) with fixed gain, and typical follow-up variants develop extended control-law designs derived from it. However, existing methods mainly rely on linear control, inherently leading to instability, overshooting, and degraded semantic fidelity especially on large guidance scales. To address this, we introduce Sliding Mode Control CFG (SMC-CFG), which enforces the generative flow toward a rapidly convergent sliding manifold. Specifically, we define an exponential sliding mode surface over the semantic prediction error and introduce a switching control term to establish nonlinear feedback-guided correction. Moreover, we provide a Lyapunov stability analysis to theoretically support finite-time convergence. Experiments across text-to-image generation models including Stable Diffusion 3.5, Flux, and Qwen-Image demonstrate that SMC-CFG outperforms standard CFG in semantic alignment and enhances robustness across a wide range of guidance scales. Project Page: https://hanyang-21.github.io/CFG-Ctrl
Figures & tables
Figure 1: Phase diagram in the e - e˙ plane. We schematically illustrate the convergence patterns of CFG and the proposed SMC-CFG. Left : CFG’s ideal linear convergence trajectory and the strong oscillatory divergence under high guidance scales. Right : the proposed SMC-CFG, through a switching-forcing mechanism, drives the system states toward the sliding mode surface governed by parameter λ , achieving robust and rapid convergence.
Method
Gain Kt
Operator Πt
Error e(t)
Control Interpretation
CFG [ 16 ]
w
I
Δvθ(t)
Proportional control
Weight Scheduler [ 49 ]
w(t)
I
Δvθ(t)
Time-varying gain scheduling
APG [ 39 ]
w[IηI]
[I−PtPt],Pt=∣vθ(c)∣2vθ(c)vθ(c)⊤
Δvθ(t)
Projection-based Feedback Control
CFG-Zero ⋆ [ 9 ]
[wI1−ststI] , st=∣vθ(∅)∣2vθ(c)⊤vθ(∅)
[I−PtPt],Pt=∣vθ(∅)∣2vθ(∅)vθ(∅)⊤
Δvθ(t)
Projection-based Feedback Control
Rectified-CFG++ [ 41 ]
[Iα(t)I],α(t)=λmax(1−t)γ
I
[Δvθ(t)Δvθ(t−2Δt)]
Model Predictive Control
SMC-CFG
w
I
Δvθ(t)−k⋅sign(st)
Sliding Mode Control
Table 1: Typical CFG variants under CFG-Ctrl formulation. We summarize the key components of various methods under the control formulation, along with their corresponding types of control interpretations.
Guidance
FID ↓
CLIP ↑
Aesthetic ↑
ImageReward ↑
PickScore ↑
HPSv2 ↑
HPSv2.1 ↑
MPS ↑
SD3.5 [ 8 ]
41.725
0.3399
5.4256
0.3591
0.2124
0.2710
0.2372
6.5554
w/ CFG [ 16 ]
21.421
0.3681
5.5875
0.8889
0.2190
0.2930
0.2842
7.2476
w/ CFG-Zero ⋆ [ 9 ]
20.317
0.3691
5.6124
0.9312
0.2195
0.2942
0.2862
7.0430
w/ Rect-CFG++ [ 41 ]
20.550
0.3655
5.5663
0.7097
0.2173
0.2887
0.2748
6.7854
w/ SMC-CFG
20.044
0.3694
5.5790
0.9486
0.2211
0.2945
0.2875
7.5719
Flux-dev [ 22 ]
52.598
0.3272
5.4568
0.2572
0.2137
0.2650
0.2280
5.9592
Table 2: Quantitative evaluation of CFG methods. Lower ( ↓ ) FID and higher ( ↑ ) CLIP, Aesthetic, ImageReward, PickScore, HPSv2, HPSv2.1 and MPS scores indicate better performance. Note that Qwen-Image preserves natural image statistics, yielding the lowest FID.
Figure 2: Qualitative results across different T2I models. We provide visual comparisons between CFG and our SMC-CFG across various models. SMC-CFG exhibits better performance in positional relationships, text generation, and detailed object representation.
Figure 3: Qualitative comparison with baseline methods. For challenging scenarios including relative positions, clothing styles, and human actions, baseline methods produce irrational outputs, while SMC-CFG preserves robust text consistency.
λ
k
FID ↓
CLIP ↑
Aesth ↑
ImgRwd ↑
3
0.1
26.193
0.3698
5.7064
1.0174
4
0.1
26.006
0.3701
5.7098
1.0219
5
0.1
25.951
0.3709
5.7128
1.0248
6
0.1
26.143
0.3703
5.7071
1.0228
5
0.1
25.951
0.3709
5.7128
1.0248
5
0.4
26.143
0.3719
5.7218
1.0504
Table 3: Ablation study on hyperparameter λ and k . We conduct ablation across various hyperparameter settings in four metrics: FID, CLIP, Aesthetic (Aesth), and ImageReward (ImgRwd), respectively measuring generation quality, semantic alignment, aesthetic level, and human preference.
Figure 4: Visual comparison between CFG (top) and SMC-CFG (bottom) across different CFG scales.
Notation
Meaning
Value
xt
Latent state at time t during generative flow sampling.
x0∼N(0,I) (initial state)
vθ(xt,t,∅)
Unconditional velocity field, obtained by dropping the condition c .
/
vθ(xt,t,c)
Conditional velocity field, incorporating the input condition c .
/
v^θ(xt,t,c)
Guided velocity field, combined via guidance.
/
w
CFG guidance scale.
w≥1
e(t)
Semantic error signal.
vθ(xt,t,c)−vθ(xt,t,∅)
Table 4: Notation table.
Model
Color ↑
Shape ↑
Texture ↑
Spatial ↑
SD3.5 [ 8 ]
0.6790
0.5915
0.7243
0.1625
w/ SMC-CFG
0.7461
0.6009
0.7406
0.2563
Flux-dev [ 22 ]
0.8172
0.5751
0.7432
0.2708
w/ SMC-CFG
0.8216
0.6199
0.7901
0.2939
Qwen-Image [ 50 ]
0.7747
0.5621
0.6747
0.2968
w/ SMC-CFG
0.8191
0.5934
0.7421
0.4085
Table 5: Quantitative evaluation on T2I-CompBench.
Method
VQAScore (GenAI-Bench)
Base ↑
Advance ↑
Overall ↑
Base (w/o CFG)
0.79
0.64
0.70
w/ CFG
0.83
0.64
0.72
w/ CFG-Zero ⋆
0.88
0.66
0.75
w/ Rect-CFG++
0.87
0.64
0.73
w/ SMC-CFG
0.89
0.68
0.77
Table 6: Compositional alignment evaluation on SD3.5.
Method
Total Score
Quality Score
Semantic Score
Color
Human Action
Subject Consistency
CFG
0.5594
0.6581
0.4607
0.9087
0.5313
0.9450
SMC-CFG
0.5839
0.6747
0.4931
0.9818
0.6000
0.9609
Table 7: Video comparison on Wan2.2-TI2V-5B.
Resolution
Guidance
Memory (GB)
FLOPs (G)
Runtime (s)
512×512
CFG
31.99
1203370.06
23.84
SMC-CFG
31.99
1203370.07
23.97
1024×1024
CFG
33.59
3590870.89
44.78
SMC-CFG
33.59
3590870.93
45.09
Table 8: Computational cost and inference time comparison of standard CFG and SMC-CFG.
Figure 5: Qualitative results under various hyperparameters.
Figure 6: Performance curves of different methods under varying CFG scales.
Figure 7: Addtional visual comparison between CFG (left) and SMC-CFG (right) in SD3.5.
Figure 8: Addtional visual comparison between CFG (left) and SMC-CFG (right) in Flux-dev.
Figure 9: Addtional visual comparison between CFG (left) and SMC-CFG (right) in Qwen-Image.
Figure 10: Additional video comparisons between CFG (above) and SMC-CFG (below) in Wan2.2-TI2V-5B.
Diffusion models generate samples by learning to reverse a fixed corruption process, and classifier-free guidance (CFG) is the standard mechanism for conditioning this process on a desired class or prompt. CFG can be applied at varying guidance strengths, and while higher strengths improve image quality and conditional alignment, too high a guidance strength can degrade image quality and diversity. Furthermore, CFG violates principled diffusion sampling dynamics, and existing explanations for why it works despite the violation disagree on the underlying theory or do not extend to deterministic samplers used in practice. We address both these issues. We first frame CFG sampling as a continuous-time optimal control problem, treating the sampling trajectory as a sequence of controls chosen to maximise the probability of the desired condition. Solving the resulting Hamilton--Jacobi--Bellman equation shows that CFG is recovered under specific path costs when using an unconstrained control set. We argue this lack of constraint is responsible for CFG's failure at high guidance strengths, since it permits the sampling path to move arbitrarily far from the current image estimate. To fix this, we propose curvature-aware CFG (CACFG), which constrains the control set to a hypersphere informed by the Gaussian regularisation used when training variational autoencoders. We show that the control inputs produced by CFG sampling routinely violate this bound, and that across diffusion models, datasets, and guidance schedules, CACFG achieves superior generative quality at mid-to-high guidance strengths with a less severe quality-diversity tradeoff than regular CFG.
Max Collins, Dasith de Silva Edirimuni, Jordan Vice +2
School of Physics, Maths and Computing The University of Western Australia Perth, WA 6009
Classifier-free guidance (CFG) improves conditional generation in Flow Matching, but strong guidance can distort the generated distribution and reduce diversity. We provide a geometric account of this behavior by viewing Flow Matching as a time-varying gradient flow and characterizing how CFG reshapes its underlying potential. This view explains how stronger alignment can be accompanied by mean displacement and trajectory concentration, and motivates controlling guidance through the model-implied terminal posterior mean. We therefore propose Posterior-Mean-Capped CFG (PMC-CFG), a training-free, per-sample method that adaptively retains the strongest feasible guidance without additional network evaluations. Experiments on synthetic and large-scale image-generation benchmarks show that PMC-CFG limits guidance-induced distortion and concentration while improving the alignment--diversity trade-off, with particularly strong benefits when nominal guidance is large.
Jishen Peng, Zheng Ma
School of Mathematical Sciences, Shanghai Jiao Tong University, Shanghai, China · Institute of Natural Sciences, MOE-LSC, Shanghai Jiao Tong University, Shanghai, China · Qing Yuan Research Institute, Shanghai Jiao Tong University, Shanghai, China +1
Classifier-Free Guidance (CFG) is a cornerstone of modern conditional diffusion models, yet its reliance on the fixed or heuristic dynamic guidance weight is predominantly empirical and overlooks the inherent dynamics of the diffusion process. In this paper, we provide a rigorous theoretical analysis of the Classifier-Free Guidance. Specifically, we establish strict upper bounds on the score discrepancy between conditional and unconditional distributions at different timesteps based on the diffusion process. This finding explains the limitations of fixed-weight strategies and establishes a principled foundation for time-dependent guidance. Motivated by this insight, we introduce \textbf{Control Classifier-Free Guidance (C2FG)}, a novel, training-free, and plug-in method that aligns the guidance strength with the diffusion dynamics via an exponential decay control function. Extensive experiments demonstrate that C2FG is effective and broadly applicable across diverse generative tasks, while also exhibiting orthogonality to existing strategies.
Jiayang Gao, Tianyi Zheng, Jiayang Zou +9
Shanghai Jiao Tong University, Shanghai, China · vivo BlueImage Lab, vivo Mobile Communication Co., Ltd., China