{"about":{"site":"https://codewithpapers.app","non_affiliation":"Code with Papers and Syntology are not affiliated with, endorsed by, or sponsored by Papers with Code, Meta, or the pwc-archive mirror.","licence":"CC BY-SA 4.0","licence_url":"https://creativecommons.org/licenses/by-sa/4.0/legalcode","attribution":"https://codewithpapers.app/attribution","modified":"archive material modified by Syntology; see the attribution page"},"url":"/paper/flowturbo-towards-real-time-flow-based-image","title":"FlowTurbo: Towards Real-time Flow-Based Image Generation with Velocity Refiner","arxiv_id":"2409.18128","date":"2024-09-26","proceeding":null,"authors":["Wenliang Zhao","Minglei Shi","Xumin Yu","Jie zhou","Jiwen Lu"],"abstract":"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.","url_abs":"https://arxiv.org/abs/2409.18128v1","url_pdf":"https://arxiv.org/pdf/2409.18128v1.pdf","source":{"archive":"pwc-archive (Hugging Face), CC BY-SA 4.0","snapshot":"2025-07-28","licence_url":"https://creativecommons.org/licenses/by-sa/4.0/legalcode","row_kind":"abstracts"},"code_links":[{"paper_slug":"flowturbo-towards-real-time-flow-based-image","repo_url":"https://github.com/shiml20/flowturbo","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok","spdx":"MIT"}}],"tasks":[{"task_slug":"image-generation","task_name":"Image Generation"},{"task_slug":"text-to-image-generation-1","task_name":"Text to Image Generation"},{"task_slug":"text-to-image-generation","task_name":"Text-to-Image Generation"}],"methods":[{"method_slug":"diffusion","method_name":"Diffusion"}],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2409.18128","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2409.18128"}},"developers":"https://syntology.ai/developers","read_at":"2026-09-24T18:15:14+00:00","read_at_is":"when the build read Syntology's graph, not when any sample ran","claim":"Per-sample execution status on synthesized fixtures; not a correctness claim about the paper. Samples come from repositories linked to the paper, official or community; repo_kind says which.","repos":[{"provenance":"deterministic:regex_extraction","url":"https://github.com/shiml20/FlowTurbo","reach":{"status":"ok","spdx":"MIT"}},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/shiml20/flowturbo","reach":{"status":"ok","spdx":"MIT"}}],"summary":{"ran_draft_wrong":3,"ran_honours":1,"ran":2,"unverified":5},"by_repo_kind":{"official":{"samples":11,"ran":6,"repositories":1}},"repo_kind_vocabulary":{"official":"The archive marks this repository official for the paper","named_in_paper":"The archive records that the paper mentions this repository; it is not marked official","listed":"In the archive's code links for this paper, not marked official and not recorded as mentioned in the paper","found_in_text":"Syntology found this repository in the paper's own text; whether it is the authors' implementation is not asserted","community":"Not in the archive's code links for this paper; a community repository Syntology harvested"},"n_pointer_only_for_licence":0,"samples":[{"code_sha256_prefix":"6de57ffd4ee7fee7","entry":"expand_t_like_x","repo":"shiml20/FlowTurbo","repo_kind":"official","path":"transport/path.py","file_url":"https://github.com/shiml20/FlowTurbo/blob/HEAD/transport/path.py","link_basis":"harvester_set","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"MISDECLARED","metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"6de57ffd4ee7fee7"}},{"code_sha256_prefix":"c92c27c924b517e8","entry":"get_2d_sincos_pos_embed","repo":"shiml20/FlowTurbo","repo_kind":"official","path":"models_assemble.py","file_url":"https://github.com/shiml20/FlowTurbo/blob/HEAD/models_assemble.py","link_basis":"harvester_set","language":"python","status":"ran_honours","verification_level":1,"contract_check":"HONOURS","metamorphic_tier":"well_formed","behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"c92c27c924b517e8"}},{"code_sha256_prefix":"e0c9eec71fe93415","entry":"log_state","repo":"shiml20/FlowTurbo","repo_kind":"official","path":"transport/utils.py","file_url":"https://github.com/shiml20/FlowTurbo/blob/HEAD/transport/utils.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"e0c9eec71fe93415"}},{"code_sha256_prefix":"b883daa24762cb05","entry":"mean_flat","repo":"shiml20/FlowTurbo","repo_kind":"official","path":"transport/utils.py","file_url":"https://github.com/shiml20/FlowTurbo/blob/HEAD/transport/utils.py","link_basis":"plan_row","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"MISDECLARED","metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"b883daa24762cb05"}},{"code_sha256_prefix":"03310bba324ae4fb","entry":"modulate","repo":"shiml20/FlowTurbo","repo_kind":"official","path":"models_assemble.py","file_url":"https://github.com/shiml20/FlowTurbo/blob/HEAD/models_assemble.py","link_basis":"harvester_set","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"MISDECLARED","metamorphic_tier":"invariant","behaviour_fingerprint":true,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"03310bba324ae4fb"}},{"code_sha256_prefix":"93ea18994bb3e8f9","entry":"read_statistics","repo":"shiml20/FlowTurbo","repo_kind":"official","path":"evaluation/fid.py","file_url":"https://github.com/shiml20/FlowTurbo/blob/HEAD/evaluation/fid.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"93ea18994bb3e8f9"}},{"code_sha256_prefix":"fa92e506df16d054","entry":"create_npz_from_sample_folder","repo":"shiml20/FlowTurbo","repo_kind":"official","path":"sample_ddp_feature.py","file_url":"https://github.com/shiml20/FlowTurbo/blob/HEAD/sample_ddp_feature.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"fa92e506df16d054"}},{"code_sha256_prefix":"bea8b7f1f4c6354b","entry":"download_model","repo":"shiml20/FlowTurbo","repo_kind":"official","path":"download.py","file_url":"https://github.com/shiml20/FlowTurbo/blob/HEAD/download.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"bea8b7f1f4c6354b"}},{"code_sha256_prefix":"f53716a25095cc3c","entry":"find_model","repo":"shiml20/FlowTurbo","repo_kind":"official","path":"download.py","file_url":"https://github.com/shiml20/FlowTurbo/blob/HEAD/download.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"f53716a25095cc3c"}},{"code_sha256_prefix":"665d8a4e8f673a4c","entry":"get_2d_sincos_pos_embed_from_grid","repo":"shiml20/FlowTurbo","repo_kind":"official","path":"models_assemble.py","file_url":"https://github.com/shiml20/FlowTurbo/blob/HEAD/models_assemble.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"665d8a4e8f673a4c"}},{"code_sha256_prefix":"2fc6fdb85f13dc41","entry":"none_or_str","repo":"shiml20/FlowTurbo","repo_kind":"official","path":"train_utils.py","file_url":"https://github.com/shiml20/FlowTurbo/blob/HEAD/train_utils.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"2fc6fdb85f13dc41"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}