Context aware step selection speeds up flow models for image and video

Contextual Flow Matching: Adaptive Step Selection in Flow Models for Efficient Visual Generation

Computer Vision and Pattern RecognitionArtificial Intelligence

Summary

Creating images and videos using flow models takes a lot of computer time because many calculations need to happen in sequence. The authors introduced COFLOW, a method that changes how many steps it takes based on what is being generated, saving time while keeping the quality high. COFLOW works without retraining the main model and can speed up generation by more than 2.5 times for pictures and videos. They also show mathematically that their approach controls errors well under common assumptions.

What this means in practice

  • For visual effects studios: Speed up rendering of generated images and videos by dynamically adjusting computation per output based on content complexity.
  • For mobile app developers: Deliver faster on-device visual generation by integrating adaptive step control without retraining models for varied user inputs.

Authors

Divya Jyoti Bajpai, Arun Verma, Manjesh Kumar Hanawal

Abstract

Flow Matching enables high-quality visual generation via continuous-time dynamics, but inference remains costly due to multiple sequential function evaluations. Existing acceleration methods reduce the number of function evaluations but often introduce additional training overhead, degrade quality, or fail to account for input-dependent variability. We propose COFLOW, an inference-time method that adaptively selects the step counts each generation based on the prompt features. Our context-aware COFLOW is trained online with an unsupervised reward that balances inference efficiency and generation fidelity. Our method is plug-and-play, requiring no retraining of the underlying generative model. It generalizes to image and video generation, achieving over 2.5x speedup while preserving perceptual and semantic quality. We further provide a theoretical analysis establishing an O(1/K) forward-Euler discretization error bound under standard regularity conditions.