{"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/slimflow-training-smaller-one-step-diffusion","title":"SlimFlow: Training Smaller One-Step Diffusion Models with Rectified Flow","arxiv_id":"2407.12718","date":"2024-07-17","proceeding":null,"authors":["Yuanzhi Zhu","Xingchao Liu","Qiang Liu"],"abstract":"Diffusion models excel in high-quality generation but suffer from slow inference due to iterative sampling. While recent methods have successfully transformed diffusion models into one-step generators, they neglect model size reduction, limiting their applicability in compute-constrained scenarios. This paper aims to develop small, efficient one-step diffusion models based on the powerful rectified flow framework, by exploring joint compression of inference steps and model size. The rectified flow framework trains one-step generative models using two operations, reflow and distillation. Compared with the original framework, squeezing the model size brings two new challenges: (1) the initialization mismatch between large teachers and small students during reflow; (2) the underperformance of naive distillation on small student models. To overcome these issues, we propose Annealing Reflow and Flow-Guided Distillation, which together comprise our SlimFlow framework. With our novel framework, we train a one-step diffusion model with an FID of 5.02 and 15.7M parameters, outperforming the previous state-of-the-art one-step diffusion model (FID=6.47, 19.4M parameters) on CIFAR10. On ImageNet 64$\\times$64 and FFHQ 64$\\times$64, our method yields small one-step diffusion models that are comparable to larger models, showcasing the effectiveness of our method in creating compact, efficient one-step diffusion models.","url_abs":"https://arxiv.org/abs/2407.12718v2","url_pdf":"https://arxiv.org/pdf/2407.12718v2.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":"slimflow-training-smaller-one-step-diffusion","repo_url":"https://github.com/yuanzhi-zhu/SlimFlow","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok"}}],"tasks":[],"methods":[{"method_slug":"diffusion","method_name":"Diffusion"}],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2407.12718","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2407.12718"}},"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/yuanzhi-zhu/SlimFlow","reach":{"status":"ok"}}],"summary":{"ran":2,"ran_fixture":1,"unverified":6},"by_repo_kind":{"official":{"samples":9,"ran":3,"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":9,"samples":[{"code_sha256_prefix":"9797498a8def79a5","entry":"load_tmp_data","repo":"yuanzhi-zhu/SlimFlow","repo_kind":"official","path":"generate_data.py","file_url":"https://github.com/yuanzhi-zhu/SlimFlow/blob/HEAD/generate_data.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"9797498a8def79a5"}},{"code_sha256_prefix":"3ac11bfe0ae80195","entry":"variance_scaling","repo":"yuanzhi-zhu/SlimFlow","repo_kind":"official","path":"models/layers.py","file_url":"https://github.com/yuanzhi-zhu/SlimFlow/blob/HEAD/models/layers.py","link_basis":"harvester_set","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"3ac11bfe0ae80195"}},{"code_sha256_prefix":"d41a4250066bce93","entry":"weight_init","repo":"yuanzhi-zhu/SlimFlow","repo_kind":"official","path":"models/edm_networks.py","file_url":"https://github.com/yuanzhi-zhu/SlimFlow/blob/HEAD/models/edm_networks.py","link_basis":"harvester_set","language":"python","status":"ran_fixture","verification_level":1,"contract_check":"RAISES","metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"d41a4250066bce93"}},{"code_sha256_prefix":"db5f935a1d6b4c2c","entry":"get_act","repo":"yuanzhi-zhu/SlimFlow","repo_kind":"official","path":"models/layers.py","file_url":"https://github.com/yuanzhi-zhu/SlimFlow/blob/HEAD/models/layers.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"db5f935a1d6b4c2c"}},{"code_sha256_prefix":"1b8adb3294e53c6d","entry":"get_normalization","repo":"yuanzhi-zhu/SlimFlow","repo_kind":"official","path":"models/normalization.py","file_url":"https://github.com/yuanzhi-zhu/SlimFlow/blob/HEAD/models/normalization.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"1b8adb3294e53c6d"}},{"code_sha256_prefix":"8db300b9f1afb2d3","entry":"get_weight","repo":"yuanzhi-zhu/SlimFlow","repo_kind":"official","path":"models/up_or_down_sampling.py","file_url":"https://github.com/yuanzhi-zhu/SlimFlow/blob/HEAD/models/up_or_down_sampling.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"8db300b9f1afb2d3"}},{"code_sha256_prefix":"e0ca74cc0ccd0e50","entry":"naive_downsample_2d","repo":"yuanzhi-zhu/SlimFlow","repo_kind":"official","path":"models/up_or_down_sampling.py","file_url":"https://github.com/yuanzhi-zhu/SlimFlow/blob/HEAD/models/up_or_down_sampling.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"e0ca74cc0ccd0e50"}},{"code_sha256_prefix":"f425357463a3de36","entry":"naive_upsample_2d","repo":"yuanzhi-zhu/SlimFlow","repo_kind":"official","path":"models/up_or_down_sampling.py","file_url":"https://github.com/yuanzhi-zhu/SlimFlow/blob/HEAD/models/up_or_down_sampling.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"f425357463a3de36"}},{"code_sha256_prefix":"85b2235eb7afaa4f","entry":"ncsn_conv1x1","repo":"yuanzhi-zhu/SlimFlow","repo_kind":"official","path":"models/layers.py","file_url":"https://github.com/yuanzhi-zhu/SlimFlow/blob/HEAD/models/layers.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"85b2235eb7afaa4f"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}