{"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/osdface-one-step-diffusion-model-for-face","title":"OSDFace: One-Step Diffusion Model for Face Restoration","arxiv_id":"2411.17163","date":"2024-11-26","proceeding":"CVPR 2025 1","authors":["Jingkai Wang","Jue Gong","Lin Zhang","Zheng Chen","Xing Liu","Hong Gu","Yutong Liu","Yulun Zhang","Xiaokang Yang"],"abstract":"Diffusion models have demonstrated impressive performance in face restoration. Yet, their multi-step inference process remains computationally intensive, limiting their applicability in real-world scenarios. Moreover, existing methods often struggle to generate face images that are harmonious, realistic, and consistent with the subject's identity. In this work, we propose OSDFace, a novel one-step diffusion model for face restoration. Specifically, we propose a visual representation embedder (VRE) to better capture prior information and understand the input face. In VRE, low-quality faces are processed by a visual tokenizer and subsequently embedded with a vector-quantized dictionary to generate visual prompts. Additionally, we incorporate a facial identity loss derived from face recognition to further ensure identity consistency. We further employ a generative adversarial network (GAN) as a guidance model to encourage distribution alignment between the restored face and the ground truth. Experimental results demonstrate that OSDFace surpasses current state-of-the-art (SOTA) methods in both visual quality and quantitative metrics, generating high-fidelity, natural face images with high identity consistency. The code and model will be released at https://github.com/jkwang28/OSDFace.","url_abs":"https://arxiv.org/abs/2411.17163v1","url_pdf":"https://arxiv.org/pdf/2411.17163v1.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":"osdface-one-step-diffusion-model-for-face","repo_url":"https://github.com/jkwang28/osdface","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok"}}],"tasks":[{"task_slug":"face-recognition","task_name":"Face Recognition"},{"task_slug":null,"task_name":"Generative Adversarial Network"},{"task_slug":"model","task_name":"model"}],"methods":[{"method_slug":"diffusion","method_name":"Diffusion"}],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2411.17163","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2411.17163"}},"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/jkwang28/osdface","reach":{"status":"ok"}}],"summary":{"ran_draft_wrong":4,"unverified":14},"by_repo_kind":{"official":{"samples":18,"ran":4,"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":18,"samples":[{"code_sha256_prefix":"4c8c3d07d7aa35cb","entry":"calc_mean_std","repo":"jkwang28/osdface","repo_kind":"official","path":"utils/wavelet_color_fix.py","file_url":"https://github.com/jkwang28/osdface/blob/HEAD/utils/wavelet_color_fix.py","link_basis":"harvester_set","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"MISDECLARED","metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"4c8c3d07d7aa35cb"}},{"code_sha256_prefix":"76a017e88938061d","entry":"inplace_nonlinearity","repo":"jkwang28/osdface","repo_kind":"official","path":"utils/vaehook.py","file_url":"https://github.com/jkwang28/osdface/blob/HEAD/utils/vaehook.py","link_basis":"harvester_set","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"MISDECLARED","metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"76a017e88938061d"}},{"code_sha256_prefix":"3137073275f8c21a","entry":"nonlinearity","repo":"jkwang28/osdface","repo_kind":"official","path":"lq_embed/vqvae.py","file_url":"https://github.com/jkwang28/osdface/blob/HEAD/lq_embed/vqvae.py","link_basis":"harvester_set","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"MISDECLARED","metamorphic_tier":"invariant","behaviour_fingerprint":true,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"3137073275f8c21a"}},{"code_sha256_prefix":"33644951e3d8dbaf","entry":"wavelet_blur","repo":"jkwang28/osdface","repo_kind":"official","path":"utils/common.py","file_url":"https://github.com/jkwang28/osdface/blob/HEAD/utils/common.py","link_basis":"plan_row","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"MISDECLARED","metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"33644951e3d8dbaf"}},{"code_sha256_prefix":"d9c806cdedc044ef","entry":"adain_color_fix","repo":"jkwang28/osdface","repo_kind":"official","path":"utils/wavelet_color_fix.py","file_url":"https://github.com/jkwang28/osdface/blob/HEAD/utils/wavelet_color_fix.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"d9c806cdedc044ef"}},{"code_sha256_prefix":"174fab602409ffc2","entry":"attn_forward","repo":"jkwang28/osdface","repo_kind":"official","path":"utils/vaehook.py","file_url":"https://github.com/jkwang28/osdface/blob/HEAD/utils/vaehook.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"174fab602409ffc2"}},{"code_sha256_prefix":"08822a10826682a0","entry":"attn_forward_new","repo":"jkwang28/osdface","repo_kind":"official","path":"utils/vaehook.py","file_url":"https://github.com/jkwang28/osdface/blob/HEAD/utils/vaehook.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"08822a10826682a0"}},{"code_sha256_prefix":"a1316b96fc0dc988","entry":"cond_cast_float","repo":"jkwang28/osdface","repo_kind":"official","path":"utils/devices.py","file_url":"https://github.com/jkwang28/osdface/blob/HEAD/utils/devices.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"a1316b96fc0dc988"}},{"code_sha256_prefix":"6e1abd17fa1ce3b2","entry":"cond_cast_unet","repo":"jkwang28/osdface","repo_kind":"official","path":"utils/devices.py","file_url":"https://github.com/jkwang28/osdface/blob/HEAD/utils/devices.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"6e1abd17fa1ce3b2"}},{"code_sha256_prefix":"c90dc1793f7654e6","entry":"draw_valued_array","repo":"jkwang28/osdface","repo_kind":"official","path":"utils/others.py","file_url":"https://github.com/jkwang28/osdface/blob/HEAD/utils/others.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"c90dc1793f7654e6"}},{"code_sha256_prefix":"a861df384ac42eeb","entry":"get_device_for","repo":"jkwang28/osdface","repo_kind":"official","path":"utils/devices.py","file_url":"https://github.com/jkwang28/osdface/blob/HEAD/utils/devices.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"a861df384ac42eeb"}},{"code_sha256_prefix":"96bb2bca43d02a51","entry":"get_obj_from_str","repo":"jkwang28/osdface","repo_kind":"official","path":"utils/common.py","file_url":"https://github.com/jkwang28/osdface/blob/HEAD/utils/common.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"96bb2bca43d02a51"}},{"code_sha256_prefix":"192db27a22fa2a3f","entry":"instantiate_from_config","repo":"jkwang28/osdface","repo_kind":"official","path":"utils/common.py","file_url":"https://github.com/jkwang28/osdface/blob/HEAD/utils/common.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"192db27a22fa2a3f"}},{"code_sha256_prefix":"e3350df7f513af97","entry":"prepare_debug_output","repo":"jkwang28/osdface","repo_kind":"official","path":"utils/others.py","file_url":"https://github.com/jkwang28/osdface/blob/HEAD/utils/others.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"e3350df7f513af97"}},{"code_sha256_prefix":"c27182b440dbf60d","entry":"prepare_images_for_saving","repo":"jkwang28/osdface","repo_kind":"official","path":"utils/others.py","file_url":"https://github.com/jkwang28/osdface/blob/HEAD/utils/others.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"c27182b440dbf60d"}},{"code_sha256_prefix":"1140ffe195a89d7c","entry":"rope_2d","repo":"jkwang28/osdface","repo_kind":"official","path":"lq_embed/vqvae.py","file_url":"https://github.com/jkwang28/osdface/blob/HEAD/lq_embed/vqvae.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"1140ffe195a89d7c"}},{"code_sha256_prefix":"f5f84caa054c6546","entry":"sinusoidal_embeddings","repo":"jkwang28/osdface","repo_kind":"official","path":"lq_embed/vqvae.py","file_url":"https://github.com/jkwang28/osdface/blob/HEAD/lq_embed/vqvae.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"f5f84caa054c6546"}},{"code_sha256_prefix":"2353cdd05b03300f","entry":"wavelet_color_fix","repo":"jkwang28/osdface","repo_kind":"official","path":"utils/wavelet_color_fix.py","file_url":"https://github.com/jkwang28/osdface/blob/HEAD/utils/wavelet_color_fix.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"2353cdd05b03300f"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}