{"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/unlimited-size-diffusion-restoration","title":"Unlimited-Size Diffusion Restoration","arxiv_id":"2303.00354","date":"2023-03-01","proceeding":null,"authors":["Yinhuai Wang","Jiwen Yu","Runyi Yu","Jian Zhang"],"abstract":"Recently, using diffusion models for zero-shot image restoration (IR) has become a new hot paradigm. This type of method only needs to use the pre-trained off-the-shelf diffusion models, without any finetuning, and can directly handle various IR tasks. The upper limit of the restoration performance depends on the pre-trained diffusion models, which are in rapid evolution. However, current methods only discuss how to deal with fixed-size images, but dealing with images of arbitrary sizes is very important for practical applications. This paper focuses on how to use those diffusion-based zero-shot IR methods to deal with any size while maintaining the excellent characteristics of zero-shot. A simple way to solve arbitrary size is to divide it into fixed-size patches and solve each patch independently. But this may yield significant artifacts since it neither considers the global semantics of all patches nor the local information of adjacent patches. Inspired by the Range-Null space Decomposition, we propose the Mask-Shift Restoration to address local incoherence and propose the Hierarchical Restoration to alleviate out-of-domain issues. Our simple, parameter-free approaches can be used not only for image restoration but also for image generation of unlimited sizes, with the potential to be a general tool for diffusion models. Code: https://github.com/wyhuai/DDNM/tree/main/hq_demo","url_abs":"https://arxiv.org/abs/2303.00354v1","url_pdf":"https://arxiv.org/pdf/2303.00354v1.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":"unlimited-size-diffusion-restoration","repo_url":"https://github.com/wyhuai/ddnm","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":"image-restoration","task_name":"Image Restoration"}],"methods":[{"method_slug":"diffusion","method_name":"Diffusion"}],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2303.00354","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2303.00354"}},"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/wyhuai/ddnm","reach":{"status":"ok","spdx":"MIT"}}],"summary":{"ran_fixture":2,"ran_draft_wrong":6,"ran":7,"ran_honours":1,"unverified":6},"by_repo_kind":{"official":{"samples":22,"ran":16,"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":"12012b9130641107","entry":"MeanUpsample","repo":"wyhuai/ddnm","repo_kind":"official","path":"guided_diffusion/diffusion.py","file_url":"https://github.com/wyhuai/ddnm/blob/HEAD/guided_diffusion/diffusion.py","link_basis":"harvester_set","language":"python","status":"ran_fixture","verification_level":1,"contract_check":"RAISES","metamorphic_tier":"invariant","behaviour_fingerprint":true,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"12012b9130641107"}},{"code_sha256_prefix":"c3a6b977022957cb","entry":"Normalize","repo":"wyhuai/ddnm","repo_kind":"official","path":"guided_diffusion/models.py","file_url":"https://github.com/wyhuai/ddnm/blob/HEAD/guided_diffusion/models.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":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"c3a6b977022957cb"}},{"code_sha256_prefix":"dd9fc69e1eb813b9","entry":"color2gray","repo":"wyhuai/ddnm","repo_kind":"official","path":"functions/svd_operators.py","file_url":"https://github.com/wyhuai/ddnm/blob/HEAD/functions/svd_operators.py","link_basis":"harvester_set","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"dd9fc69e1eb813b9"}},{"code_sha256_prefix":"af792c258aa85c57","entry":"color2gray","repo":"wyhuai/ddnm","repo_kind":"official","path":"guided_diffusion/diffusion.py","file_url":"https://github.com/wyhuai/ddnm/blob/HEAD/guided_diffusion/diffusion.py","link_basis":"harvester_set","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"af792c258aa85c57"}},{"code_sha256_prefix":"9215fb189fbfb9f4","entry":"compute_alpha","repo":"wyhuai/ddnm","repo_kind":"official","path":"functions/svd_ddnm.py","file_url":"https://github.com/wyhuai/ddnm/blob/HEAD/functions/svd_ddnm.py","link_basis":"harvester_set","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"MISDECLARED","metamorphic_tier":"invariant","behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"9215fb189fbfb9f4"}},{"code_sha256_prefix":"17b8a580da43c920","entry":"get_gaussian_noisy_img","repo":"wyhuai/ddnm","repo_kind":"official","path":"guided_diffusion/diffusion.py","file_url":"https://github.com/wyhuai/ddnm/blob/HEAD/guided_diffusion/diffusion.py","link_basis":"harvester_set","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"17b8a580da43c920"}},{"code_sha256_prefix":"e41367ad14ff58fd","entry":"get_param_groups_and_shapes","repo":"wyhuai/ddnm","repo_kind":"official","path":"guided_diffusion/fp16_util.py","file_url":"https://github.com/wyhuai/ddnm/blob/HEAD/guided_diffusion/fp16_util.py","link_basis":"harvester_set","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":"e41367ad14ff58fd"}},{"code_sha256_prefix":"cb49209c125de1b4","entry":"get_timestep_embedding","repo":"wyhuai/ddnm","repo_kind":"official","path":"guided_diffusion/models.py","file_url":"https://github.com/wyhuai/ddnm/blob/HEAD/guided_diffusion/models.py","link_basis":"harvester_set","language":"python","status":"ran_fixture","verification_level":1,"contract_check":"RAISES","metamorphic_tier":"invariant","behaviour_fingerprint":true,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"cb49209c125de1b4"}},{"code_sha256_prefix":"6d117fa2c3ad8438","entry":"gray2color","repo":"wyhuai/ddnm","repo_kind":"official","path":"functions/svd_operators.py","file_url":"https://github.com/wyhuai/ddnm/blob/HEAD/functions/svd_operators.py","link_basis":"harvester_set","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"6d117fa2c3ad8438"}},{"code_sha256_prefix":"915e1c6c38494be9","entry":"list_dir","repo":"wyhuai/ddnm","repo_kind":"official","path":"datasets/utils.py","file_url":"https://github.com/wyhuai/ddnm/blob/HEAD/datasets/utils.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":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"915e1c6c38494be9"}},{"code_sha256_prefix":"208e196e9582a9a6","entry":"list_files","repo":"wyhuai/ddnm","repo_kind":"official","path":"datasets/utils.py","file_url":"https://github.com/wyhuai/ddnm/blob/HEAD/datasets/utils.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":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"208e196e9582a9a6"}},{"code_sha256_prefix":"e20dd5102da3b050","entry":"make_master_params","repo":"wyhuai/ddnm","repo_kind":"official","path":"guided_diffusion/fp16_util.py","file_url":"https://github.com/wyhuai/ddnm/blob/HEAD/guided_diffusion/fp16_util.py","link_basis":"harvester_set","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":"e20dd5102da3b050"}},{"code_sha256_prefix":"07d90bd6ae1be7db","entry":"md5_hash","repo":"wyhuai/ddnm","repo_kind":"official","path":"functions/ckpt_util.py","file_url":"https://github.com/wyhuai/ddnm/blob/HEAD/functions/ckpt_util.py","link_basis":"harvester_set","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"OUTPUT_MISDECLARED","metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"07d90bd6ae1be7db"}},{"code_sha256_prefix":"3137073275f8c21a","entry":"nonlinearity","repo":"wyhuai/ddnm","repo_kind":"official","path":"guided_diffusion/models.py","file_url":"https://github.com/wyhuai/ddnm/blob/HEAD/guided_diffusion/models.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":"3137073275f8c21a"}},{"code_sha256_prefix":"f321f54723433661","entry":"pil_loader","repo":"wyhuai/ddnm","repo_kind":"official","path":"datasets/imagenet_subset.py","file_url":"https://github.com/wyhuai/ddnm/blob/HEAD/datasets/imagenet_subset.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":"f321f54723433661"}},{"code_sha256_prefix":"64fff1e30802b815","entry":"unflatten_master_params","repo":"wyhuai/ddnm","repo_kind":"official","path":"guided_diffusion/fp16_util.py","file_url":"https://github.com/wyhuai/ddnm/blob/HEAD/guided_diffusion/fp16_util.py","link_basis":"harvester_set","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":"64fff1e30802b815"}},{"code_sha256_prefix":"404fb2b2daa1ae78","entry":"accimage_loader","repo":"wyhuai/ddnm","repo_kind":"official","path":"datasets/imagenet_subset.py","file_url":"https://github.com/wyhuai/ddnm/blob/HEAD/datasets/imagenet_subset.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":"404fb2b2daa1ae78"}},{"code_sha256_prefix":"7345763c9b9300fb","entry":"check_integrity","repo":"wyhuai/ddnm","repo_kind":"official","path":"datasets/utils.py","file_url":"https://github.com/wyhuai/ddnm/blob/HEAD/datasets/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":"7345763c9b9300fb"}},{"code_sha256_prefix":"ad4e0ba376bb7ae7","entry":"ddnm_diffusion","repo":"wyhuai/ddnm","repo_kind":"official","path":"functions/svd_ddnm.py","file_url":"https://github.com/wyhuai/ddnm/blob/HEAD/functions/svd_ddnm.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":"ad4e0ba376bb7ae7"}},{"code_sha256_prefix":"7bf07d5f59aae36d","entry":"default_loader","repo":"wyhuai/ddnm","repo_kind":"official","path":"datasets/imagenet_subset.py","file_url":"https://github.com/wyhuai/ddnm/blob/HEAD/datasets/imagenet_subset.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":"7bf07d5f59aae36d"}},{"code_sha256_prefix":"d80f2146cfc85e9a","entry":"get_ckpt_path","repo":"wyhuai/ddnm","repo_kind":"official","path":"functions/ckpt_util.py","file_url":"https://github.com/wyhuai/ddnm/blob/HEAD/functions/ckpt_util.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":"d80f2146cfc85e9a"}},{"code_sha256_prefix":"39ba407e4342bdd3","entry":"inverse_data_transform","repo":"wyhuai/ddnm","repo_kind":"official","path":"functions/svd_ddnm.py","file_url":"https://github.com/wyhuai/ddnm/blob/HEAD/functions/svd_ddnm.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":"39ba407e4342bdd3"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}