# TCG: Taming CFG for Flow Matching Models via Moment Matching and Adaptive Clipping

Anonymous authors

## Abstract

Classifier-free guidance (CFG) is a fundamental technique for flow-based models, significantly enhancing visual quality and prompt adherence. However, the guidance scale is typically tuned empirically due to instability at higher values, which often induces visual artifacts and mode collapse. This paper investigates the underlying mechanisms driving this instability and proposes an effective solution. Our analysis reveals that high CFG scales induce a detrimental distribution shift in the velocity prediction, damaging the generation fidelity. To address this, we introduce TCG, a novel plug-and-play method comprising two key components: (1) Moment Matching (MM), which stabilizes the velocity distribution by aligning its first two moments (mean and variance), thereby preventing mode collapse; and (2) Adaptive Clipping (AdapC), which dynamically constrains the guidance update term from both temporal and spatial perspectives to ensure smooth and stable sampling. As a result, our method enables robust and high-quality generation across a wide range of guidance scales. Extensive experiments on diverse text-to-image and text-to-video benchmarks validate that our method outperforms both standard CFG and its state-of-the-art variants.

## Comparisons of Text-to-Image Generation

FLUX
Lumina-Next
Stable Diffusion 3

## Comparisons of Text-to-Video Generation

### Wan2.2 5B Visualization

A couple in formal evening wear going home get caught in a heavy downpour with umbrellas, animated style

CFG: 4

CFG: 9

TCG: 9

A person is doing laundry

CFG: 4

CFG: 9

TCG: 9

A person is driving car

CFG: 4

CFG: 9

TCG: 9

A person is playing harp

CFG: 4

CFG: 9

TCG: 9

A person is push up

CFG: 4

CFG: 9

TCG: 9

A person is sharpening knives

CFG: 4

CFG: 9

TCG: 9

A person is washing hands

CFG: 4

CFG: 9

TCG: 9

A steam train moving on a mountainside

CFG: 4

CFG: 9

TCG: 9

Motion colour drop in water, ink swirling in water, colourful ink in water, abstraction fancy dream cloud of ink.

CFG: 4

CFG: 9

TCG: 9

a dog running happily

CFG: 4

CFG: 9

TCG: 9

a sheep taking a peaceful walk

CFG: 4

CFG: 9

TCG: 9

### Wan2.2 A14B Visualization

An astronaut flying in space, in super slow motion

CFG: 4

CFG: 9

TCG: 9

A person is shooting goal (soccer)

CFG: 4

CFG: 9

TCG: 9

a cat and a dog

CFG: 4

CFG: 9

TCG: 9

a donut and a suitcase

CFG: 4

CFG: 9

TCG: 9

a giraffe running to join a herd of its kind

CFG: 4

CFG: 9

TCG: 9

a horse

CFG: 4

CFG: 9

TCG: 9

a shark is swimming in the ocean, surrealism style

CFG: 4

CFG: 9

TCG: 9

a white cat

CFG: 4

CFG: 9

TCG: 9

a wine glass and a chair

CFG: 4

CFG: 9

TCG: 9

desert

CFG: 4

CFG: 9

TCG: 9