{"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/arxiv-2604-12668","title":"OFA-Diffusion Compression: Compressing Diffusion Model in One-Shot Manner","arxiv_id":"2604.12668","date":"2026-04-14","proceeding":null,"authors":["Haoyang Jiang","Zekun Wang","Mingyang Yi","Xiuyu Li","Lanqing Hu","Junxian Cai","Qingbin Liu","Xi Chen","Ju Fan"],"abstract":"The Diffusion Probabilistic Model (DPM) achieves remarkable performance in image generation, while its increasing parameter size and computational overhead hinder its deployment in practical applications. To improve this, the existing literature focuses on obtaining a smaller model with a fixed architecture through model compression. However, in practice, DPMs usually need to be deployed on various devices with different resource constraints, which leads to multiple compression processes, incurring significant overhead for repeated training. To obviate this, we propose a once-for-all (OFA) compression framework for DPMs that yields different subnetworks with various computations in a one-shot training manner. The existing OFA framework typically involves massive subnetworks with different parameter sizes, while such a huge candidate space slows the optimization. Thus, we propose to restrict the candidate subnetworks with a certain set of parameter sizes, where each size corresponds to a specific subnetwork. Specifically, to construct each subnetwork with a given size, we gradually allocate the maintained channels by their importance. Furthermore, we propose a reweighting strategy to balance the optimization process of different subnetworks. Experimental results show that our approach can produce compressed DPMs for various sizes with significantly lower training overhead while achieving satisfactory performance.","url_abs":"https://arxiv.org/abs/2604.12668","url_pdf":"https://arxiv.org/pdf/2604.12668","source":{"archive":null,"snapshot":"2025-07-28","note":"not in the Papers with Code archive (frozen at the snapshot)","row_kind":"graph","title_abstract_authors_date":"arXiv metadata, CC0 1.0 (https://info.arxiv.org/help/license)"},"code_links":[],"tasks":[],"methods":[],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"syntology_url":"https://syntology.ai/paper/2604.12668","atlas_url":"https://app.syntology.ai/?focus=2604.12668","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2604.12668"}},"developers":"https://syntology.ai/developers","read_at":"2026-09-25T09:33:49+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":[{"mentioned_in_github":null,"is_official":null,"provenance":"deterministic:regex_extraction","mentioned_in_paper":null,"url":"https://github.com/atrijhy/OFA-Diffusion_Compression","reach":null}],"summary":{"ran":9,"ran_fixture":1},"by_repo_kind":{"found_in_text":{"samples":10,"ran":10,"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":10,"samples":[{"code_sha256_prefix":"a63ca559f9e89ac2","entry":"build_subnet_cfg_from_masks","repo":"atrijhy/OFA-Diffusion_Compression","repo_kind":"found_in_text","path":"sd/networks_ofa.py","file_url":"https://github.com/atrijhy/OFA-Diffusion_Compression/blob/HEAD/sd/networks_ofa.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":"a63ca559f9e89ac2"}},{"code_sha256_prefix":"b586946bdf35fdd2","entry":"build_subnet_cfgs","repo":"atrijhy/OFA-Diffusion_Compression","repo_kind":"found_in_text","path":"uvit/train_ofa.py","file_url":"https://github.com/atrijhy/OFA-Diffusion_Compression/blob/HEAD/uvit/train_ofa.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":"b586946bdf35fdd2"}},{"code_sha256_prefix":"ffb5e3f9fdba1308","entry":"collate_fn","repo":"atrijhy/OFA-Diffusion_Compression","repo_kind":"found_in_text","path":"sd/train_ofa.py","file_url":"https://github.com/atrijhy/OFA-Diffusion_Compression/blob/HEAD/sd/train_ofa.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":"ffb5e3f9fdba1308"}},{"code_sha256_prefix":"1456f650ca808675","entry":"encode_images","repo":"atrijhy/OFA-Diffusion_Compression","repo_kind":"found_in_text","path":"sd/train_ofa.py","file_url":"https://github.com/atrijhy/OFA-Diffusion_Compression/blob/HEAD/sd/train_ofa.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":"1456f650ca808675"}},{"code_sha256_prefix":"8ee0a711cba8a0c8","entry":"encode_text","repo":"atrijhy/OFA-Diffusion_Compression","repo_kind":"found_in_text","path":"sd/train_ofa.py","file_url":"https://github.com/atrijhy/OFA-Diffusion_Compression/blob/HEAD/sd/train_ofa.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":"8ee0a711cba8a0c8"}},{"code_sha256_prefix":"f518a3419df229cc","entry":"get_smallest_subnet_cfg","repo":"atrijhy/OFA-Diffusion_Compression","repo_kind":"found_in_text","path":"sd/networks_ofa.py","file_url":"https://github.com/atrijhy/OFA-Diffusion_Compression/blob/HEAD/sd/networks_ofa.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":"f518a3419df229cc"}},{"code_sha256_prefix":"5addcff73a5c807d","entry":"parse_int_list","repo":"atrijhy/OFA-Diffusion_Compression","repo_kind":"found_in_text","path":"edm/train_ofa.py","file_url":"https://github.com/atrijhy/OFA-Diffusion_Compression/blob/HEAD/edm/train_ofa.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":"5addcff73a5c807d"}},{"code_sha256_prefix":"93f9e3bb78af1aa2","entry":"parse_int_list","repo":"atrijhy/OFA-Diffusion_Compression","repo_kind":"found_in_text","path":"edm/generate.py","file_url":"https://github.com/atrijhy/OFA-Diffusion_Compression/blob/HEAD/edm/generate.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":"93f9e3bb78af1aa2"}},{"code_sha256_prefix":"827ca7602b3406f9","entry":"sample_random_subnet_cfg","repo":"atrijhy/OFA-Diffusion_Compression","repo_kind":"found_in_text","path":"sd/networks_ofa.py","file_url":"https://github.com/atrijhy/OFA-Diffusion_Compression/blob/HEAD/sd/networks_ofa.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":"827ca7602b3406f9"}},{"code_sha256_prefix":"d41a4250066bce93","entry":"weight_init","repo":"atrijhy/OFA-Diffusion_Compression","repo_kind":"found_in_text","path":"edm/networks_ofa.py","file_url":"https://github.com/atrijhy/OFA-Diffusion_Compression/blob/HEAD/edm/networks_ofa.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"}}]},"arxiv_metadata":{"licence":"arXiv metadata, CC0 1.0 (https://info.arxiv.org/help/license)","fields":["title","abstract","authors","date"],"primary_category":"cs.CV","source":"arxiv_2026.jsonl"},"syntology_extracted_results":null}