Improving Rectified Flow with Boundary Conditions
Xixi Hu, Runlong Liao, Keyang Xu, Bo Liu, Yeqing Li, Eugene Ie, Hongliang Fei, Qiang Liu
TL;DR
Rectified Flow learns a velocity field to transport noise to data via an ODE, but vanilla RF often violates theoretical boundary conditions, causing instability in sampling near the terminal time. The authors introduce Boundary-enforced Rectified Flow Models with two parameterizations—Mask-based and Subtraction-based—that enforce $v(\mathbf{x},1)=\mathbf{x}$ (and optionally $v(\mathbf{x},0)=C-\mathbf{x}$) by design, with minimal code changes. They demonstrate substantial gains on ImageNet and CIFAR-10 across both deterministic (Euler) and stochastic (SDE) sampling, and ablations confirm the importance of boundary choices and scalability to larger models and higher resolutions. By stabilizing the score function near $t=1$, the approach enables robust stochastic sampling and suggests applicability to broader diffusion-flow hybrids. Overall, Boundary RF Model provides a simple, effective, and scalable fix for boundary violations in Rectified Flow with meaningful practical impact.
Abstract
Rectified Flow offers a simple and effective approach to high-quality generative modeling by learning a velocity field. However, we identify a limitation in directly modeling the velocity with an unconstrained neural network: the learned velocity often fails to satisfy certain boundary conditions, leading to inaccurate velocity field estimations that deviate from the desired ODE. This issue is particularly critical during stochastic sampling at inference, as the score function's errors are amplified near the boundary. To mitigate this, we propose a Boundary-enforced Rectified Flow Model (Boundary RF Model), in which we enforce boundary conditions with a minimal code modification. Boundary RF Model improves performance over vanilla RF model, demonstrating 8.01% improvement in FID score on ImageNet using ODE sampling and 8.98% improvement using SDE sampling.
