Rectified-CFG++ for Flow Based Models

Shreshth Saini, Shashank Gupta, Alan C. Bovik

Abstract

Classifier-Free Guidance (CFG) is a cornerstone of modern text-to-image generation, yet its application to newer Rectified Flow (RF) models often results in "off-manifold drift," leading to visual artifacts and oversaturation. We present Rectified-CFG++, a novel sampling strategy designed specifically for the geometry of flow-based models. By replacing standard linear extrapolation with a geometry-aware predictor-corrector rule, Rectified-CFG++ ensures that the generation process remains within the learned data manifold. Our results across foundation models like Flux and Stable Diffusion 3 demonstrate significant improvements in Fréchet Inception Distance (FID), prompt alignment, and text legibility, while simultaneously increasing sampling efficiency.

Introduction

In text-to-image synthesis, Classifier-Free Guidance (CFG) is the primary mechanism used to ensure that generated images adhere strictly to user prompts. Traditionally, CFG works by extrapolating between a conditional output (text-informed) and an unconditional output (null-informed), effectively "pushing" the model toward the desired semantics.

While highly effective for stochastic diffusion models, standard CFG encounters significant hurdles when applied to deterministic Rectified Flow (RF) models, such as Flux, Stable Diffusion 3, and Lumina. Because CFG relies on linear extrapolation, it frequently forces the generation trajectory into "unnatural" regions of the latent space—areas the model did not encounter during training. This phenomenon, known as "off-manifold drift," manifests as the "deep-fried" aesthetic: extreme oversaturation, warped structural geometry, and a lack of robustness where minor increases in guidance strength lead to catastrophic image degradation.

Methodology: Rectified-CFG++

To address these geometric inconsistencies, we introduce Rectified-CFG++, a "predictor-corrector" sampling framework tailored for the linear transport paths of flow-based models.

The Predictor-Corrector Mechanism

Unlike standard CFG, which takes a single aggressive step based on the difference between conditional and unconditional fields, Rectified-CFG++ bifurcates each inference step:

  1. The Predictor Step: The model first executes a small step following only the conditional velocity field. This step serves to "anchor" the sample near the learned transport path, ensuring the trajectory begins on the manifold.
  2. The Corrector Step: The model then applies a weighted correction that interpolates between the conditional and unconditional fields. Crucially, this correction is evaluated at the intermediate point established by the predictor.

Interpolation vs. Extrapolation

By shifting from an extrapolative rule to a scheduled interpolation, Rectified-CFG++ ensures that the sampling trajectory remains within a "bounded tubular neighborhood" of the data manifold. Mathematically, this approach maintains marginal consistency, preventing the color blow-outs and structural collapses common at high guidance scales. This geometric stability allows the model to stay within its "comfort zone," producing more naturalistic results even under heavy guidance.

Experimental Setup

We evaluated Rectified-CFG++ across several state-of-the-art foundation models, including Flux-dev, Stable Diffusion 3/3.5, and Lumina-Next. Performance was measured using a comprehensive suite of benchmarks:

  • MS-COCO (1K and 10K): To assess general image quality and zero-shot alignment.
  • LAION-Aesthetic: To evaluate visual appeal and artistic quality.
  • Pick-A-Pic: To measure alignment with human aesthetic preferences.
  • T2I-CompBench: To specifically test complex compositional prompts involving spatial relationships, color binding, and shape attributes.

Key Results and Discussion

Quantitative Improvements

Rectified-CFG++ consistently outperformed vanilla CFG across all tested metrics. On the Flux-dev model using the MS-COCO 10K benchmark, the method improved the FID score from 37.86 to 32.22. Furthermore, the stability of the sampling path allows for higher quality at lower step counts; Rectified-CFG++ at 5 steps can outperform standard CFG at 40 steps in terms of FID, representing a significant gain in inference efficiency.

Qualitative Superiority

  • Compositional Accuracy: On T2I-CompBench, the method demonstrated marked improvements in attribute binding. For instance, prompts requiring specific color-object pairings (e.g., "a red cube next to a blue sphere") were rendered with higher fidelity and fewer instances of color bleeding.
  • Text Legibility: One of the most notable qualitative improvements is in typography. Rectified-CFG++ renders text within images—such as street signs or labels—with significantly higher clarity and fewer orthographic errors compared to standard CFG.
  • Human Preference: In blind user studies, participants overwhelmingly preferred images generated with Rectified-CFG++, citing better detail, more natural color palettes, and superior adherence to complex prompts.

Limitations and Future Work

While Rectified-CFG++ mitigates artifacts caused by sampling drift, it cannot correct for inherent biases or failures within the underlying model's training data. If a model possesses a systematic bias in its velocity field, those errors may still propagate. Additionally, in scenarios involving a high number of interacting objects, the model may still struggle with relative scaling or the placement of secondary elements.

Future research will focus on extending this geometry-aware guidance to more complex domains, such as video generation and 3D diffusion, where maintaining temporal and structural consistency is both more challenging and more critical.

Summary updated

BibTeX
@inproceedings{saini2025rectified,
  author = {Shreshth Saini and Shashank Gupta and Alan C. Bovik},
  title = {{Rectified-CFG++ for Flow Based Models}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2025},
  url = {https://openreview.net/forum?id=NosdT1FHPv},
}
Figure