{"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/diffir-efficient-diffusion-model-for-image","title":"DiffIR: Efficient Diffusion Model for Image Restoration","arxiv_id":"2303.09472","date":"2023-03-16","proceeding":"ICCV 2023 1","authors":["Bin Xia","Yulun Zhang","Shiyin Wang","Yitong Wang","Xinglong Wu","Yapeng Tian","Wenming Yang","Luc van Gool"],"abstract":"Diffusion model (DM) has achieved SOTA performance by modeling the image synthesis process into a sequential application of a denoising network. However, different from image synthesis, image restoration (IR) has a strong constraint to generate results in accordance with ground-truth. Thus, for IR, traditional DMs running massive iterations on a large model to estimate whole images or feature maps is inefficient. To address this issue, we propose an efficient DM for IR (DiffIR), which consists of a compact IR prior extraction network (CPEN), dynamic IR transformer (DIRformer), and denoising network. Specifically, DiffIR has two training stages: pretraining and training DM. In pretraining, we input ground-truth images into CPEN$_{S1}$ to capture a compact IR prior representation (IPR) to guide DIRformer. In the second stage, we train the DM to directly estimate the same IRP as pretrained CPEN$_{S1}$ only using LQ images. We observe that since the IPR is only a compact vector, DiffIR can use fewer iterations than traditional DM to obtain accurate estimations and generate more stable and realistic results. Since the iterations are few, our DiffIR can adopt a joint optimization of CPEN$_{S2}$, DIRformer, and denoising network, which can further reduce the estimation error influence. We conduct extensive experiments on several IR tasks and achieve SOTA performance while consuming less computational costs. Code is available at \\url{https://github.com/Zj-BinXia/DiffIR}.","url_abs":"https://arxiv.org/abs/2303.09472v3","url_pdf":"https://arxiv.org/pdf/2303.09472v3.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":"diffir-efficient-diffusion-model-for-image","repo_url":"https://github.com/zj-binxia/diffir","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok","spdx":"Apache-2.0"}}],"tasks":[{"task_slug":"denoising","task_name":"Denoising"},{"task_slug":"image-generation","task_name":"Image Generation"},{"task_slug":"image-restoration","task_name":"Image Restoration"},{"task_slug":"model","task_name":"model"}],"methods":[],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2303.09472","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2303.09472"}},"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/zj-binxia/diffir","reach":{"status":"ok","spdx":"Apache-2.0"}},{"provenance":"deterministic:regex_extraction","url":"https://github.com/Zj-BinXia/DiffIR","reach":{"status":"ok","spdx":"Apache-2.0"}}],"summary":{"ran":1,"unverified":3},"by_repo_kind":{"official":{"samples":4,"ran":1,"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":"236d44054916d8c6","entry":"get_model_activation","repo":"Zj-BinXia/DiffIR","repo_kind":"official","path":"DiffIR-SRGAN/utils_modelsummary.py","file_url":"https://github.com/Zj-BinXia/DiffIR/blob/HEAD/DiffIR-SRGAN/utils_modelsummary.py","link_basis":"harvester_set","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":"236d44054916d8c6"}},{"code_sha256_prefix":"6ef91108ba92f025","entry":"get_model_complexity_info","repo":"Zj-BinXia/DiffIR","repo_kind":"official","path":"DiffIR-SRGAN/utils_modelsummary.py","file_url":"https://github.com/Zj-BinXia/DiffIR/blob/HEAD/DiffIR-SRGAN/utils_modelsummary.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":"6ef91108ba92f025"}},{"code_sha256_prefix":"e39e724b057d5bec","entry":"get_model_flops","repo":"Zj-BinXia/DiffIR","repo_kind":"official","path":"DiffIR-SRGAN/utils_modelsummary.py","file_url":"https://github.com/Zj-BinXia/DiffIR/blob/HEAD/DiffIR-SRGAN/utils_modelsummary.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":"e39e724b057d5bec"}},{"code_sha256_prefix":"72c02bbb03c1e4e1","entry":"pad_test","repo":"Zj-BinXia/DiffIR","repo_kind":"official","path":"DiffIR-RealSR/inference_diffir.py","file_url":"https://github.com/Zj-BinXia/DiffIR/blob/HEAD/DiffIR-RealSR/inference_diffir.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":"72c02bbb03c1e4e1"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}