Models & Parameters

Flow Matching and Rectified Flow, Explained

Also called rectified flow, flow matching model, velocity prediction, rf

Flow matching is a training objective that teaches a model a velocity field carrying noise to data along nearly straight paths. Rectified flow is the straight-line version that current image and video families are built on. Because the path is straight, sampling needs far fewer steps than a classic diffusion schedule to reach the same quality.

The problem it solves

A classic denoising diffusion model is trained by adding Gaussian noise to an image according to a variance schedule, then learning to undo one increment of that at a time. Sampling walks that chain backwards. The trajectory is stochastic and curved, so each step has to be small, and quality only arrives after dozens to hundreds of network evaluations. The design also drags along a pile of choices that all interact: the beta schedule, whether the network predicts noise or velocity or the clean image, and which sampler you pair with which schedule.

Flow matching reframes the same goal. Pick a path between the noise distribution and the data distribution, then train the network to output the velocity that moves a sample along it. At inference you are no longer reversing a noising process, you are solving an ordinary differential equation from noise to image.

The simplest possible path is a straight line: mix noise and the real sample linearly, and make the training target the difference between them. That instantiation is rectified flow, and its virtue is entirely geometric. A straight trajectory can be traversed in large steps without leaving the path, so a solver that would overshoot on a curved route stays accurate on this one.

What changed in the models you use

Every recent frontier image and video family sits on this objective: SD3, Flux, the Wan video line, Hunyuan Video, Qwen-Image, LTX, and most of what shipped from 2024 onward. The user-visible consequences are specific.

Step counts collapsed. Twenty to thirty steps instead of fifty to a hundred. On video, where a single generation may involve tens of thousands of tokens per frame group, that difference is the gap between a viable product and an unaffordable one.

Distillation got easier. Straight paths are much simpler to compress into a handful of steps, which is why nearly every model family now ships a four-step or single-step sibling. The fast tier on a hosted catalog is usually a distilled version of the same flow matching base.

High resolution got more stable. These formulations shift the schedule based on how many tokens are being generated, because a large canvas needs more of its trajectory spent at high noise. That shift is why the same model can hold composition at 2K where the previous generation fell apart.

Guidance semantics changed. This is the one that trips people up. Several of these models expose a number labelled guidance that is not classifier-free guidance at all; it was baked in during distillation and is now a conditioning value. Habits from older models transfer badly, and the symptom is crushed contrast and banded colour.

Working with a flow matching model

A short practical checklist, from most to least useful:

  1. Start from the model's own recommended step count and guidance value. These are tuned per schedule and are not portable between families.
  2. If output looks washed out or flat at high resolution, that points at the schedule, not the prompt. Try the model's native resolution before rewriting anything.
  3. Treat the fast variant as a draft device. Explore composition on the distilled sibling, then run the final take on the full model with the same seed and prompt.
  4. Do not raise steps to fix detail. The detail ceiling is set by the latent encoder, and extra steps cannot add information the compression already discarded.
  5. When comparing two models, hold steps and guidance at each model's own defaults rather than matching numbers across them. Matched numbers on different schedules is not a fair test, and it is the single most common way model comparisons end up wrong.

The prompt for this

A starting point that reliably produces the effect. Adjust the subject and setting; keep the technical clauses.

Overhead shot of a marble kitchen counter, morning light through a window, a single ripe peach and a paring knife, soft shadows

Try Flow Matching yourself

Open the generator with a starting point already filled in.

Frequently asked questions

What is the difference between flow matching and diffusion?
Classic diffusion learns to reverse a noise schedule one small stochastic step at a time, and that reverse path is curved, so it needs many steps. Flow matching trains the model to predict a velocity along a straight interpolation between noise and data, so a solver can take big steps without overshooting. Same family of generative models, different route between the two ends.
Is rectified flow the same thing as flow matching?
Rectified flow is the specific case where the path between noise and data is a straight line and the target is simply data minus noise. Flow matching is the general framework that allows other paths. In practice, when a current model says flow matching, it almost always means the rectified, straight-line form.
How many sampling steps should I use?
Typically 20 to 30 for a full model, and returns flatten early. Going from 30 to 60 usually buys nothing and can slightly soften fine detail. If a model ships with a recommended default, that default was tuned against its own schedule and is a better starting point than a number carried over from an older family.
Why does a high guidance value wreck the image on these models?
Some of them are guidance distilled, meaning the guidance number is a conditioning input rather than a classifier-free guidance multiplier. Values around 2.5 to 4 are normal there, and setting 7.5 out of habit produces burnt contrast and posterised colour. Check what the parameter means on that specific model before pushing it.
Does this improve quality or only speed?
Both, indirectly. The direct win is fewer steps for equal quality, which is why fast tiers exist at all. The indirect win is training stability at high resolution, which showed up as fewer melted limbs and cleaner large canvases. It does not change prompt understanding or the fine-detail ceiling, which come from the backbone and the encoder.

Related terms