{"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/inf-dit-upsampling-any-resolution-image-with","title":"Inf-DiT: Upsampling Any-Resolution Image with Memory-Efficient Diffusion Transformer","arxiv_id":"2405.04312","date":"2024-05-07","proceeding":null,"authors":["Zhuoyi Yang","Heyang Jiang","Wenyi Hong","Jiayan Teng","Wendi Zheng","Yuxiao Dong","Ming Ding","Jie Tang"],"abstract":"Diffusion models have shown remarkable performance in image generation in recent years. However, due to a quadratic increase in memory during generating ultra-high-resolution images (e.g. 4096*4096), the resolution of generated images is often limited to 1024*1024. In this work. we propose a unidirectional block attention mechanism that can adaptively adjust the memory overhead during the inference process and handle global dependencies. Building on this module, we adopt the DiT structure for upsampling and develop an infinite super-resolution model capable of upsampling images of various shapes and resolutions. Comprehensive experiments show that our model achieves SOTA performance in generating ultra-high-resolution images in both machine and human evaluation. Compared to commonly used UNet structures, our model can save more than 5x memory when generating 4096*4096 images. The project URL is https://github.com/THUDM/Inf-DiT.","url_abs":"https://arxiv.org/abs/2405.04312v2","url_pdf":"https://arxiv.org/pdf/2405.04312v2.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":"inf-dit-upsampling-any-resolution-image-with","repo_url":"https://github.com/thudm/inf-dit","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"},{"task_slug":"super-resolution","task_name":"Super-Resolution"}],"methods":[],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2405.04312","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2405.04312"}},"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/thudm/inf-dit","reach":{"status":"ok","spdx":"Apache-2.0"}}],"summary":{"ran":10,"ran_violates":3,"ran_fixture":1,"ran_honours":1,"ran_draft_wrong":2,"unverified":2},"by_repo_kind":{"official":{"samples":19,"ran":17,"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":"38208ce0e3a67cb8","entry":"calculate_weights_indices","repo":"thudm/inf-dit","repo_kind":"official","path":"dit/image_degradation.py","file_url":"https://github.com/thudm/inf-dit/blob/HEAD/dit/image_degradation.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"38208ce0e3a67cb8"}},{"code_sha256_prefix":"cf8b0785f1ca3da5","entry":"cubic","repo":"thudm/inf-dit","repo_kind":"official","path":"dit/image_degradation.py","file_url":"https://github.com/thudm/inf-dit/blob/HEAD/dit/image_degradation.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"cf8b0785f1ca3da5"}},{"code_sha256_prefix":"6060d8e21163df8b","entry":"dct","repo":"thudm/inf-dit","repo_kind":"official","path":"dit/torch_dct.py","file_url":"https://github.com/thudm/inf-dit/blob/HEAD/dit/torch_dct.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"6060d8e21163df8b"}},{"code_sha256_prefix":"424012cb37b31172","entry":"default","repo":"thudm/inf-dit","repo_kind":"official","path":"dit/unet/attention.py","file_url":"https://github.com/thudm/inf-dit/blob/HEAD/dit/unet/attention.py","link_basis":"harvester_set","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":"424012cb37b31172"}},{"code_sha256_prefix":"4cb732f513d69dfd","entry":"disabled_train","repo":"thudm/inf-dit","repo_kind":"official","path":"dit/model.py","file_url":"https://github.com/thudm/inf-dit/blob/HEAD/dit/model.py","link_basis":"harvester_set","language":"python","status":"ran_violates","verification_level":1,"contract_check":"VIOLATES","metamorphic_tier":"deterministic","behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"4cb732f513d69dfd"}},{"code_sha256_prefix":"aa5486a3650902d8","entry":"exists","repo":"thudm/inf-dit","repo_kind":"official","path":"dit/unet/attention.py","file_url":"https://github.com/thudm/inf-dit/blob/HEAD/dit/unet/attention.py","link_basis":"harvester_set","language":"python","status":"ran_violates","verification_level":1,"contract_check":"VIOLATES","metamorphic_tier":"deterministic","behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"aa5486a3650902d8"}},{"code_sha256_prefix":"e5947aba1d10885f","entry":"get_1d_sincos_pos_embed_from_grid","repo":"thudm/inf-dit","repo_kind":"official","path":"dit/embeddings.py","file_url":"https://github.com/thudm/inf-dit/blob/HEAD/dit/embeddings.py","link_basis":"harvester_set","language":"python","status":"ran_fixture","verification_level":1,"contract_check":"RAISES","metamorphic_tier":"invariant","behaviour_fingerprint":true,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"e5947aba1d10885f"}},{"code_sha256_prefix":"c92c27c924b517e8","entry":"get_2d_sincos_pos_embed","repo":"thudm/inf-dit","repo_kind":"official","path":"dit/embeddings.py","file_url":"https://github.com/thudm/inf-dit/blob/HEAD/dit/embeddings.py","link_basis":"harvester_set","language":"python","status":"ran_honours","verification_level":1,"contract_check":"HONOURS","metamorphic_tier":"well_formed","behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"c92c27c924b517e8"}},{"code_sha256_prefix":"03310bba324ae4fb","entry":"modulate","repo":"thudm/inf-dit","repo_kind":"official","path":"dit/model.py","file_url":"https://github.com/thudm/inf-dit/blob/HEAD/dit/model.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":"03310bba324ae4fb"}},{"code_sha256_prefix":"245bff2d5744c476","entry":"np_centercrop","repo":"thudm/inf-dit","repo_kind":"official","path":"dit/data.py","file_url":"https://github.com/thudm/inf-dit/blob/HEAD/dit/data.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"245bff2d5744c476"}},{"code_sha256_prefix":"6949028112cefc2e","entry":"pil_resize","repo":"thudm/inf-dit","repo_kind":"official","path":"dit/data.py","file_url":"https://github.com/thudm/inf-dit/blob/HEAD/dit/data.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"6949028112cefc2e"}},{"code_sha256_prefix":"1516958b94bcff00","entry":"pil_to_np","repo":"thudm/inf-dit","repo_kind":"official","path":"dit/data.py","file_url":"https://github.com/thudm/inf-dit/blob/HEAD/dit/data.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"1516958b94bcff00"}},{"code_sha256_prefix":"97992bb749230270","entry":"re_arrange","repo":"thudm/inf-dit","repo_kind":"official","path":"dit/torch_dct.py","file_url":"https://github.com/thudm/inf-dit/blob/HEAD/dit/torch_dct.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"97992bb749230270"}},{"code_sha256_prefix":"298f40d70a5d2ee4","entry":"recover","repo":"thudm/inf-dit","repo_kind":"official","path":"dit/torch_dct.py","file_url":"https://github.com/thudm/inf-dit/blob/HEAD/dit/torch_dct.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"298f40d70a5d2ee4"}},{"code_sha256_prefix":"9aa26711dc747d66","entry":"uint2single","repo":"thudm/inf-dit","repo_kind":"official","path":"dit/image_degradation.py","file_url":"https://github.com/thudm/inf-dit/blob/HEAD/dit/image_degradation.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"9aa26711dc747d66"}},{"code_sha256_prefix":"9a299fe5ae09e407","entry":"uniq","repo":"thudm/inf-dit","repo_kind":"official","path":"dit/unet/attention.py","file_url":"https://github.com/thudm/inf-dit/blob/HEAD/dit/unet/attention.py","link_basis":"harvester_set","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"MISDECLARED","metamorphic_tier":"deterministic","behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"9a299fe5ae09e407"}},{"code_sha256_prefix":"f7164d319c0fe4db","entry":"unpatchify","repo":"thudm/inf-dit","repo_kind":"official","path":"dit/model.py","file_url":"https://github.com/thudm/inf-dit/blob/HEAD/dit/model.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"f7164d319c0fe4db"}},{"code_sha256_prefix":"665d8a4e8f673a4c","entry":"get_2d_sincos_pos_embed_from_grid","repo":"thudm/inf-dit","repo_kind":"official","path":"dit/embeddings.py","file_url":"https://github.com/thudm/inf-dit/blob/HEAD/dit/embeddings.py","link_basis":"harvester_set","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":"665d8a4e8f673a4c"}},{"code_sha256_prefix":"18a7bc816b7a3c8f","entry":"imfrombytes","repo":"thudm/inf-dit","repo_kind":"official","path":"dit/realesr.py","file_url":"https://github.com/thudm/inf-dit/blob/HEAD/dit/realesr.py","link_basis":"harvester_set","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":"18a7bc816b7a3c8f"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}