{"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/flow-anchored-consistency-models","title":"Flow-Anchored Consistency Models","arxiv_id":"2507.03738","date":"2025-07-04","proceeding":null,"authors":["Yansong Peng","Kai Zhu","Yu Liu","Pingyu Wu","Hebei Li","Xiaoyan Sun","Feng Wu"],"abstract":"Continuous-time Consistency Models (CMs) promise efficient few-step generation but face significant challenges with training instability. We argue this instability stems from a fundamental conflict: by training a network to learn only a shortcut across a probability flow, the model loses its grasp on the instantaneous velocity field that defines the flow. Our solution is to explicitly anchor the model in the underlying flow during training. We introduce the Flow-Anchored Consistency Model (FACM), a simple but effective training strategy that uses a Flow Matching (FM) task as an anchor for the primary CM shortcut objective. This Flow-Anchoring approach requires no architectural modifications and is broadly compatible with standard model architectures. By distilling a pre-trained LightningDiT model, our method achieves a state-of-the-art FID of 1.32 with two steps (NFE=2) and 1.76 with just one step (NFE=1) on ImageNet 256x256, significantly outperforming previous methods. This provides a general and effective recipe for building high-performance, few-step generative models. Our code and pretrained models: https://github.com/ali-vilab/FACM.","url_abs":"https://arxiv.org/abs/2507.03738v1","url_pdf":"https://arxiv.org/pdf/2507.03738v1.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":"flow-anchored-consistency-models","repo_url":"https://github.com/ali-vilab/FACM","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok","spdx":"Apache-2.0"}}],"tasks":[{"task_slug":"image-generation","task_name":"Image Generation"}],"methods":[{"method_slug":"cm","method_name":"Consistency Models"}],"datasets_introduced":[],"methods_introduced":[],"results":[{"leaderboard":"/sota/image-generation-on-imagenet-256x256","task":"Image Generation","dataset":"ImageNet 256x256","model":"FACM (2-step)","rank_in_archive_order":10,"of":94,"metrics":{"FID":"1.32","NFE":"2"},"uses_additional_data":false},{"leaderboard":"/sota/image-generation-on-imagenet-256x256","task":"Image Generation","dataset":"ImageNet 256x256","model":"FACM (1-step)","rank_in_archive_order":32,"of":94,"metrics":{"FID":"1.70","NFE":"1"},"uses_additional_data":false}],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2507.03738","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2507.03738"}},"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":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/ali-vilab/FACM","reach":{"status":"ok","spdx":"Apache-2.0"}}],"summary":{"ran_draft_wrong":4,"ran_fixture":2,"ran_honours":1,"ran_violates":1,"unverified":6},"by_repo_kind":{"official":{"samples":14,"ran":8,"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":"9fcdaa6e423e8aa7","entry":"Normalize","repo":"ali-vilab/FACM","repo_kind":"official","path":"ldit/autoencoder.py","file_url":"https://github.com/ali-vilab/FACM/blob/HEAD/ldit/autoencoder.py","link_basis":"harvester_set","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"OUTPUT_MISDECLARED","metamorphic_tier":"deterministic","behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"9fcdaa6e423e8aa7"}},{"code_sha256_prefix":"d7b6dcfe63bfe59b","entry":"apply_rotary_emb","repo":"ali-vilab/FACM","repo_kind":"official","path":"ldit/rmsnorm.py","file_url":"https://github.com/ali-vilab/FACM/blob/HEAD/ldit/rmsnorm.py","link_basis":"plan_row","language":"python","status":"ran_fixture","verification_level":1,"contract_check":"RAISES","metamorphic_tier":"invariant","behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"d7b6dcfe63bfe59b"}},{"code_sha256_prefix":"f50a8d20efb35c68","entry":"broadcat","repo":"ali-vilab/FACM","repo_kind":"official","path":"ldit/pos_embed.py","file_url":"https://github.com/ali-vilab/FACM/blob/HEAD/ldit/pos_embed.py","link_basis":"plan_row","language":"python","status":"ran_honours","verification_level":1,"contract_check":"HONOURS","metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"f50a8d20efb35c68"}},{"code_sha256_prefix":"1712a07966b542ee","entry":"center_crop_arr","repo":"ali-vilab/FACM","repo_kind":"official","path":"ldit/autoencoder.py","file_url":"https://github.com/ali-vilab/FACM/blob/HEAD/ldit/autoencoder.py","link_basis":"plan_row","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"MISDECLARED","metamorphic_tier":"well_formed","behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"1712a07966b542ee"}},{"code_sha256_prefix":"3137073275f8c21a","entry":"nonlinearity","repo":"ali-vilab/FACM","repo_kind":"official","path":"ldit/autoencoder.py","file_url":"https://github.com/ali-vilab/FACM/blob/HEAD/ldit/autoencoder.py","link_basis":"harvester_set","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"MISDECLARED","metamorphic_tier":"invariant","behaviour_fingerprint":true,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"3137073275f8c21a"}},{"code_sha256_prefix":"04a1fa63d6d4b8e4","entry":"precompute_freqs_cis","repo":"ali-vilab/FACM","repo_kind":"official","path":"ldit/rmsnorm.py","file_url":"https://github.com/ali-vilab/FACM/blob/HEAD/ldit/rmsnorm.py","link_basis":"plan_row","language":"python","status":"ran_violates","verification_level":1,"contract_check":"VIOLATES","metamorphic_tier":"well_formed","behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"04a1fa63d6d4b8e4"}},{"code_sha256_prefix":"5a639d78ada17fee","entry":"reshape_for_broadcast","repo":"ali-vilab/FACM","repo_kind":"official","path":"ldit/rmsnorm.py","file_url":"https://github.com/ali-vilab/FACM/blob/HEAD/ldit/rmsnorm.py","link_basis":"plan_row","language":"python","status":"ran_fixture","verification_level":1,"contract_check":"RAISES","metamorphic_tier":"invariant","behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"5a639d78ada17fee"}},{"code_sha256_prefix":"58823d9435a8751b","entry":"rotate_half","repo":"ali-vilab/FACM","repo_kind":"official","path":"ldit/pos_embed.py","file_url":"https://github.com/ali-vilab/FACM/blob/HEAD/ldit/pos_embed.py","link_basis":"plan_row","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"MISDECLARED","metamorphic_tier":"invariant","behaviour_fingerprint":true,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"58823d9435a8751b"}},{"code_sha256_prefix":"d7165e1d0b3125c8","entry":"apply_classifier_free_guidance","repo":"ali-vilab/FACM","repo_kind":"official","path":"sampler.py","file_url":"https://github.com/ali-vilab/FACM/blob/HEAD/sampler.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"d7165e1d0b3125c8"}},{"code_sha256_prefix":"b23287fcefddccc7","entry":"apply_timestep_shift","repo":"ali-vilab/FACM","repo_kind":"official","path":"sampler.py","file_url":"https://github.com/ali-vilab/FACM/blob/HEAD/sampler.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"b23287fcefddccc7"}},{"code_sha256_prefix":"12924cbdbc48113b","entry":"modulate","repo":"ali-vilab/FACM","repo_kind":"official","path":"ldit/lightningdit.py","file_url":"https://github.com/ali-vilab/FACM/blob/HEAD/ldit/lightningdit.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"12924cbdbc48113b"}},{"code_sha256_prefix":"4ffded33c11b4d7f","entry":"pixel_norm","repo":"ali-vilab/FACM","repo_kind":"official","path":"ldit/lightningdit.py","file_url":"https://github.com/ali-vilab/FACM/blob/HEAD/ldit/lightningdit.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"4ffded33c11b4d7f"}},{"code_sha256_prefix":"3a089f03249495cb","entry":"prepare_model_input","repo":"ali-vilab/FACM","repo_kind":"official","path":"sampler.py","file_url":"https://github.com/ali-vilab/FACM/blob/HEAD/sampler.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"3a089f03249495cb"}},{"code_sha256_prefix":"ff2d71bfa2bbd54d","entry":"scm_modulate","repo":"ali-vilab/FACM","repo_kind":"official","path":"ldit/lightningdit.py","file_url":"https://github.com/ali-vilab/FACM/blob/HEAD/ldit/lightningdit.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"ff2d71bfa2bbd54d"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}