{"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/hd-painter-high-resolution-and-prompt","title":"HD-Painter: High-Resolution and Prompt-Faithful Text-Guided Image Inpainting with Diffusion Models","arxiv_id":"2312.14091","date":"2023-12-21","proceeding":null,"authors":["Hayk Manukyan","Andranik Sargsyan","Barsegh Atanyan","Zhangyang Wang","Shant Navasardyan","Humphrey Shi"],"abstract":"Recent progress in text-guided image inpainting, based on the unprecedented success of text-to-image diffusion models, has led to exceptionally realistic and visually plausible results. However, there is still significant potential for improvement in current text-to-image inpainting models, particularly in better aligning the inpainted area with user prompts and performing high-resolution inpainting. Therefore, we introduce HD-Painter, a training free approach that accurately follows prompts and coherently scales to high resolution image inpainting. To this end, we design the Prompt-Aware Introverted Attention (PAIntA) layer enhancing self-attention scores by prompt information resulting in better text aligned generations. To further improve the prompt coherence we introduce the Reweighting Attention Score Guidance (RASG) mechanism seamlessly integrating a post-hoc sampling strategy into the general form of DDIM to prevent out-of-distribution latent shifts. Moreover, HD-Painter allows extension to larger scales by introducing a specialized super-resolution technique customized for inpainting, enabling the completion of missing regions in images of up to 2K resolution. Our experiments demonstrate that HD-Painter surpasses existing state-of-the-art approaches quantitatively and qualitatively across multiple metrics and a user study. Code is publicly available at: https://github.com/Picsart-AI-Research/HD-Painter","url_abs":"https://arxiv.org/abs/2312.14091v3","url_pdf":"https://arxiv.org/pdf/2312.14091v3.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":"hd-painter-high-resolution-and-prompt","repo_url":"https://github.com/picsart-ai-research/hd-painter","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok","spdx":"MIT"}}],"tasks":[{"task_slug":"2k","task_name":"2k"},{"task_slug":"image-inpainting","task_name":"Image Inpainting"},{"task_slug":"super-resolution","task_name":"Super-Resolution"}],"methods":[{"method_slug":"diffusion","method_name":"Diffusion"},{"method_slug":"pixel-prediction","method_name":"Inpainting"}],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"syntology_url":null,"atlas_url":"https://app.syntology.ai/?focus=2312.14091","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2312.14091"}},"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/picsart-ai-research/hd-painter","reach":{"status":"ok","spdx":"MIT"}}],"summary":{"ran":6,"unverified":3},"by_repo_kind":{"official":{"samples":9,"ran":6,"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":"60bb5ec99199ea80","entry":"get_mask_bbox","repo":"picsart-ai-research/hd-painter","repo_kind":"official","path":"metrics/utils.py","file_url":"https://github.com/picsart-ai-research/hd-painter/blob/HEAD/metrics/utils.py","link_basis":"first_harvest_node","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":"60bb5ec99199ea80"}},{"code_sha256_prefix":"c485485457d21a43","entry":"get_obj_from_str","repo":"picsart-ai-research/hd-painter","repo_kind":"official","path":"src/models/common.py","file_url":"https://github.com/picsart-ai-research/hd-painter/blob/HEAD/src/models/common.py","link_basis":"first_harvest_node","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":"c485485457d21a43"}},{"code_sha256_prefix":"0a8e36ab156c631d","entry":"load_state_dict","repo":"picsart-ai-research/hd-painter","repo_kind":"official","path":"src/models/common.py","file_url":"https://github.com/picsart-ai-research/hd-painter/blob/HEAD/src/models/common.py","link_basis":"first_harvest_node","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":"0a8e36ab156c631d"}},{"code_sha256_prefix":"1472ce0e9f26f1c7","entry":"normalized","repo":"picsart-ai-research/hd-painter","repo_kind":"official","path":"metrics/aesthetic.py","file_url":"https://github.com/picsart-ai-research/hd-painter/blob/HEAD/metrics/aesthetic.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":"1472ce0e9f26f1c7"}},{"code_sha256_prefix":"35f33a826485b259","entry":"pad2square","repo":"picsart-ai-research/hd-painter","repo_kind":"official","path":"metrics/utils.py","file_url":"https://github.com/picsart-ai-research/hd-painter/blob/HEAD/metrics/utils.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":"35f33a826485b259"}},{"code_sha256_prefix":"36ce6a13ea5e3ada","entry":"resize","repo":"picsart-ai-research/hd-painter","repo_kind":"official","path":"metrics/utils.py","file_url":"https://github.com/picsart-ai-research/hd-painter/blob/HEAD/metrics/utils.py","link_basis":"first_harvest_node","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":"36ce6a13ea5e3ada"}},{"code_sha256_prefix":"e670aa8de780268c","entry":"get_score","repo":"picsart-ai-research/hd-painter","repo_kind":"official","path":"metrics/aesthetic.py","file_url":"https://github.com/picsart-ai-research/hd-painter/blob/HEAD/metrics/aesthetic.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":"e670aa8de780268c"}},{"code_sha256_prefix":"1e017587f14b4e61","entry":"load_inpainting_model","repo":"picsart-ai-research/hd-painter","repo_kind":"official","path":"src/models/inpainting.py","file_url":"https://github.com/picsart-ai-research/hd-painter/blob/HEAD/src/models/inpainting.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":"1e017587f14b4e61"}},{"code_sha256_prefix":"3666d2c026ee9e5f","entry":"load_obj","repo":"picsart-ai-research/hd-painter","repo_kind":"official","path":"src/models/common.py","file_url":"https://github.com/picsart-ai-research/hd-painter/blob/HEAD/src/models/common.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":"3666d2c026ee9e5f"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}