{"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/paint-by-example-exemplar-based-image-editing","title":"Paint by Example: Exemplar-based Image Editing with Diffusion Models","arxiv_id":"2211.13227","date":"2022-11-23","proceeding":"CVPR 2023 1","authors":["Binxin Yang","Shuyang Gu","Bo Zhang","Ting Zhang","Xuejin Chen","Xiaoyan Sun","Dong Chen","Fang Wen"],"abstract":"Language-guided image editing has achieved great success recently. In this paper, for the first time, we investigate exemplar-guided image editing for more precise control. We achieve this goal by leveraging self-supervised training to disentangle and re-organize the source image and the exemplar. However, the naive approach will cause obvious fusing artifacts. We carefully analyze it and propose an information bottleneck and strong augmentations to avoid the trivial solution of directly copying and pasting the exemplar image. Meanwhile, to ensure the controllability of the editing process, we design an arbitrary shape mask for the exemplar image and leverage the classifier-free guidance to increase the similarity to the exemplar image. The whole framework involves a single forward of the diffusion model without any iterative optimization. We demonstrate that our method achieves an impressive performance and enables controllable editing on in-the-wild images with high fidelity.","url_abs":"https://arxiv.org/abs/2211.13227v1","url_pdf":"https://arxiv.org/pdf/2211.13227v1.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":"paint-by-example-exemplar-based-image-editing","repo_url":"https://github.com/Fantasy-Studio/Paint-by-Example","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok","spdx":"NOASSERTION"}},{"paper_slug":"paint-by-example-exemplar-based-image-editing","repo_url":"https://github.com/LonglongaaaGo/EXE-GAN","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok","spdx":"MIT"}}],"tasks":[{"task_slug":"image-generation","task_name":"Image Generation"},{"task_slug":"image-manipulation","task_name":"Image Manipulation"}],"methods":[{"method_slug":"diffusion","method_name":"Diffusion"}],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2211.13227","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2211.13227"}},"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/LonglongaaaGo/EXE-GAN","reach":{"status":"ok","spdx":"MIT"}},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/Fantasy-Studio/Paint-by-Example","reach":{"status":"ok","spdx":"NOASSERTION"}}],"summary":{"ran_fixture":1,"ran_draft_wrong":3,"ran_violates":2,"ran":1,"unverified":13},"by_repo_kind":{"listed":{"samples":17,"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":3,"samples":[{"code_sha256_prefix":"4cee7c1861294d59","entry":"calculate_frechet_distance","repo":null,"repo_kind":null,"path":null,"file_url":null,"link_basis":"identical_code_first_harvested_elsewhere","language":"python","status":"ran_fixture","verification_level":1,"contract_check":"RAISES","metamorphic_tier":"invariant","behaviour_fingerprint":false,"licence":null,"inline_ok":false,"mcp_get_code":{"code_sha256":"4cee7c1861294d59"}},{"code_sha256_prefix":"8241c0562bc710fd","entry":"chunk","repo":null,"repo_kind":null,"path":null,"file_url":null,"link_basis":"identical_code_first_harvested_elsewhere","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"OUTPUT_MISDECLARED","metamorphic_tier":null,"behaviour_fingerprint":false,"licence":null,"inline_ok":false,"mcp_get_code":{"code_sha256":"8241c0562bc710fd"}},{"code_sha256_prefix":"3651db4e5ae8d189","entry":"d_logistic_loss","repo":"LonglongaaaGo/EXE-GAN","repo_kind":"listed","path":"exemplar_style_mixing.py","file_url":"https://github.com/LonglongaaaGo/EXE-GAN/blob/HEAD/exemplar_style_mixing.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":"3651db4e5ae8d189"}},{"code_sha256_prefix":"dbb756dcd778f52f","entry":"data_sampler","repo":"LonglongaaaGo/EXE-GAN","repo_kind":"listed","path":"exemplar_style_mixing.py","file_url":"https://github.com/LonglongaaaGo/EXE-GAN/blob/HEAD/exemplar_style_mixing.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":"dbb756dcd778f52f"}},{"code_sha256_prefix":"6f65e378a4313f87","entry":"make_kernel","repo":"LonglongaaaGo/EXE-GAN","repo_kind":"listed","path":"models/exe_gan_nets.py","file_url":"https://github.com/LonglongaaaGo/EXE-GAN/blob/HEAD/models/exe_gan_nets.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":"6f65e378a4313f87"}},{"code_sha256_prefix":"1e63d588563eb90a","entry":"numpy_to_pil","repo":null,"repo_kind":null,"path":null,"file_url":null,"link_basis":"identical_code_first_harvested_elsewhere","language":"python","status":"ran_violates","verification_level":1,"contract_check":"VIOLATES","metamorphic_tier":"invariant","behaviour_fingerprint":false,"licence":null,"inline_ok":false,"mcp_get_code":{"code_sha256":"1e63d588563eb90a"}},{"code_sha256_prefix":"3f0a1105ef251d78","entry":"reduce_sum","repo":"LonglongaaaGo/EXE-GAN","repo_kind":"listed","path":"distributed.py","file_url":"https://github.com/LonglongaaaGo/EXE-GAN/blob/HEAD/distributed.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":"3f0a1105ef251d78"}},{"code_sha256_prefix":"ed03ba54397adbe4","entry":"all_gather","repo":"LonglongaaaGo/EXE-GAN","repo_kind":"listed","path":"distributed.py","file_url":"https://github.com/LonglongaaaGo/EXE-GAN/blob/HEAD/distributed.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":"ed03ba54397adbe4"}},{"code_sha256_prefix":"2d472433c663434f","entry":"color_2mask","repo":"LonglongaaaGo/EXE-GAN","repo_kind":"listed","path":"img_load_util.py","file_url":"https://github.com/LonglongaaaGo/EXE-GAN/blob/HEAD/img_load_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":"2d472433c663434f"}},{"code_sha256_prefix":"2a0761df010571b2","entry":"d_logistic_loss","repo":"LonglongaaaGo/EXE-GAN","repo_kind":"listed","path":"guided_recovery.py","file_url":"https://github.com/LonglongaaaGo/EXE-GAN/blob/HEAD/guided_recovery.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":"2a0761df010571b2"}},{"code_sha256_prefix":"a381b6902170861c","entry":"dilate_demo","repo":"LonglongaaaGo/EXE-GAN","repo_kind":"listed","path":"dataset.py","file_url":"https://github.com/LonglongaaaGo/EXE-GAN/blob/HEAD/dataset.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":"a381b6902170861c"}},{"code_sha256_prefix":"b16e4b2d76125214","entry":"embedding_loss","repo":"LonglongaaaGo/EXE-GAN","repo_kind":"listed","path":"Loss/psp_embedding.py","file_url":"https://github.com/LonglongaaaGo/EXE-GAN/blob/HEAD/Loss/psp_embedding.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":"b16e4b2d76125214"}},{"code_sha256_prefix":"17bd3ef96668d497","entry":"erode_demo","repo":"LonglongaaaGo/EXE-GAN","repo_kind":"listed","path":"dataset.py","file_url":"https://github.com/LonglongaaaGo/EXE-GAN/blob/HEAD/dataset.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":"17bd3ef96668d497"}},{"code_sha256_prefix":"5d24d1772337c22c","entry":"get_img_lists","repo":"LonglongaaaGo/EXE-GAN","repo_kind":"listed","path":"img_load_util.py","file_url":"https://github.com/LonglongaaaGo/EXE-GAN/blob/HEAD/img_load_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":"5d24d1772337c22c"}},{"code_sha256_prefix":"6520319a65c8cf38","entry":"load_img2tensor","repo":"LonglongaaaGo/EXE-GAN","repo_kind":"listed","path":"img_load_util.py","file_url":"https://github.com/LonglongaaaGo/EXE-GAN/blob/HEAD/img_load_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":"6520319a65c8cf38"}},{"code_sha256_prefix":"6503cdd2ec3fa92b","entry":"make_noise","repo":"LonglongaaaGo/EXE-GAN","repo_kind":"listed","path":"models/exe_gan_nets.py","file_url":"https://github.com/LonglongaaaGo/EXE-GAN/blob/HEAD/models/exe_gan_nets.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":"6503cdd2ec3fa92b"}},{"code_sha256_prefix":"9df6285dc883665c","entry":"mixing_noise","repo":"LonglongaaaGo/EXE-GAN","repo_kind":"listed","path":"models/exe_gan_nets.py","file_url":"https://github.com/LonglongaaaGo/EXE-GAN/blob/HEAD/models/exe_gan_nets.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":"9df6285dc883665c"}},{"code_sha256_prefix":"5144ad456049f8ce","entry":"reduce_loss_dict","repo":"LonglongaaaGo/EXE-GAN","repo_kind":"listed","path":"distributed.py","file_url":"https://github.com/LonglongaaaGo/EXE-GAN/blob/HEAD/distributed.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":"5144ad456049f8ce"}},{"code_sha256_prefix":"514dd3c0eee3691c","entry":"score_2afc_dataset","repo":"LonglongaaaGo/EXE-GAN","repo_kind":"listed","path":"lpips_local/dist_model.py","file_url":"https://github.com/LonglongaaaGo/EXE-GAN/blob/HEAD/lpips_local/dist_model.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":"514dd3c0eee3691c"}},{"code_sha256_prefix":"1fdf42050ecd38e7","entry":"set_device","repo":"LonglongaaaGo/EXE-GAN","repo_kind":"listed","path":"fid_eval.py","file_url":"https://github.com/LonglongaaaGo/EXE-GAN/blob/HEAD/fid_eval.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":"1fdf42050ecd38e7"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}