{"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/null-text-inversion-for-editing-real-images","title":"Null-text Inversion for Editing Real Images using Guided Diffusion Models","arxiv_id":"2211.09794","date":"2022-11-17","proceeding":"CVPR 2023 1","authors":["Ron Mokady","Amir Hertz","Kfir Aberman","Yael Pritch","Daniel Cohen-Or"],"abstract":"Recent text-guided diffusion models provide powerful image generation capabilities. Currently, a massive effort is given to enable the modification of these images using text only as means to offer intuitive and versatile editing. To edit a real image using these state-of-the-art tools, one must first invert the image with a meaningful text prompt into the pretrained model's domain. In this paper, we introduce an accurate inversion technique and thus facilitate an intuitive text-based modification of the image. Our proposed inversion consists of two novel key components: (i) Pivotal inversion for diffusion models. While current methods aim at mapping random noise samples to a single input image, we use a single pivotal noise vector for each timestamp and optimize around it. We demonstrate that a direct inversion is inadequate on its own, but does provide a good anchor for our optimization. (ii) NULL-text optimization, where we only modify the unconditional textual embedding that is used for classifier-free guidance, rather than the input text embedding. This allows for keeping both the model weights and the conditional embedding intact and hence enables applying prompt-based editing while avoiding the cumbersome tuning of the model's weights. Our Null-text inversion, based on the publicly available Stable Diffusion model, is extensively evaluated on a variety of images and prompt editing, showing high-fidelity editing of real images.","url_abs":"https://arxiv.org/abs/2211.09794v1","url_pdf":"https://arxiv.org/pdf/2211.09794v1.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":"null-text-inversion-for-editing-real-images","repo_url":"https://github.com/google/prompt-to-prompt","is_official":1,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":null},{"paper_slug":"null-text-inversion-for-editing-real-images","repo_url":"https://github.com/phymhan/prompt-to-prompt","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":null},{"paper_slug":"null-text-inversion-for-editing-real-images","repo_url":"https://github.com/thepowerfuldeez/null-text-inversion","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"none","reach":{"status":"ok"}},{"paper_slug":"null-text-inversion-for-editing-real-images","repo_url":"https://github.com/qwopqwop200/semantic-image-editing-with-null-inv","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":0,"framework":"none","reach":{"status":"ok","spdx":"MIT"}}],"tasks":[{"task_slug":"image-generation","task_name":"Image Generation"},{"task_slug":"text-based-image-editing","task_name":"Text-based Image Editing"}],"methods":[{"method_slug":"diffusion","method_name":"Diffusion"}],"datasets_introduced":[],"methods_introduced":[],"results":[{"leaderboard":"/sota/text-based-image-editing-on-pie-bench","task":"Text-based Image Editing","dataset":"PIE-Bench","model":"Null-Text Inversion+Prompt-to-Prompt","rank_in_archive_order":6,"of":18,"metrics":{"Background LPIPS":"60.67","Background PSNR":"27.03","CLIPSIM":"24.75","Structure Distance":"13.44"},"uses_additional_data":false}],"syntology":{"syntology_url":null,"atlas_url":"https://app.syntology.ai/?focus=2211.09794","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2211.09794"}},"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/google/prompt-to-prompt","reach":null},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/qwopqwop200/semantic-image-editing-with-null-inv","reach":{"status":"ok","spdx":"MIT"}},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/thepowerfuldeez/null-text-inversion","reach":{"status":"ok"}},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/phymhan/prompt-to-prompt","reach":null}],"summary":{"ran_honours":1},"by_repo_kind":{"listed":{"samples":1,"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":"6db9848012fc30bf","entry":"aggregate_attention","repo":"phymhan/prompt-to-prompt","repo_kind":"listed","path":"null_text_inversion.py","file_url":"https://github.com/phymhan/prompt-to-prompt/blob/HEAD/null_text_inversion.py","link_basis":"first_harvest_node","language":"python","status":"ran_honours","verification_level":1,"contract_check":"HONOURS","metamorphic_tier":"well_formed","behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"6db9848012fc30bf"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}