Flow matching trains a network to output the straight-line velocity from a noise sample to a data sample; because many such lines pass through every point, what it actually learns is their average, the marginal velocity field, whose paths bend, and every few-step method is a way to make that field easier to follow.
Fig. 1 is the page's 2-D toy in space-time: each upright glass plate is the same plane at one time, t = 0 (noise) on the left to t = 1 (data) on the right. Every point and path is computed in your browser by the page's own engine (the exact field and the trained networks' int8 weights).
Running example. The root topic's 2-D toy (noise in the plane; data a ring of 8 Gaussian blobs, radius 3, spread 0.25; small 3 → 48 → 48 → 48 → 2 networks, 4,994 parameters) and its Fashion-MNIST model (a 1,040,353-parameter U-Net trained 4,000 steps in 893.3 s on an Apple M1 Pro). Image scores are the root's: FD, the Fréchet distance between 1,000 samples and the test set in a Fashion-MNIST classifier's feature space (lower is better; 1,000 real images score 18.9); class accuracy; and diversity, the mean feature distance between same-class samples (real 28.9). On the toy, "on a blob" means within 0.75 (3 spreads) of a centre.
| Knob | What it changes | Measured here | Published |
|---|---|---|---|
| Solver and step grid (5) | error per network evaluation | Euler, Heun, midpoint at equal NFE, images and toy | Movie Gen's linear-quadratic grid |
| Path (at, bt) (6) | shape of the lines, and where a uniform grid lands | exact field on 3 paths, toy | SiT Table 4: straight 34.8 against VP 39.8 FID |
| Coupling (7) | how much lines cross, hence curvature | minibatch OT by batch size, toy and images | Tong et al. 2023; Pooladian et al. 2023 |
| Reflow rounds (8) | re-pairs noise with the model's own outputs | 1 to 4 rounds toy; 1 to 3 rounds images | Liu et al. Table 1 (CIFAR-10) |
| Distillation (9) | one network call replaces the ODE | 3 students toy; 2 students images | InstaFlow, LADD, MeanFlow |
| Training t distribution (11) | where the network's accuracy goes | 6 schemes, 3 seeds, 2 budgets, toy | SD3 Tables 1 and 2 |
| ODE or SDE sampling (12) | adds noise with the same marginals | 5 noise levels, exact field and images | SiT Table 5 |
Labels: measured run on an Apple M1 Pro (CPU for the toy, MPS for the image model), 2026-10-17; published read from the source named; derived computed from other numbers with the formula shown. Convention throughout (Lipman et al.'s): t = 0 is noise, t = 1 is data, velocity v = x1 − x0. SD3, diffusers and the Math page count the other way (noise level σ = 1 − t); section 14 shows what mixing them does.
The problem. Noise is easy to sample; data is not. Flow matching looks for a velocity field v(x, t) that, followed for one unit of time, carries the whole cloud of noise onto the cloud of data. Sampling is then solving an ordinary differential equation (ODE): start at x(0) drawn from a standard Gaussian and move with dx/dt = vθ(x, t) until t = 1. Nothing is random after the start, so the same noise always gives the same output. Such a model is a continuous normalising flow; what 2022 added is a cheap way to train one.
One training example, in numbers (illustrative). Draw a noise x0 = (0.5, −1.2), a data point x1 = (3, 0) (a blob centre of the toy) and t = 0.3. The point on their straight line is xt = 0.7 x0 + 0.3 x1 = (1.25, −0.84), and the line's velocity, the same at every t, is x1 − x0 = (2.5, 1.2). A network that answers (2.0, 1.0) at that input pays (0.5² + 0.2²) = 0.29. That is the whole training step (step 2 of Fig. 1):
Liu, Gong and Liu (arXiv 2209.03003) call it rectified flow; Lipman et al. (arXiv 2210.02747) the conditional optimal-transport path; both 2022 published. It is simulation-free: older continuous flows solved the ODE and backpropagated through it at every training step, while here xt is built in closed form, so a step costs one network call and one squared error, exactly like a DDPM step. Training the topic’s flow model took 893.3 s (4.48 steps/s) against the DDPM’s 906.7 s measured: the objective costs nothing extra. The image model on this page trained with these lines (the topic's shared src/data/objectives.py, lines 90 to 97; the 10% label dropout is for guidance, section 10):
def cfm_loss(model, x1, y, p_uncond=0.1):
"""Conditional flow matching with straight paths (rectified flow / OT-CFM with sigma_min = 0)."""
x0 = torch.randn_like(x1)
t = torch.rand(x1.shape[0], device=x1.device)
tt = t.view(-1, 1, 1, 1)
pred = model((1 - tt) * x0 + tt * x1, t, drop_labels(y, p_uncond))
loss = F.mse_loss(pred, x1 - x0)
return loss, {"loss": loss.item()}
Meta's facebookresearch/flow_matching (commit 11568d3): CondOTScheduler sets αt = t, σt = 1 − t (flow_matching/path/scheduler/scheduler.py lines 108 to 113), and the affine path builds x_t = sigma_t * x_0 + alpha_t * x_1 and dx_t = d_sigma_t * x_0 + d_alpha_t * x_1 (flow_matching/path/affine.py lines 89 to 90), which is x1 − x0. torchcfm (commit 7c65385): t * x1 + (1 - t) * x0 and x1 - x0 (torchcfm/conditional_flow_matching.py lines 83 and 154).
The root's recorded strips of the trained model (class-conditional, no guidance) measured.
The problem. The same point x at the same t lies on many lines, from different noises to different images (step 3 of Fig. 1). The network sees x and t only, so it cannot know which line it is on. A network trained with a squared error predicts the average of its targets given its inputs, so it learns the marginal vector field (averaged over all pairs, as opposed to the conditional field of one pair):
For the toy this average has a closed form (given which blob an example came from, xt is Gaussian), so the page can draw the exact u beside the trained network. Your browser runs a line-by-line port of the script that computed every exact number here. Fig. 2 draws it on five time slices:
Average the lines yourself. The widget beside this puts one point on the plane at a time t of your choice and draws the lines through it from 80 sampled data points, each as strong as its weight, with their average and the exact field.
Any Gaussian path xt = at x1 + bt x0 on a mixture of Gaussians: posterior weights over blobs, then E[x1 | x] and E[x0 | x] in closed form, u = a′ E[x1 | x] + b′ E[x0 | x].
def coef(kind, t):
"""a_t, b_t and their t-derivatives. t = 0 noise, t = 1 data."""
t = torch.as_tensor(t, dtype=torch.float64)
if kind == "linear":
return t, 1 - t, torch.ones_like(t), -torch.ones_like(t)
if kind == "cos":
h = math.pi / 2
return torch.sin(h * t), torch.cos(h * t), h * torch.cos(h * t), -h * torch.sin(h * t)
if kind == "vp": # Song et al.'s VP SDE (beta_min 0.1, beta_max 20), the continuous DDPM schedule, run from s = 1 - t
s = 1 - t
ab = torch.exp(-(0.1 * s + 19.9 * s * s / 2)); beta = 0.1 + 19.9 * s
a, b = ab.sqrt(), (1 - ab).sqrt()
return a, b, beta * a / 2, -beta * ab / (2 * b)
raise ValueError(kind)
def exact(x, t, kind="linear"):
"""Exact marginal velocity u, score, E[x1|x], E[x0|x] at (x, t) for the ring mixture. x: (N, 2) float64."""
a, b, da, db = coef(kind, t)
S = a * a * SD * SD + b * b
d = x[:, None, :] - a * CEN[None] # N, K, 2
w = torch.softmax(-(d * d).sum(-1) / (2 * S), 1)[..., None]
E1 = (w * (CEN[None] + a * SD * SD / S * d)).sum(1)
E0 = (w * (b / S * d)).sum(1)
return da * E1 + db * E0, (w * (-d / S)).sum(1), E1, E0
Why training on single lines works. We never compute u while training. Lipman et al.'s Theorem 2: the per-pair loss and the loss against u differ by a constant independent of the network, so they have the same gradient (published; derived on the Math page, derivation D8). The constant is the spread of the lines around their average, and with the exact field it can be measured (the charts further down).
Predict, then drag: at t near 0, where will the thick arrow point? Click or drag to move the point. At t near 0 all 80 sampled data points are about equally likely ends, so the average (thick arrow) points at the ring's centre, where there is no data; slide t towards 1 and the weights collapse onto one blob. The 80-sample average, the exact field (dashed red) and the trained root toy model (green, optional) agree. Each arrow is drawn (1 − t) times the velocity, so it ends at the model's current guess of the final point, E[x1 | x].
What the network gets wrong. The lower chart is the honest measure of learning: within 0.006 of the exact field at t = 0.1 but 0.40 at t = 1, where the field is steep (each blob pulls hard towards its centre). That is where a sampler's last steps land, and why a solver that evaluates the network exactly at t = 1 is fragile (section 5). How to check on any Gaussian-mixture toy: compute u as above and plot |vθ − u|² by t.
2-D toy, per point, summed over 2 coordinates, 20,000 fresh pairs per t. Total: mean |x1 − x0|². Floor: |x1 − x0 − u|², what no network can remove. Lower chart: the root's trained toy model's distance from the exact field, |vθ − u|² (log). measured on CPU.
The problem. On the toy one Euler step puts no points on a blob; on images it gives the blur of section 1. Training failure, or would a perfect model do it too? Sample the exact field with the same solver and steps: what it gets wrong is the path's fault (discretisation error); the network's extra error is learning error. Fig. 3 runs both on 24 noises (the shares below are of 2,000):
What it shows. The exact field misses about as much as the trained network at every step count (the chart beside this). The exact paths are as bent as the learned ones: straightness 0.864 against 0.865. Curvature belongs to the problem, not to the network. On two moons the learned flow paths even come out less straight than DDIM's (0.55 against 0.73 over 40 paths), measured in Diffusion from zero, section 5's closed two-moons block.
How to check on real data: compare N-step samples with a many-step solve from the same noise; good many-step and blurry few-step samples mean the path, not the fit, is the problem.
Share of 2,000 toy samples on a blob, by Euler steps, the same 2,000 starting noises for every curve; real data score about 98 to 99%. measured on CPU with the int8 weights the page embeds.
The problem. A perfectly trained network outputs the exact marginal field. For real training data the distribution the loss sees is the training set itself: 55,000 Fashion-MNIST images, each a single point. Its exact field has a closed form too (xt given image j is Gaussian around t · imagej with spread 1 − t, the weights are a softmax over images, u = (E[x1 | x] − x)/(1 − t)). Where does that field take noise? Fig. 4 asks it first on the toy, with an illustrative training set of 16 points drawn from the ring:
The same on images. The card beside this runs the training set's exact field on the root's noises and compares it with the root's trained network.
What it shows. At 50 steps 100% of the exact-field samples are training images to within 0.0008 RMS (rounding level); at 4 steps already 99%. The trained network's samples sit a median 0.269 from their nearest training image, about as far as held-out test images do (0.251), and only 15% share the exact sample's nearest image. The network did not reach the optimum of its own loss, and that failure is what lets it generate new garments.
The same for diffusion: denoising score matching "has a closed-form optimal solution that can only generate training data replicating samples", and memorisation "tend[s] to occur on smaller-sized datasets" (Gu et al., arXiv 2310.02664, Oct 2023). Kamb and Ganguli (arXiv 2412.20292, Dec 2024) explain the novelty: convolutional networks are local and translation-equivariant, so they cannot implement the global optimum and instead stitch "local training set patches"; their patch-mosaic model predicts trained models' outputs with median r² 0.94 on Fashion-MNIST published.
When it matters. Memorisation and privacy (a model that fits a small fine-tuning set too well reproduces it), and evaluation: FID cannot see copying (metrics are on Evaluating generative models). How to check: nearest-training-neighbour distances of samples against those of held-out real images, as above.
src/runs/fm_memo.py: the exact field, class-conditional (the 5,500 training images of the class), sampled from the root's noises beside the root's trained model; nearest training image by root-mean-square (RMS) pixel difference, pixels in [−1, 1]; 28 s on CPU measured.
The problem. Turning the velocity into a sample means integrating dx/dt = vθ(x, t) from 0 to 1 in finite steps, and every step costs network evaluations (NFE, each a full forward pass: the real cost). Which solver gives the best sample per evaluation?
How it works. Euler: move along the current velocity for a step h; one evaluation; error shrinks in proportion to h (first order). Heun: take the Euler step as a guess, evaluate the velocity there too, step with the average of the two slopes. Midpoint: evaluate at the half step and use that slope. Both cost two evaluations a step and their error shrinks with h² (second order).
On samples. FD at 4 evaluations: midpoint 47.3, Euler 158.3, plain Heun 1,333.2; one midpoint step (2 evaluations) 146.1 against 489.3 for two Euler steps measured. The culprit is t = 1. Heun's last corrector evaluates the network on a clean image, whose source noise is independent of it, so the best squared-error answer is v = x1 − E[x0] = the input itself, not any path's slope: the network's output at t = 1 has cosine 0.968 with its input and 0.635 with the true x1 − x0 (0.935 at t = 0.9) measured on 1,000 validation images. Making the last step plain Euler, as diffusers' HeunDiscreteScheduler does (v0.41.0, scheduling_heun_discrete.py lines 364 and 367; n steps cost 2n − 1 evaluations), recovers it: 76.7 at 5 evaluations, 48.1 at 9.
The grid is half the solver. Where the steps go matters as much as how each is taken (section 6 shows DDIM is Euler on a warped grid). Production samplers keep Euler and move the grid: the resolution shift (section 11), and Movie Gen's linear-quadratic grid, which "follows the first 25 steps of an N-step linear schedule and then approximates the remaining N − 25 steps with 25 quadratically placed steps", 50 steps "emulating 250 linear steps" (arXiv 2410.13720, section 3.4.2) published. Multistep solvers reuse past evaluations, so they get second order at one evaluation per step: Wan 2.1's diffusers repository ships UniPCMultistepScheduler with prediction_type: flow_prediction, flow_shift: 3.0, order 2 (config at revision 0fad780a534b, read 2026-10-17), a diffusion solver reused on a flow model, as Sana does with DPM-Solver.
def vel(net, x, t, y, s=1.0):
"""One velocity evaluation (one batch of 2N when guidance mixes conditional and unconditional)."""
tt = torch.full((x.shape[0],), float(t), device=x.device)
if s == 1:
return net(x, tt, y)
if s == 0:
return net(x, tt, None)
out = net(torch.cat([x, x]), torch.cat([tt, tt]), torch.cat([y, torch.full_like(y, 10)]))
c, u = out.chunk(2)
return u + s * (c - u)
def grid(n, shift=1.0):
"""n + 1 times from 0 to 1. shift > 1 spends more steps near the noise end (SD3's shift, on sigma = 1 - t)."""
sig = torch.linspace(1, 0, n + 1, dtype=torch.float64)
sig = shift * sig / (1 + (shift - 1) * sig)
return [float(1 - v) for v in sig]
@torch.no_grad()
def euler(net, x, y, n, s=1.0, shift=1.0, trace=None):
ts = grid(n, shift)
for t, t2 in zip(ts[:-1], ts[1:]):
v = vel(net, x, t, y, s)
if trace is not None:
trace.append((t, x.clone(), (x + (1 - t) * v).clone())) # where we are, and the straight-line guess of the end
x = x + (t2 - t) * v
return x
@torch.no_grad()
def heun(net, x, y, n, s=1.0):
"""Second order: an Euler predictor, then step with the average of the slopes at both ends (2 evaluations a step)."""
ts = grid(n)
for t, t2 in zip(ts[:-1], ts[1:]):
h = t2 - t
v1 = vel(net, x, t, y, s)
v2 = vel(net, x + h * v1, t2, y, s)
x = x + h * 0.5 * (v1 + v2)
return x
@torch.no_grad()
def midpoint(net, x, y, n, s=1.0):
"""Second order: take the slope at the half step (2 evaluations a step)."""
ts = grid(n)
for t, t2 in zip(ts[:-1], ts[1:]):
h = t2 - t
v1 = vel(net, x, t, y, s)
x = x + h * vel(net, x + 0.5 * h * v1, t + 0.5 * h, y, s)
return x
Meta's library defaults to Euler and lists dopri5, midpoint and heun3 from torchdiffeq (flow_matching/solver/ode_solver.py lines 34 and 70). On the toy, whose blobs have width and so no sharp end, the ranking is the textbook one: at 4 evaluations Euler lands 82% on a blob, Heun 89%, midpoint 88%; at 2 evaluations one second-order step loses to two Euler steps (6% and 9% against 34%) measured.
Qwen-Image's and LTX-Video's shift_terminal stretches the shifted grid so that its last noise level before the final step to clean data is 0.02 or 0.1 (diffusers v0.41.0, stretch_shift_to_terminal, line 279). How many steps: the exact toy field puts 90% on a blob at 4 Euler steps (99% converged); the image model needs 10 to 20 Euler steps, midpoint 4 evaluations; released: FLUX.1 [schnell] "1 to 4 steps" (card), FLUX 3 Image Klein 50 steps for the base and 16 for the distilled variant (vendor statement, the root's Model map), Movie Gen 50.
The trained image model: RMS pixel difference from a fine answer (midpoint, 500 steps, which never evaluates t = 1), 200 images, both axes logarithmic, so the slopes are the solvers' orders measured by the root on Apple M1 Pro (MPS). At 10 evaluations: Euler 0.078, plain Heun 0.126, midpoint 0.026, Heun with a last Euler step 0.062 (9 evaluations). Even midpoint's error stops falling past 50 evaluations (0.0049 at 50, 0.0065 at 100): finer steps evaluate closer to t = 1, where the learned field is rough.
The problem. "Flow matching" usually means the straight path at = t, bt = 1 − t, but the loss works for any Gaussian path xt = at x1 + bt x0 (Lipman et al. 2023; Albergo and Vanden-Eijnden's stochastic interpolants). Diffusion's paths are variance preserving (VP: a² + b² = 1). Which path is best, and how different are flow and diffusion really?
One family. Both train on a scaled data point plus scaled noise, so any such model can be read as predicting the noise, the clean data or the velocity: given xt, each determines the others. On the straight path, x̂1 = xt + (1 − t) vθ and x̂0 = xt − t vθ derived. Every diffusion model also has a deterministic ODE with the same marginals, the probability-flow ODE (Song et al. 2021), which DDIM solves (Diffusion from zero, sections 4 and 5). So "flow against diffusion" is three separable choices: the path, what the network outputs (which sets how the loss weighs each noise level), and how t is drawn in training (section 11).
Three paths, all exact. Because the toy's field is exact for any path, this comparison has no learning error: straight; cosine VP (a = sin(πt/2), b = cos(πt/2), SiT's GVP); and the continuous DDPM schedule (Song et al.'s VP SDE, β from 0.1 to 20).
Published, at ImageNet scale. SiT (Ma et al., arXiv 2401.08740, Jan 2024) kept DiT's architecture and changed one ingredient at a time (SiT-B, ImageNet 256, 400K steps, FID): DDPM-style noise prediction 44.2; continuous-time score 43.6; velocity on the VP path 39.8; on the straight path 34.8; on the cosine (GVP) path 34.6 (Tables 2 to 4) published. They credit shorter, less curved paths and note the VP path's σ̇ "becomes singular" near the data. The ranking matches the toy: cosine and straight close, the DDPM schedule well behind. When it matters: porting a sampler between models (its grid assumes a path) and reading ablations (a "flow against diffusion" result usually changes path, target and t sampling at once).
Any Gaussian path is the straight path with space rescaled by 1/(a + b) and time warped to λ = a/(a + b). Dots: λ at t = 0, 0.25, 0.5, 0.75, 1 for each path, computed from the formulas above derived: straight 0, 0.25, 0.5, 0.75, 1; cosine 0, 0.29, 0.5, 0.71, 1; DDPM-style 0.01, 0.06, 0.23, 0.51, 1, so its last step jumps half the way.
| Path (exact field) | straightness | on a blob, Euler 2 | Euler 4 | Euler 8 | DDIM 4 |
|---|---|---|---|---|---|
| straight (rectified flow) | 0.864 | 36% | 90% | 96% | = Euler |
| cosine VP (SiT's GVP) | 0.916 | 49% | 91% | 98% | 89% |
| DDPM-style VP (beta 0.1 to 20) | 0.916 | 20% | 52% | 90% | 62% |
2,000 noises measured. DDIM here is "predict both ends, re-noise them at the next time", which works on any path.
The problem. A coupling is the rule that pairs noises with images in training. Plain flow matching draws both at random; random pairs cross everywhere, and crossing lines are what the average bends around. Can a better pairing straighten the flow without a second training?
How it works. Minibatch optimal transport (OT; Tong et al., arXiv 2302.00482; Pooladian et al., "Multisample Flow Matching", arXiv 2304.14772; both 2023): inside each batch of B noises and B images, re-pair them to minimise the total squared distance (the Hungarian algorithm), then train as usual. The marginals are unchanged; only which line each point is on changes. Fig. 5 does it for one batch of 64 on the toy:
What it shows. In 2-D a batch of 256 removes 68% of the travel; on images even 4,096 removes only 5.1%. In 1,024 dimensions a random noise is almost equally far from every image (distances concentrate), so a few thousand candidates give the assignment little to choose from. Toy models trained with OT pairs:
| Toy model, OT pairs in batches of B | B = 1 (random) | 4 | 16 | 64 | 256 |
|---|---|---|---|---|---|
| straightness of its paths | 0.865 | 0.982 | 0.991 | 0.997 | 0.998 |
| on a blob after 1 Euler step | 0% | 3.0% | 41% | 76% | 83% |
| on a blob after a fine solve (256 Heun steps) | 97% | 98% | 98% | 97% | 96% |
The root's recipe (12,000 Adam steps, batch 512); B = 1 and 256 are the root's random-pair and OT models, B = 4, 16, 64 trained here measured on CPU.
The cost. One assignment problem per batch, O(B³) on the CPU: the root's B = 256 toy trained in 173 s against 12 s for random pairs. A slight loss of many-step quality appears as B grows (97% to 96% after a fine solve; observed on this toy, not explained further). When it matters: low-dimensional or strongly clustered data. How to check: measure the coupling's distance against random pairing before spending a training run.
Mean squared distance between paired noise and data, relative to random pairing (= 1), by batch size B, 4,096 pairs each. 2-D toy: random 10.95, one batch of 4,096 3.39. Fashion-MNIST (1,024 pixels, per pixel): 1.754 against 1.664. measured on CPU (fm_toy.py, fm_ot_images.py).
The problem. Sections 3 and 7: the field of random pairs bends, and better pairing helps little on images. Reflow (Liu, Gong and Liu 2022) changes the pairing after training: push many noises z through the trained flow to get X1 = flow(z), then train again, same loss, on the fixed pairs (z, X1). Paths of an ODE "cannot cross each other" (their words), so the new pairs do not cross, and the field that averages them is close to each pair's straight line. Names: the first model is the 1-rectified flow (1-RF), the model trained on its pairs 2-RF, and so on. Fig. 6 runs it on the toy networks the page embeds, from the same 60 noises (every network and solver is in the 2-D flow playground tab):
Toy, round after round (the table beside this). Rounds 3 and 4 add a little at 1 step (91%, 92%) and lose a little at the fine solve (97%, 96%, 94%, 94%): each round fits the previous round's slightly wrong map, and errors add up. The first flow's own pairing already travels about as little as optimal transport (3.34 against 3.39): rectifying turns a random coupling into a deterministic one "with lower convex transport costs" (Liu et al.).
| Round | straightness | on a blob, 1 Euler step | fine solve (256 Heun) | pair travel |X1 − z|² |
|---|---|---|---|---|
| 1-RF (root) | 0.8652 | 0% | 97% | 3.34 |
| 2-RF (root) | 0.9998 | 90% | 96% | 3.34 |
| 3-RF (here) | 0.9999 | 91% | 94% | 3.32 |
| 4-RF (here) | 0.9999 | 92% | 94% | 3.25 |
Each round trained like the one before (12,000 steps on 20,000 pairs from a 256-step Heun solve). Pair travel: mean squared distance between each noise and where that round's flow takes it (random pairing 11.1; minibatch OT over 4,096 3.39). measured on CPU.
Images. One reflow turns a useless 1-step model (FD 1253.5) into a usable one (159.8). The second reflow (3-RF) helps only at 1 step (146.2) and is worse at every other budget: 108.7 against 99.5 at 2 steps, 96.6 against 83.1 at 4, 85.8 against 73.1 at 50 (48.9 for 1-RF). Diversity at 50 steps falls round by round (25.7, 25.0, 24.3; real 28.9): each round's pairs are a finite set of the previous model's samples, so lost variety cannot come back. The 2-RF paths were already nearly straight (0.999), leaving the next round only error to inherit. And the rectified coupling barely shortens the trip in 1,024 dimensions: the 1-RF's own pairs travel 12% less than random pairs, yet that was enough to make 1 step work.
Published (Liu et al., CIFAR-10, Table 1): one Euler step FID 378 (1-RF), 12.21 (2-RF), 8.15 (3-RF); with the adaptive RK45 solver 2.58, 3.36, 3.96: the same trade at scale published; "It is not recommended to apply too many reflow steps as it may accumulate estimation error". The cost: per round a pass that generates the pairs (30,000 pairs took 8.3 min on MPS here) plus a fine-tune (7.4 min). How to check: FD (or your metric) at 1, 2, 4 and 50 steps before and after each round, plus diversity.
| Model | 1 step | 2 | 4 | 50 | diversity at 50 | straightness |
|---|---|---|---|---|---|---|
| 1-RF (root) | 1253.5 | 489.3 | 158.3 | 48.9 | 25.7 | 0.9861 |
| 2-RF (root) | 159.8 | 99.5 | 83.1 | 73.1 | 25.0 | 0.9992 |
| 3-RF (here) | 146.2 | 108.7 | 96.6 | 85.8 | 24.3 | 0.9995 |
FD by Euler steps, 1,000 samples from the root's noise seed. 1-RF and 2-RF are the root's runs (2-RF: 30,000 pairs from a 25-step midpoint solve in 503 s, then 2,000 steps from the 1-RF's weights in 443 s); 3-RF trained the same way here and scored by the same code measured on Apple M1 Pro (MPS). Re-scoring the root's 2-RF here gave 159.8 at 1 step (root: 159.8).
The problem. Even a rectified flow is integrated in steps. Distillation trains a student T(z) to output the teacher's ODE end point X1 = flow(z) directly, in one call. Which teacher should it copy? Liu et al.'s recipe regresses T(z) onto the k-RF's pairs (for one step they "replace the L2 loss function with the LPIPS similarity", a perceptual distance). Here the student is the teacher's own network evaluated at t = 0, initialised from the teacher, with a squared error: z + v(z, 0) → X1, on the pairs the next reflow round uses (step 5 of Fig. 6).
| One-step student of | toy: on a blob | toy: W2 to data | images: FD | images: class accuracy | images: diversity |
|---|---|---|---|---|---|
| 1-RF | 94% | 0.315 | 130.0 | 86% | 23.2 |
| 2-RF | 94% | 0.279 | 121.6 | 86% | 23.4 |
| 3-RF | 94% | 0.265 | not run |
W2: 2-Wasserstein distance between 2,000 samples and 2,000 data points (two sets of real data score about 0.31). Image students trained 1,500 steps (5.5 and 5.5 min on MPS) and scored like section 8 measured. A 3-RF image student would need a third pair pass; skipped (cheap-runs rule).
What it shows. The student of a straighter teacher matches the data better (toy W2 0.315, 0.279, 0.265; image FD 130.0 for the 1-RF's student, 121.6 for the 2-RF's): a straighter teacher's noise-to-data map is smoother, so easier to fit in one call. Both image students beat one Euler step of 2-RF (159.8) or 3-RF (146.2) at the same cost, so for one step, distilling beat a further reflow round measured. Liu et al.'s CIFAR-10 table orders them the same way: one-step FID 6.18 (1-RF + distill), 4.85 (2-RF + distill), 5.21 (3-RF + distill) published; one reflow before distilling is the sweet spot. None of the tiny students reaches the multi-step teachers (FD 48.9 for 1-RF at 50 steps): they had 1,500 steps of L2 where Liu et al. used LPIPS and far longer training. How to check: student against teacher at the teacher's best step count, plus diversity (distilled students often lose variety).
pipelines/flux/pipeline_flux.py line 847, if self.transformer.config.guidance_embeds:), so one call replaces classifier-free guidance's two.The question. Same data, same 1,040,353-parameter U-Net, same scorer, same starting noise: the root's diffusion model with three samplers, the flow model (1-RF) with Euler and midpoint, its reflows and the one-step students. Which gives the best sample per network evaluation? (One evaluation is one forward pass of the same network, so equal NFE is equal time.)
What it shows. At 4 evaluations flow with Euler scores FD 158.3 against 478.9 for DDIM and 300.3 for DDPM; at 10, 64.4 against 181.3, 130.5 and DPM-Solver++'s 115.1; at 20, 49.8 against 130.9, 77.9 and 101.2. Midpoint does better still (47.3 at 4 evaluations). Few steps cost diversity, not recognisability: class accuracy is above 85% for every flow run from 2 Euler steps, while diversity is 15.3 at 2 steps and 25.7 at 50 (real 28.9) measured. Why flow needs fewer steps here: the DDPM path bends by construction (straightness 0.885 against 0.986 for flow, measured on 50-step image paths), its linear schedule is nearly pure noise for most of its range (section 6), and x̂0 from a noise prediction divides by a tiny √ā at the noisy end, while a velocity stays bounded.
Where diffusion still wins. With many steps the stochastic DDPM sampler reaches FD 34.9 at 1,000 steps (39.7 at 250), below every deterministic flow run (best 43.5, Heun with a last Euler step at 19 evaluations). Solving the flow ODE more exactly does not help (Euler at 250 steps 53.0, midpoint at 25 steps 53.1): fresh noise corrects an imperfect model, and section 12 gives the flow model that noise.
FD, 1,000 samples (100 per class), noise seed 11; real images 18.9. Diffusion rows: the root Diffusion lab's recorded runs; 1-RF and 2-RF: the root's; 3-RF, students and the SDE row: this page measured on Apple M1 Pro (MPS), 2026-10-17.
Predict, then watch: at 4 evaluations, which side looks like clothing? The card beside this steps through 1, 2, 4, 10, 20 and 50 evaluations by itself; pick any two models. The FD numbers below are for its default pair, DDIM on the left and the flow with Euler on the right.
The root's strip noise (seed 5, one per class). Rows are models, columns network evaluations. Empty cells were not run (DDPM, DDIM and DPM-Solver++ have 1, 4, 10, 20, 50 steps; midpoint's NFE is twice its steps; a student has only NFE 1).
Guidance carries over unchanged. Trained with 10% of labels dropped, the model gives a conditional velocity vc and an unconditional vu, and the sampler uses vu + s (vc − vu): two evaluations per step. On the tiny flow model at 50 Euler steps, FD 48.9 unguided and 23.8 at s = 1.5, the best score of either model measured by the root. How guidance trades variety for adherence, and its fixes: Diffusion from zero, section 6.
Flow, Euler 50 steps, 1,000 samples measured: FD 48.9 unguided (s = 1), 23.8 at s = 1.5 (class accuracy 94.6%; real images score 18.93), 54.6 at s = 2, 140.5 at s = 3 and 275.7 at s = 5, where accuracy is 99.7% and diversity has fallen from 25.7 to 20.4: guidance trades variety for recognisability, and past a small scale FD punishes the lost variety. s = 0, the unconditional model (it only trained on the 10% of examples whose label was dropped), scores 362.2. The Diffusion lab's DDIM-50 sweep peaked at s = 2 (FD 35.55; it did not try 1.5); the flow model's best is lower.
The problem. Each training step draws one t per example. Uniform t spends equal effort on every noise level, but section 2 showed the levels differ: near pure noise the target is mostly unpredictable, near clean data the input gives the answer away, and the middle is where the network has the most to learn. Which distribution of t gives the best model for a fixed budget?
How it works. Draw u uniform in [0, 1] and map it. SD3 (Esser et al., arXiv 2403.03206, section 3.1) compared, in its own convention (σ = 1 − t: 0 data, 1 noise): logit-normal lognorm(m, s), the logistic of a normal with mean m and scale s (m > 0 leans towards noise); mode sampling fmode(u; s) = 1 − u − s (cos²(πu/2) − 1 + u), which keeps some weight at the ends; and CosMap 1 − 1/(tan(πu/2) + 1).
Predict before moving m: which end does m = 1 starve? Densities from SD3's formulas: logit-normal analytically, mode sampling and CosMap by mapping 20,000 evenly spaced u derived. Dashed: the toy's irreducible loss floor by t (section 2), rescaled to fit.
Published. SD3 trained 61 variants on ImageNet and CC12M; ranked over two datasets, EMA and plain weights and several step counts, "rf/lognorm(0.00, 1.00) consistently achieves a good rank": first overall (rank 1.54), plain uniform rectified flow 5.67, classic eps/linear diffusion 2.88 (Table 1). At 25 steps on ImageNet, FID 45.78 for lognorm(0, 1) against 49.70 for uniform (Table 2) published. Logit-normal(0, 1) became the default: Movie Gen (arXiv 2410.13720: "zero mean and unit standard deviation"), HunyuanVideo (2412.03603) and Wan (2503.20314) all state logit-normal t published.
What it shows. At 12,000 steps logit-normal(0, 1) cuts the mid-path error (0.047 to 0.028) and multiplies the error near pure noise (0.019 to 0.400), because it almost never trains there. Sample quality after 64 steps is within the seed-to-seed spread for every scheme (W2 0.259 uniform, 0.245 logit-normal; real against real 0.31). At the short budget, schemes that concentrate on the middle land more points on a blob in 4 steps (70% uniform against 79% logit-normal). On a 2-D toy the choice is nearly free; its published value comes at image scale, where the middle of the path carries most of the perceptual work and budgets are never "converged".
In SD3's Table 2, lognorm(0.5, 0.6), which leans hard to noise, had the best CLIP score (0.256) and a much worse FID (80.41): a scheme can buy prompt adherence at the cost of image statistics published.
| Scheme (SD3's notation) | error at t = 0.02 | error at t = 0.5 | on a blob, Euler 4 | W2, Euler 64 (± sd) |
|---|---|---|---|---|
| uniform | 0.146 | 0.033 | 70% | 0.288 ± 0.021 |
| lognorm(0,1) | 0.763 | 0.038 | 79% | 0.335 ± 0.039 |
| lognorm(0.5,0.6) | 1.032 | 0.059 | 65% | 0.383 ± 0.006 |
| lognorm(-0.5,1) | 1.089 | 0.071 | 85% | 0.467 ± 0.071 |
| mode(1.29) | 0.350 | 0.022 | 74% | 0.333 ± 0.023 |
| cosmap | 0.210 | 0.032 | 73% | 0.303 ± 0.022 |
| uniform | 0.019 | 0.047 | 81% | 0.259 ± 0.009 |
| lognorm(0,1) | 0.400 | 0.028 | 82% | 0.245 ± 0.018 |
| lognorm(0.5,0.6) | 0.826 | 0.013 | 78% | 0.241 ± 0.003 |
| lognorm(-0.5,1) | 0.824 | 0.038 | 83% | 0.257 ± 0.038 |
| mode(1.29) | 0.108 | 0.021 | 80% | 0.243 ± 0.018 |
| cosmap | 0.036 | 0.040 | 81% | 0.264 ± 0.017 |
Error: |vθ − u|² against the exact field, 4,000 points per t; t = 0.02 is near pure noise in this page's convention. Means over 3 seeds measured.
| Variant (SD3's notation) | rank, all | rank, 5 steps | rank, 50 steps | ImageNet FID (25 steps) | ImageNet CLIP |
|---|---|---|---|---|---|
| rf/lognorm(0.00, 1.00) | 1.54 | 1.25 | 1.50 | 45.78 | 0.250 |
| rf/lognorm(1.00, 0.60) | 2.08 | 3.50 | 2.00 | 114.26 | 0.254 |
| rf/lognorm(0.50, 0.60) | 2.71 | 8.50 | 1.00 | 80.41 | 0.256 |
| rf/mode(1.29) | 2.75 | 3.25 | 3.00 | ||
| rf/lognorm(0.50, 1.00) | 2.83 | 1.50 | 2.50 | ||
| eps/linear | 2.88 | 4.25 | 2.75 | 48.42 | 0.245 |
| rf/mode(1.75) | 3.33 | 2.75 | 2.75 | 44.39 | 0.253 |
| rf/cosmap | 4.13 | 3.75 | 4.00 | ||
| edm(0.00, 0.60) | 5.63 | 13.25 | 3.25 | ||
| rf | 5.67 | 6.50 | 5.75 | 49.70 | 0.247 |
| v/linear | 6.83 | 5.75 | 7.75 | 51.68 | 0.246 |
| edm(0.60, 1.20) | 9.00 | 13.00 | 9.00 | ||
| v/cos | 9.17 | 12.25 | 8.75 | 50.74 | 0.244 |
| edm/cos | 11.04 | 14.25 | 11.25 | ||
| edm/rf | 13.04 | 15.25 | 13.25 | ||
| edm(-1.20, 1.20) | 15.58 | 20.25 | 15.00 | 63.12 | 0.236 |
Esser et al. 2024, Tables 1 and 2 published, read from arXiv HTML 2026-10-17. Rank: non-dominated sorting over CLIP and FID, averaged over EMA and plain weights, two datasets and sampler settings (lower is better). FID and CLIP from Table 2, which lists only some variants (blank where not listed). "rf" is rectified flow with uniform t; eps/linear is the LDM-style diffusion baseline.
The trained network's squared distance from the exact field by t (log), mean of 3 seeds, uniform always drawn measured on CPU (fm_toy.py, about 7 minutes for every toy experiment on this page). The chips are the six SD3 variants trained; the sliders above retrain nothing.
The resolution shift. A bigger image has more pixels to average over, so the same noise level destroys less of it: at a given t a 1024-pixel image is "less noisy" than a 256-pixel one. SD3 shifts the time to compensate, tm = √(m/n) tn / (1 + (√(m/n) − 1) tn) on the noise level (section 5.3.2, eq. 23), with "a shift value of α = 3.0 both during training and sampling at resolution 1024×1024" published. diffusers implements a fixed shift as sigmas = self.shift * sigmas / (1 + (self.shift - 1) * sigmas) (FlowMatchEulerDiscreteScheduler, v0.41.0, scheduling_flow_match_euler_discrete.py line 351) and, with use_dynamic_shifting, math.exp(mu) / (math.exp(mu) + (1 / t - 1) ** sigma) (lines 646 to 647) with μ linear in the number of image tokens (calculate_shift, pipelines/flux/pipeline_flux.py lines 73 to 83). With sigma = 1 the two are one formula with shift = eμ derived: FLUX's defaults (μ from 0.5 at 256 tokens to 1.15 at 4,096) give shift 1.65 at 512 × 512 and 3.16 at 1024 × 1024, beside SD3's 3.0.
When it matters: training from scratch (logit-normal(0, 1) unless you have a reason), fine-tuning at a new resolution (the shift should change with it), and sampling with few steps (HunyuanVideo: "we set a larger shifting factor s for a lower inference step"). On the 28 × 28 model no shift was best (the root measured FD 158.3 at 4 steps unshifted against 294.6 with shift 1/3 and 242.4 with shift 3): a small image has nothing to gain. How to check: per-t validation loss against a reference run, and samples at your production step count.
Predict, then drag: at 4 steps and 1024 px with the FLUX.1 defaults, how many evaluations fall in the noisier half? Then halve the resolution.
The problem. The flow ODE is deterministic, and section 10 found the stochastic DDPM sampler beating every deterministic run at many steps. Can a flow model sample stochastically too, and should it?
How it works. A velocity also gives the score (the gradient of the log density, pointing to more likely data): on the straight path E[x0 | x] = x − t v, so score = −(x − t v)/(1 − t) derived. For any noise level ε ≥ 0 the stochastic differential equation dx = (v + ε/2 · score) dt + √ε dW has the same distribution at every t as the ODE (the extra drift cancels the spreading the noise causes). Albergo, Boffi and Vanden-Eijnden's "Stochastic Interpolants" (arXiv 2303.08797, Mar 2023) build flows and diffusions as one family "with an adjustable level of noise" published; the ODE is ε = 0, and the 2-D flow playground has an ε control. Fig. 7 runs both on the exact toy field from the same 150 noises:
| Exact field, straight path: noise ε | 4 steps | 16 steps | 256 steps |
|---|---|---|---|
| 0 (ODE) | 90% | 98% | 99% |
| 1 | 50% | 98% | 99% |
| 4 | 9.3% | 32% | 98% |
Share on a blob, Euler-Maruyama, the same 2,000 noises measured on CPU.
With a perfect field, noise only costs steps: every ε reaches the data with enough steps, and more noise needs more. Noise helps when the field is imperfect: each injection lets the sampler forget part of the error it accumulated. SiT measured that on ImageNet: SDE sampling beats the ODE for every path (FID 39.8 to 37.8 on VP, 34.8 to 33.6 on the straight path, 34.6 to 32.9 on GVP; Table 5, many steps) published, and their best SiT-XL result (2.06) uses an SDE sampler.
What it shows. Constant noise to the data end destroys the samples (FD 488.5 at ε = 0.5, 50 steps, against 48.9 for the ODE): the score divides by 1 − t, so near the data end the network's small errors are multiplied by 1/(1 − t), 25 at the last noisy step of 50, and the fresh noise must be removed by exactly that score. Let the noise fade and the picture flips with the step count: at 50 steps every noise level is still worse than the ODE (56.5, 70.8, 86.5), but at 250 steps better, and more so with more noise: 47.8, 43.0, 35.7 against 53.0 for the ODE at 250 and 48.9 at its best. That is SiT's result on a 1M-parameter model, and DDPM's win in section 10 seen from the flow side. How to check: sweep ε at your step budget; expect the best ε to rise with the number of steps.
| noise | 10 steps | 50 steps | 250 steps |
|---|---|---|---|
| ε = 0 (ODE) | 64.4 | 48.9 | 53.0 |
| constant ε = 0.5 | 492.1 | 488.5 | 459.7 |
| constant ε = 1 | 1090.7 | 1143.8 | 964.0 |
| decaying ε = 0.5 (1 − t) | not run | 56.5 | 47.8 |
| decaying ε = 1 (1 − t) | not run | 70.8 | 43.0 |
| decaying ε = 2 (1 − t) | not run | 86.5 | 35.7 |
The root's 1-RF, FD as in section 8 (real images 18.9). The score comes from the same velocity network; the last step is plain Euler; ε = 0 reproduces the root's Euler numbers exactly. "Decaying": εt = ε (1 − t), no noise near the data measured on Apple M1 Pro (MPS).
The pattern. Since SD3 the major open image and video generators train a transformer with flow matching on the straight path and logit-normal t, then sample with Euler (or a multistep solver) on a shifted grid whose shift grows with resolution or with fewer steps: SD3 a fixed 3.0 at 1024 px; FLUX a dynamic eμ from 1.65 to 3.16; Z-Image-Turbo a fixed 3.0; HunyuanVideo a fixed 7.0. What differs is the shift rule (fixed, or linear in token count), whether the grid stops short of the data end (shift_terminal), and the distillation behind few-step variants (LADD for FLUX.1 [schnell] and SD3-Turbo, guidance distillation for FLUX.1 [dev]). The networks themselves are on Latent diffusion and diffusion transformers; video systems on Video and audio generation.
Training from the paper or card (published, dated); sampling from the scheduler configuration in the repository at the revision shown (read 2026-10-17). Gated repositories (SD 3.5, FLUX.1) were not read; their rows come from the paper, the card or the diffusers pipeline defaults.
| Model (date) | Training: path, t | Released sampler config | Notes |
|---|---|---|---|
| Stable Diffusion 3 (paper, Mar 2024) | straight path (rectified flow), logit-normal(0, 1) chosen from 61 formulations | not read (gated); paper: shift 3.0 at 1024 px | MMDiT; LADD distils it to SD3-Turbo, 4 steps |
| FLUX.1 [dev], [schnell] (2024-07-31) | "rectified flow transformer", 12B (card) | not read (gated); FLUX pipeline defaults: dynamic shift, μ 0.5 to 1.15 (shift 1.65 to 3.16) | schnell: LADD, 1 to 4 steps; dev: guidance as an input |
| FLUX.2 [klein] 4B (repo 2026-01-14) | flow matching (Model map) | FlowMatchEuler, dynamic shift, μ 0.5 at 256 to 1.15 at 4096 tokens (shift eμ = 1.65 to 3.16); rev e7b7dc27f91d | Apache 2.0 |
| Qwen-Image (2025-08-02) | flow matching (Model map) | FlowMatchEuler, dynamic shift, μ 0.5 at 256 to 0.9 at 8192 tokens (shift eμ = 1.65 to 2.46), shift_terminal 0.02; rev 75e0b4be04f6 | MMDiT 20.43B |
| Z-Image-Turbo (repo 2025-11-25) | flow matching (Model map) | FlowMatchEuler, fixed shift 3; rev f332072aa78b | 6.155B |
| Wan 2.1 (paper Mar 2025; 1.3B shown) | "x_t = t x_1 + (1 - t) x_0", logit-normal t | UniPC multistep, flow_prediction, flow_shift 3; rev 0fad780a534b | video; 1.3B and 14B |
| HunyuanVideo (paper Dec 2024) | Flow Matching, logit-normal t | FlowMatchEuler, fixed shift 7 (community diffusers repo, rev e8c2aaa66fe3) | video, 13B; larger shift for fewer steps |
| LTX-Video (repo read 2026-10-17) | flow matching (config) | FlowMatchEuler, dynamic shift, μ 0.95 at 1024 to 2.05 at 4096 tokens (shift eμ = 2.59 to 7.77), shift_terminal 0.1; rev 8984fa25007f | video |
| Movie Gen (paper Oct 2024; not released) | Flow Matching, logit-normal(0, 1), 30B | linear-quadratic grid, 50 steps "emulating 250 linear steps" | video and audio |
FLUX.1 shift from the FLUX pipeline's calculate_shift defaults (base_shift 0.5 at 256 tokens to max_shift 1.15 at 4,096), shift = eμ derived. Token counts: a 1024 × 1024 image through an 8× VAE and 2 × 2 patches gives 64 × 64 = 4,096 tokens derived. Licences and release dates are in the root's Model map tab.
Each is closed; open the ones you need. Real outputs and errors from the runs on this page and the root's.
FlowMatchEulerDiscreteScheduler (v0.41.0, schedulers/scheduling_flow_match_euler_discrete.py) noises with sample = sigma * noise + (1.0 - sigma) * sample (line 234), so its model output is noise − data, the negative of this page's v; it steps with dt = sigma_next - sigma (line 504, negative) and prev_sample = sample + dt * model_output (line 511), and passes the network sigmas * num_train_timesteps, σ × 1000 (line 367). Same maths, opposite sign and a factor of 1,000 on t. What each mix-up does to the tiny model (Euler, 50 steps, same noise):
Correct sampling: FD 48.9. Integrating from t = 1 down to 0 (diffusers' direction) with this t = 0-is-noise model: FD 1,867.8, class accuracy 10.7% (chance is 10%). Passing t × 1000 (what diffusers' pipelines give a transformer) to a net trained on t in [0, 1]: FD 1,229.3, accuracy 21.3%. Neither raises an error. measured
Porting a checkpoint between the conventions needs both the time flip and the sign flip. A quick test: the 1-step output should be a recognisable blur of the class; if it is not, the convention is wrong, not the model.set_timesteps(n) yourself instead of passing the pipeline's gridsigmas = np.linspace(1.0, 1 / num_inference_steps, num_inference_steps) instead (pipeline_flux.py line 823). Measured with FLUX.2 [klein]'s real config at 1024 px (src/runs/fm_sched_demo.py, diffusers 0.41.0):1024 px: 4096 tokens, mu = 1.150, shift e^mu = 3.158 dynamic sigmas: [1.0, 0.8635, 0.613, 0.0032, 0.0] fixed-shift sigmas: [1.0, 0.8639, 0.6145, 0.0099, 0.0] pipeline grid, dynamic: [1.0, 0.9045, 0.7595, 0.5128, 0.0] ValueError: `mu` must be passed when `use_dynamic_shifting` is set to be `True`The scheduler's own grid gives three useful steps; the pipeline's gives four. The fixed and dynamic forms of the shift agree inside the grid (0.8635 against 0.8639) and differ only in where they put the smallest level.
ValueError: `mu` must be passed when `use_dynamic_shifting` is set to be `True` (line 310, the real message above). Compute μ from your image's token count with calculate_shift and the config's base and max values; a fixed shift of eμ is equivalent inside the grid.Published, read on 2026-10-17 from arXiv abstract and HTML pages (quotes and table numbers transcribed in src/inputs/published.md): Lipman et al. 2210.02747 (Theorem 2); Liu, Gong, Liu 2209.03003 (non-crossing, transport cost, reflow warning, LPIPS distillation, Table 1); Albergo, Boffi, Vanden-Eijnden 2303.08797; Tong et al. 2302.00482; Pooladian et al. 2304.14772; Gu et al. 2310.02664; Kamb and Ganguli 2412.20292; SiT 2401.08740 (Tables 1 to 5); SD3 2403.03206 (section 3.1, Tables 1 and 2, section 5.3.2); Movie Gen 2410.13720; HunyuanVideo 2412.03603; Wan 2503.20314; LADD 2403.12015; InstaFlow 2309.06380; Shortcut models 2410.12557; MeanFlow 2505.13447; Song et al. 2011.13456 (the probability-flow ODE); the blog "Diffusion Meets Flow Matching: Two Sides of the Same Coin" (authors and date not shown on the page, read 2026-10-17). Scheduler configs from the Hub at the revisions in src/inputs/scheduler_configs.json. diffusers v0.41.0 (commit 086bf9578c0f) source lines located by pattern; facebookresearch/flow_matching at commit 11568d3; torchcfm at commit 7c65385.
Measured here (Apple M1 Pro, 2026-10-17): the toy experiments on CPU (src/runs/fm_toy.py), the exact empirical field and copies (fm_memo.py, CPU), coupling distances on images (fm_ot_images.py, CPU), the scheduler demo (fm_sched_demo.py, CPU), and on MPS: reflow pairs (fm_pairs.py), 3-RF and the two one-step students (fm_train.py), scoring and SDE sampling (fm_score.py). The objective's code, the 1-RF and 2-RF models, the solver comparison, the t = 1 measurement, the convention bugs and the guidance sweep are the root topic's Flow lab runs (src/flow/ in the root), read from its recordings by src/make_data_more.py; the diffusion rows are the root Diffusion lab's. What transfers to a datacenter GPU: everything counted in network evaluations, rounds and steps; what does not: seconds.
Not run here: training at SD3 or FLUX scale (published numbers instead); logit-normal training of the image model (a 15-minute run whose difference would sit below the noise of a 1,000-sample FD; the toy shows the mechanism); LPIPS distillation (L2 used); a 3-RF image student (a third pair pass); adaptive ODE solvers (torchdiffeq is not in the shared environment); consistency, shortcut and MeanFlow training (published only).
A workbench for the whole page: the 2-D toy (noise in the plane, a ring of 8 Gaussian blobs as data) with the exact field for three paths (Reading, sections 2 and 6), stochastic sampling (section 12), four reflow rounds (section 8) and three one-step students (section 9). Two panels run on the same starting noise, so every comparison is a before and after. Nothing moves until you press play or step.
Try: each preset sets both panels; then change one thing at a time. DDIM is defined for the exact fields (predict both ends, re-noise at the next time); on the straight path it equals Euler. Midpoint costs two network evaluations per step (NFE shown under each panel). ε adds fresh noise each step with the same marginals (Reading, section 12). A one-step student ignores the step count.
src/runs/fm_toy.py, same recipe.Scores under each panel are computed live on the 300 particles shown (2,000 in the recorded tables, so they differ slightly). "On a blob": within 0.75 of a centre. Straightness: straight-line distance over path length.
This page's tabs, the parent topic and its labs, the sibling pages, the knowledge base pages this one leans on, the papers and code behind it, each with an approximate time. Outside sources are marked maker (by the people who built the method or model) or third-party. Links checked on 2026-10-17.
Flow matching from zero: training, the marginal field, the perfect model's few-step error and its copies, solvers and grids, paths, couplings, reflow, distillation, flow against diffusion at equal cost, timestep sampling and the shift, stochastic sampling, production, mistakes. 43 min, plus 17 in closed details
Two panels on the same noise: exact fields of three paths, ODE or SDE, four reflow rounds, three one-step students, seven presets. 10 min
The map of the topic and which page owns what; its Model map has every generator's release, licence and scheduler. The toy, the image model, the solvers, the first reflow and the convention bugs that this page reads are the topic's flow runs (root src/flow/out), and the DDPM rows of section 10 its diffusion runs (root src/diff/out). see the page
The diffusion side of sections 6 and 10, from zero: the forward process, schedules, prediction targets and loss weighting, samplers, guidance and its fixes. about 43 min
The networks that the production rows of section 13 train: MMDiT, FLUX-style blocks, token counts by resolution; few-step distillation of diffusion models (section 10, which section 9 links). about 32 min
Wan, HunyuanVideo, Movie Gen and LTX-Video as video systems: space-time patches, temporal VAEs, cost. about 31 min
FID's bias with sample size and why it cannot see copying (section 4). about 27 min
Derivation D8 (section 7) derives the conditional flow-matching loss and Lipman et al.'s Theorem 2; D5 and D6 the score and DDIM. 23 min, plus 18 in closed details
The paper page for the variance-preserving path that section 6 compares against. about 25 min
Why every production flow model of section 13 runs in a latent space. about 24 min
Conditional flow matching, Theorem 2, Gaussian paths, the OT path. 40 min for sections 2 to 4
Non-crossing, transport cost, reflow, distillation, Table 1. 40 min
Flows and diffusions as one family with a tunable noise level (section 12). Long and mathematical. 2 h; the introduction 20 min
One ingredient at a time from DiT to a linear-interpolant velocity model, ODE against SDE (Tables 2 to 5). 30 min
Timestep sampling (section 3.1, Tables 1 and 2), the resolution shift (section 5.3.2), MMDiT. 45 min
Minibatch OT couplings (section 7). 20 min each
Why the optimum copies and why networks do not (section 4). 30 min each
Average velocity over an interval, one step from scratch (section 9). 30 min
Conditioning on the step size (section 9). 25 min
Flow matching at 30B for video, logit-normal t, the linear-quadratic grid (section 3 of the paper). 30 min for sections 3.1 and 3.4
The long tutorial from Meta with the facebookresearch/flow_matching library. 1 to 2 h
The DDIM-equals-Euler identity checked numerically in section 6, and the weighting view. 20 min
Exact and minibatch OT couplings, stochastic interpolants, small runnable examples. 30 min
Shift, dynamic shift, shift_terminal, the Euler step: the code behind sections 11 and 14. 20 min