FlowTurbo: Towards Real-time Flow-Based Image Generation with Velocity Refiner

Building on the success of diffusion models in visual generation, flow-based models reemerge as another prominent family of generative models that have achieved competitive or better performance in terms of both visual quality and inference speed. By learning the velocity field through flow-matching, flow-based models tend to produce a straighter sampling trajectory, which is advantageous during the sampling process. However, unlike diffusion models for which fast samplers are well-developed, efficient sampling of flow-based generative models has been rarely explored. In this paper, we propose a framework called FlowTurbo to accelerate the sampling of flow-based models while still enhancing the sampling quality. Our primary observation is that the velocity predictor's outputs in the flow-based models will become stable during the sampling, enabling the estimation of velocity via a lightweight velocity refiner. Additionally, we introduce several techniques including a pseudo corrector and sample-aware compilation to further reduce inference time. Since FlowTurbo does not change the multi-step sampling paradigm, it can be effectively applied for various tasks such as image editing, inpainting, etc. By integrating FlowTurbo into different flow-based models, we obtain an acceleration ratio of 53.1%$\sim$58.3% on class-conditional generation and 29.8%$\sim$38.5% on text-to-image generation. Notably, FlowTurbo reaches an FID of 2.12 on ImageNet with 100 (ms / img) and FID of 3.93 with 38 (ms / img), achieving the real-time image generation and establishing the new state-of-the-art. Code is available at https://github.com/shiml20/FlowTurbo.

Paper

References (40)

Scroll for more · 28 remaining

Similar papers

Peer review

Reviewer Q4Pt7/10 · confidence 4/52024-07-01

Summary

This paper introduces FlowTurbo, a framework to accelerate flow-based generative models. The key contributions are: 1) a lightweight velocity refiner to estimate the offset of velocity efficiently during sampling; 2) a pseudo corrector to reduce the number of model evaluations while keeping the original second-order convergence; 3) sample aware compilation to compile model evaluations, sampling steps and cfg into a static graph for extra speedup; Extensive experiments with both class-conditioned and text-to-image generation show significant acceleration (30-58%). Notably, on ImageNet 256x256 generations, FlowTurbo achieves the fastest sampling speed (38 ms/image) with FID 3.93. Moreover, due to the compatibility with multi-step sampling, it can also be applied to other tasks including image editing, inpainting, etc.

Strengths

Given the popularity of flow-based generation models, SD3 for image and Sora for video, flow-based model acceleration is an important area, which is under-explored compared with diffusion-based models. Motivated by the stability of velocity prediction during sampling, the authors proposed a lightweight velocity refiner. The pseudo corrector technique reduces the model evaluation while preserving the second-order convergency. These ideas are novel and effective. The experimental results are comprehensive covering generation task with class-conditional and text-to-image generation, editing tasks including editing, inpainting, object removal. The ablation studies are thorough, examining each component's contribution and various hyperparameters. Finally, the code is also provided for reproducibility. The paper is easy to follow, for example, Figure 2 illustrates the motivation for light-weight estimation model very clearly.

Weaknesses

For text-to-image generation, insta-flow is adopted as the teacher model, which is built on top of sd1.5. It would be great to experiment with other flow-based models that are natively trained with flow matching, for example, sd3. It would also be interesting to see how FlowTurbo performs when the model size changes. For example, SiT-XL vs SiT-L. Finally, one missing ablation is the architecture of refiner. how to design a refiner for different architectures?

Questions

Can this method also be applied to video-based generation models? The inference is much slower for video generation compared with image generation. it would be great to see if there is a unified method for both image and video generation.

Rating

7

Confidence

4

Soundness

3

Presentation

3

Contribution

3

Limitations

The proposed method is limited to flow-based generation models.

Reviewer RYd76/10 · confidence 4/52024-07-12

Summary

This paper explores enhancing flow-based generative models for image generation by accelerating the sampling process while maintaining or improving image quality. The key contribution, FlowTurbo, is a new framework that introduces a lightweight velocity refiner to adjust velocity predictions during sampling, reducing computational costs. Additionally, techniques like pseudo correctors and sample-aware compilation further optimize the sampling speed. The results show significant acceleration in image generation tasks with improved FID scores, establishing a new benchmark for real-time image generation.

Strengths

Overall I find that the writing is clear, concise, and well-structured, making it easy for readers to follow the arguments and understand the key points. This paper starts from the distinct features of flow models and naturally proposes corresponding solutions. Comprehensive ablations validate the effectiveness of the proposed methods.

Weaknesses

- The design of three types of blocks in sampling is somewhat confusing to me. Why do you have to use these types of blocks and arrange them in this order? Do you have to empirically decide the order and numbers of these blocks for each task/domain/model? - The visualization in Figure 1 is interesting. However, visualizing the discretization error or curvature [1] during sampling seems to be a more suitable and accurate method. - Some important related works [1,2], tailored for flow models, should be discussed and compared. [1] Nguyen, Bao, Binh Nguyen, and Viet Anh Nguyen. "Bellman optimal step-size straightening of flow-matching models." *arXiv preprint arXiv:2312.16414* (2023). [2] Shaul, Neta, et al. "Bespoke Non-Stationary Solvers for Fast Sampling of Diffusion and Flow Models." *arXiv preprint arXiv:2403.01329* (2024).

Questions

If I understand correctly, the proposed method can be applied to diffusion models as well. (Although Figure 1 illustrates flow models may be more suitable.) Have you tested the results on diffusion models like SD or PixArt?

Rating

6

Confidence

4

Soundness

3

Presentation

3

Contribution

3

Limitations

Yes.

Reviewer PyDm7/10 · confidence 5/52024-07-12

Summary

The authors propose FlowTurbo, a method to adapt pre-trained flow-based generative models for faster sampling. The method is based on the observation that the predicted velocity field is quite stable throughout the integration time and hence at each timestamp only small refinement from the previous step is required. Therefore, the authors propose to train a lightweight refinement network and use it at certain timestamps instead of the original velocity field predictor. In addition to the refinement network the paper also suggests to speed up the Heun's integration method by reusing the velocities predicted at previous corrector steps. All the sampling blocks are compiled for further speed up. As a result, FlowTurbo demonstrates great trade-off between speed and quality compared to prior work and achieves sota results on certain tasks.

Strengths

The problem of speeding up generative models is of high importance nowadays. While the majority of the methods aims for decreasing the number of denoising steps, the authors of FlowTurbo propose to make each step significantly cheaper. This is achieved at low additional training costs and could have high impact on the methods that explicitly utilise the iterative nature of modern diffusion- or flow-based generative models (such as [1, 2, 3], see references in Weaknesses). The method is well-grounded and carefully ablated. The experiments demonstrate the effectiveness of FlowTurbo compared to default sampling.

Weaknesses

1) **Prior work**: The paper does a good job with contextualizing it relative to the diffusion-based models. However, references to many flow-based methods are missing, which include: - Models that leverage flow matching for generative process [2, 4, 5, 6, 7, 8, 9]. - And (which is more connected to the topic of the paper) the methods that try to speed up the sampling for flow-based models [10, 11, 12, 13]. 2) **Method**: Despite the good results, it seems that it is not trivial how to choose the exact configuration of the sampling blocks, i.e. the order and the number of different steps. From the first sight the configurations presented in the paper are quite random. At least some intuition on how to setup those is required. Otherwise, if the configuration needs to be tuned for every other dataset, the method is not that straight-forward to apply. 3) **Evaluation**: - The tables would be simpler to read if NFEs (number of function evaluations) were also included as a separate column. - Is the step of the baseline method also compiled in tables 1a and 1b? If not, it would be nice to add this experiment, in addition to the ablations, to see the effect of other parts. [1] Watson et. al, Novel view synthesis with diffusion models, ICLR 2023 [2] Davtyan et. al, Efficient Video Prediction via Sparsely Conditioned Flow Matching, ICCV 2023 [4] Hu et. al, Motion Flow Matching for Human Motion Synthesis and Editing, arxiv 2023 [5] Fischer et. al, Boosting Latent Diffusion with Flow Matching, arxiv 2023 [6] Davtyan et. al, Learn the Force We Can: Enabling Sparse Motion Control in Multi-Object Video Generation, AAAI 2024 [7] Davtyan et. al, Enabling Visual Composition and Animation in Unsupervised Video Generation, arxiv 2024 [8] Gui et. al, Depthfm: Fast monocular depth estimation with flow matching, arxiv 2024 [9] Hu et. al, Flow Matching for Conditional Text Generation in a Few Sampling Steps, arxiv 2024 [10] Shaul et. al, Bespoke Solvers for Generative Flow Models, arxiv 2023, ICLR 2024 [11] Lee et. al, Minimizing Trajectory Curvature of ODE-based Generative Models, ICML 2023 [12] Pooladian et. al, Multisample flow matching: Straightening flows with minibatch couplings, ICML 2023. [13] Tong et. al, Improving and generalizing flow-based generative models with minibatch optimal transport, TMLR 2023. [14] Lipman et. al, Flow matching for generative modeling, ICLR 2023.

Questions

1) In the paper the order of blocks $H_{N_H}P_{N_P}R_{N_R}$ is fixed, and only the number of the blocks $N_H$, $N_P$ and $N_R$ changes. What is the reason behind this? Have you tried other schemes, e.g. sequentially using multiple blocks of type $H_{N_H}P_{N_P}R_{N_R}$? 2) A rather nitpicky comment: Multiple times throughout the paper it is mentioned that the linear interpolation corresponds to the optimal transport from the noise distribution to the data distribution. It is not precisely correct, as the linear interpolation corresponds to the optimal transport from the noise distribution to the distribution concentrated around a particular data point [14]. Methods that attempt to steer flow-matching towards optimal transport between noise and data involve additional tricks [12, 13]. Some typos: 1) Line 137: "interpolation between $x_0$ and $\cancel{v}$ $\epsilon$". 2) Line 170: "simulate the $\cancel{x_t}$ $x_{t_i}$". 3) Eq. 15: $\cancel{x_i \leftarrow x_{i-1}}$ $x_{t_i} \leftarrow x_{t_{i - 1}}$

Rating

7

Confidence

5

Soundness

3

Presentation

3

Contribution

3

Limitations

The authors have adequately addressed the limitations and the potential negative societal impact of their work.

Reviewer yH4R5/10 · confidence 4/52024-07-14

Summary

The paper presents a new approach to accelerate the sampling process in flow-based generative models. Unlike diffusion models, flow-based models, which are based on learning velocity fields through flow-matching, have not seen extensive development in efficient sampling techniques. The authors introduce FlowTurbo, a framework that utilizes a lightweight velocity refiner to estimate velocity during sampling, significantly reducing computation time while maintaining or improving image quality. Additionally, the paper proposes pseudo corrector and sample-aware compilation techniques to further enhance sampling efficiency. Experimental results demonstrate that FlowTurbo achieves substantial speedups and high-quality results in both class-conditional and text-to-image generation tasks.

Strengths

1. **Technical contribution**: The introduction of a lightweight velocity refiner to approximate the offset between the velocities between adjacent timesteps seems sound and is efficient as it requires only a light-weight model. 2. **Additional Techniques**: The integration of pseudo corrector and sample-aware compilation techniques shows a well-rounded approach to improving both speed and quality of the generative process. 3. **Extensive Experiments**: The paper provides thorough experimental results, demonstrating the effectiveness of FlowTurbo across different tasks and models, including detailed comparisons with existing methods. 4. **Real-time Performance**: Achieving real-time image generation with substantial improvements in inference time without compromising quality is a notable accomplishment. 5. **Versatility**: FlowTurbo’s compatibility with various applications such as image editing and inpainting highlights its flexibility and potential for broader applications.

Weaknesses

1. **Limited Comparison**: There are many efficient diffusion distillation methods, e.g., consistency distillation [1,2], consistent trajectory model [3], distribution matching distillation [4], adversarial approaches [5,6] (which also distilled using model trained with rectified flow). However, the paper has not been compared with any of those, which makes the comparison incomplete. In order to describe the technical advantage of using lightweight refiner, the author should compare with full fine-tuning (i.e., distillation) or with parameter efficient fine-tuning, e.g., LoRA. Thus, Table 2 should be filled with various baselines in order to precisely state ‘comparison with the state-of-the-arts’. 2. **Complexity of implementation**: In addition, while the method seems sound, the method is somewhat complicated to use all Heun’s method, corrector step, etc. This might be an obstacle to scale this method to a large-scale. **References**\ [1] Song, Yang, et al. "Consistency models." arXiv preprint arXiv:2303.01469 (2023). \ [2] Song, Yang, and Prafulla Dhariwal. "Improved techniques for training consistency models." arXiv preprint arXiv:2310.14189 (2023).\ [3] Kim, Dongjun, et al. "Consistency trajectory models: Learning probability flow ode trajectory of diffusion." arXiv preprint arXiv:2310.02279 (2023).\ [4] Yin, Tianwei, et al. "One-step diffusion with distribution matching distillation." Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition. 2024.\ [5] Sauer, Axel, et al. "Adversarial diffusion distillation." arXiv preprint arXiv:2311.17042 (2023).\ [6] Sauer, Axel, et al. "Fast high-resolution image synthesis with latent adversarial diffusion distillation." arXiv preprint arXiv:2403.12015 (2024).

Questions

My major concern is that the paper considers improving the sampling efficiency of flow-based models which is good, but lacks comparison with other fast-sampling diffusion models. Given the theoretical or practical similarities between diffusion models and flow matching models, I believe the previous methods can be also applied to flow matching models. In that sense, there is a large gap in terms of performance, as previous works can sample within only 2-4 steps, e.g., consistency models. In order to elaborate the author’s claim that the velocity refiner is efficient and as good as those methods, the author should provide some additional comparison with those methods.

Rating

5

Confidence

4

Soundness

2

Presentation

2

Contribution

2

Limitations

The authors mentioned some limitations that those method could not be used for diffusion models, yet it could be in a better version if they demonstrate with detailed analysis.

Reviewer RYd72024-08-10

Thanks for this detailed response from the authors. This rebuttal indeed answers many of my questions. Although I still think introducing three types of blocks in a specific order is not the best solution for speeding up, the authors demonstrate its potential, such as in combination with other advanced methods or applying to more advanced models. So, I will raise my score acoordingly.

Authorsrebuttal2024-08-10

Thanks for raising your score and providing valuable feedback

Thanks for raising your score and providing valuable feedback. We are glad to know that most of your concerns have been resolved. Regarding the design of our method such as the types of sampling blocks, we will provide more detailed discussions and analyses through both visualizations and experiments (as we have shown in the rebuttal) in the revised paper.

Reviewer yH4R2024-08-11

Thank you for the rebuttal. It is interesting that the proposed method does not applies to diffusion model, even when changed to velocity prediction. So if we want to apply FlowTurbo for pretrained diffusion model, we have to change to flow-based model as InstaFlow did, and then apply FlowTurbo. Elaborating on this point would make the paper more valuable. I appreciate the authors' efforts on new experimental results for recent SOTA flow-based models. Most of my concerns were resolved and I update my rating to 5.

Authorsrebuttal2024-08-11

Thanks for raising your score and providing valuable feedback

We are glad to know that most of your concerns have been resolved. FlowTurbo is motivated by the visualization of the sampling trajectory (Figure 1), and leverages the unique property of flow-based models which have $v_t$ as a ''stable value''. As for applying FlowTurbo for pretrained diffusion models, we think the core idea is to perform some invertible transformation $f$ of the intermediate results $x_t$ such that $f(x_t)$ is a ''stable value'', and learn a lightweight refiner to regress the offset of $f(x_t)$. We will leave this for future work to make our FlowTurbo a more general framework for the acceleration of both diffusion and flow-based models.

Reviewer PyDm2024-08-11

Response to the rebuttal

Dear authors, Thank you for your time and valuable additional clarifications in the rebuttal. I will keep my original positive rating. Best regards, Reviewer

Authorsrebuttal2024-08-12

Thanks for your time and postive feedback

We greatly appreciate your response and valuable suggestions, which would improve the quality and comprehensiveness of our paper. We will update our paper accordingly in the revision.

Reviewer Q4Pt2024-08-12

Thanks the authors for providing the detailed rebuttal and response to my questions. I will maintain my score.

Authorsrebuttal2024-08-13

Thanks for your time and postive feedback

We greatly appreciate your response and valuable suggestions, which will improve the quality and impact of our paper. We will incorporate your feedback and update our paper accordingly in the revision.

Program Chairsdecision2024-09-25

Decision

Accept (poster)

© 2026 NYSGPT2525 LLC