{"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/towards-real-world-blind-face-restoration-1","title":"Towards Real-World Blind Face Restoration with Generative Diffusion Prior","arxiv_id":"2312.15736","date":"2023-12-25","proceeding":null,"authors":["Xiaoxu Chen","Jingfan Tan","Tao Wang","Kaihao Zhang","Wenhan Luo","Xiaochun Cao"],"abstract":"Blind face restoration is an important task in computer vision and has gained significant attention due to its wide-range applications. Previous works mainly exploit facial priors to restore face images and have demonstrated high-quality results. However, generating faithful facial details remains a challenging problem due to the limited prior knowledge obtained from finite data. In this work, we delve into the potential of leveraging the pretrained Stable Diffusion for blind face restoration. We propose BFRffusion which is thoughtfully designed to effectively extract features from low-quality face images and could restore realistic and faithful facial details with the generative prior of the pretrained Stable Diffusion. In addition, we build a privacy-preserving face dataset called PFHQ with balanced attributes like race, gender, and age. This dataset can serve as a viable alternative for training blind face restoration networks, effectively addressing privacy and bias concerns usually associated with the real face datasets. Through an extensive series of experiments, we demonstrate that our BFRffusion achieves state-of-the-art performance on both synthetic and real-world public testing datasets for blind face restoration and our PFHQ dataset is an available resource for training blind face restoration networks. The codes, pretrained models, and dataset are released at https://github.com/chenxx89/BFRffusion.","url_abs":"https://arxiv.org/abs/2312.15736v2","url_pdf":"https://arxiv.org/pdf/2312.15736v2.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":"towards-real-world-blind-face-restoration-1","repo_url":"https://github.com/chenxx89/bfrffusion","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok","spdx":"MIT"}}],"tasks":[{"task_slug":"blind-face-restoration","task_name":"Blind Face Restoration"},{"task_slug":"privacy-preserving","task_name":"Privacy Preserving"}],"methods":[{"method_slug":"diffusion","method_name":"Diffusion"}],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"syntology_url":"https://syntology.ai/paper/2312.15736","atlas_url":"https://app.syntology.ai/?focus=2312.15736","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2312.15736"}},"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":[{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/chenxx89/bfrffusion","reach":{"status":"ok","spdx":"MIT"}}],"summary":{"ran_fixture":3,"ran":4,"ran_violates":2,"ran_honours":1,"ran_draft_wrong":1,"unverified":5},"by_repo_kind":{"official":{"samples":16,"ran":11,"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":"f9ec7d70add02b6f","entry":"HWC3","repo":"chenxx89/bfrffusion","repo_kind":"official","path":"annotator/util.py","file_url":"https://github.com/chenxx89/bfrffusion/blob/HEAD/annotator/util.py","link_basis":"harvester_set","language":"python","status":"ran_fixture","verification_level":1,"contract_check":"RAISES","metamorphic_tier":"invariant","behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"f9ec7d70add02b6f"}},{"code_sha256_prefix":"bf78d27b7b40870a","entry":"cosin_metric","repo":"chenxx89/bfrffusion","repo_kind":"official","path":"metrics/calculate_cos_dist.py","file_url":"https://github.com/chenxx89/bfrffusion/blob/HEAD/metrics/calculate_cos_dist.py","link_basis":"first_harvest_node","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":"bf78d27b7b40870a"}},{"code_sha256_prefix":"424012cb37b31172","entry":"default","repo":"chenxx89/bfrffusion","repo_kind":"official","path":"ldm/modules/attention.py","file_url":"https://github.com/chenxx89/bfrffusion/blob/HEAD/ldm/modules/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":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"424012cb37b31172"}},{"code_sha256_prefix":"aa5486a3650902d8","entry":"exists","repo":"chenxx89/bfrffusion","repo_kind":"official","path":"ldm/modules/attention.py","file_url":"https://github.com/chenxx89/bfrffusion/blob/HEAD/ldm/modules/attention.py","link_basis":"harvester_set","language":"python","status":"ran_violates","verification_level":1,"contract_check":"VIOLATES","metamorphic_tier":"deterministic","behaviour_fingerprint":true,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"aa5486a3650902d8"}},{"code_sha256_prefix":"b1368330cf0f5642","entry":"isimage","repo":"chenxx89/bfrffusion","repo_kind":"official","path":"ldm/util.py","file_url":"https://github.com/chenxx89/bfrffusion/blob/HEAD/ldm/util.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":"b1368330cf0f5642"}},{"code_sha256_prefix":"d72762b700feee6f","entry":"ismap","repo":"chenxx89/bfrffusion","repo_kind":"official","path":"ldm/util.py","file_url":"https://github.com/chenxx89/bfrffusion/blob/HEAD/ldm/util.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":"d72762b700feee6f"}},{"code_sha256_prefix":"0af8635db2bb32a2","entry":"make_layers","repo":"chenxx89/bfrffusion","repo_kind":"official","path":"annotator/openpose/model.py","file_url":"https://github.com/chenxx89/bfrffusion/blob/HEAD/annotator/openpose/model.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":"0af8635db2bb32a2"}},{"code_sha256_prefix":"62fcb3912a967a50","entry":"modulate","repo":"chenxx89/bfrffusion","repo_kind":"official","path":"models/transformerBlock.py","file_url":"https://github.com/chenxx89/bfrffusion/blob/HEAD/models/transformerBlock.py","link_basis":"harvester_set","language":"python","status":"ran_honours","verification_level":1,"contract_check":"HONOURS","metamorphic_tier":"invariant","behaviour_fingerprint":true,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"62fcb3912a967a50"}},{"code_sha256_prefix":"82a15cc1e46f7e4d","entry":"to_3d","repo":"chenxx89/bfrffusion","repo_kind":"official","path":"models/transformerBlock.py","file_url":"https://github.com/chenxx89/bfrffusion/blob/HEAD/models/transformerBlock.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":"82a15cc1e46f7e4d"}},{"code_sha256_prefix":"b20f2a5df739a59e","entry":"to_4d","repo":"chenxx89/bfrffusion","repo_kind":"official","path":"models/transformerBlock.py","file_url":"https://github.com/chenxx89/bfrffusion/blob/HEAD/models/transformerBlock.py","link_basis":"harvester_set","language":"python","status":"ran_fixture","verification_level":1,"contract_check":"RAISES","metamorphic_tier":"invariant","behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"b20f2a5df739a59e"}},{"code_sha256_prefix":"9a299fe5ae09e407","entry":"uniq","repo":"chenxx89/bfrffusion","repo_kind":"official","path":"ldm/modules/attention.py","file_url":"https://github.com/chenxx89/bfrffusion/blob/HEAD/ldm/modules/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":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"9a299fe5ae09e407"}},{"code_sha256_prefix":"cfc17707f35e7ec4","entry":"get_state_dict","repo":"chenxx89/bfrffusion","repo_kind":"official","path":"models/models.py","file_url":"https://github.com/chenxx89/bfrffusion/blob/HEAD/models/models.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":"cfc17707f35e7ec4"}},{"code_sha256_prefix":"d8d6d771a1dadff4","entry":"load_image","repo":"chenxx89/bfrffusion","repo_kind":"official","path":"metrics/calculate_cos_dist.py","file_url":"https://github.com/chenxx89/bfrffusion/blob/HEAD/metrics/calculate_cos_dist.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":"d8d6d771a1dadff4"}},{"code_sha256_prefix":"87337881055f7a57","entry":"load_state_dict","repo":"chenxx89/bfrffusion","repo_kind":"official","path":"models/models.py","file_url":"https://github.com/chenxx89/bfrffusion/blob/HEAD/models/models.py","link_basis":"first_harvest_node","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":"87337881055f7a57"}},{"code_sha256_prefix":"6b4c1a8ce5fb7282","entry":"log_txt_as_img","repo":"chenxx89/bfrffusion","repo_kind":"official","path":"ldm/util.py","file_url":"https://github.com/chenxx89/bfrffusion/blob/HEAD/ldm/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":"6b4c1a8ce5fb7282"}},{"code_sha256_prefix":"50fd68f6989503c6","entry":"resize_image","repo":"chenxx89/bfrffusion","repo_kind":"official","path":"annotator/util.py","file_url":"https://github.com/chenxx89/bfrffusion/blob/HEAD/annotator/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":"50fd68f6989503c6"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}