{"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/unitune-text-driven-image-editing-by-fine","title":"UniTune: Text-Driven Image Editing by Fine Tuning a Diffusion Model on a Single Image","arxiv_id":"2210.09477","date":"2022-10-17","proceeding":null,"authors":["Dani Valevski","Matan Kalman","Eyal Molad","Eyal Segalis","Yossi Matias","Yaniv Leviathan"],"abstract":"Text-driven image generation methods have shown impressive results recently, allowing casual users to generate high quality images by providing textual descriptions. However, similar capabilities for editing existing images are still out of reach. Text-driven image editing methods usually need edit masks, struggle with edits that require significant visual changes and cannot easily keep specific details of the edited portion. In this paper we make the observation that image-generation models can be converted to image-editing models simply by fine-tuning them on a single image. We also show that initializing the stochastic sampler with a noised version of the base image before the sampling and interpolating relevant details from the base image after sampling further increase the quality of the edit operation. Combining these observations, we propose UniTune, a novel image editing method. UniTune gets as input an arbitrary image and a textual edit description, and carries out the edit while maintaining high fidelity to the input image. UniTune does not require additional inputs, like masks or sketches, and can perform multiple edits on the same image without retraining. We test our method using the Imagen model in a range of different use cases. We demonstrate that it is broadly applicable and can perform a surprisingly wide range of expressive editing operations, including those requiring significant visual changes that were previously impossible.","url_abs":"https://arxiv.org/abs/2210.09477v4","url_pdf":"https://arxiv.org/pdf/2210.09477v4.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":"unitune-text-driven-image-editing-by-fine","repo_url":"https://github.com/xuduo35/UniTune","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":0,"framework":"pytorch","reach":{"status":"ok","spdx":"MIT"}}],"tasks":[{"task_slug":"image-generation","task_name":"Image Generation"}],"methods":[{"method_slug":"base","method_name":"BASE"},{"method_slug":"diffusion","method_name":"Diffusion"},{"method_slug":"test","method_name":"Test"}],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2210.09477","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2210.09477"}},"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/xuduo35/UniTune","reach":{"status":"ok","spdx":"MIT"}}],"summary":{"ran_draft_wrong":3,"ran_violates":2,"ran_honours":2,"ran":3,"unverified":3},"by_repo_kind":{"listed":{"samples":13,"ran":10,"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":"8241c0562bc710fd","entry":"chunk","repo":"xuduo35/UniTune","repo_kind":"listed","path":"gr_stable_txt2img.py","file_url":"https://github.com/xuduo35/UniTune/blob/HEAD/gr_stable_txt2img.py","link_basis":"plan_row","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":"8241c0562bc710fd"}},{"code_sha256_prefix":"424012cb37b31172","entry":"default","repo":"xuduo35/UniTune","repo_kind":"listed","path":"ldm/modules/attention.py","file_url":"https://github.com/xuduo35/UniTune/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":"xuduo35/UniTune","repo_kind":"listed","path":"ldm/modules/attention.py","file_url":"https://github.com/xuduo35/UniTune/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":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"aa5486a3650902d8"}},{"code_sha256_prefix":"d5726f9e3a5684c3","entry":"get_bert_token_for_string","repo":"xuduo35/UniTune","repo_kind":"listed","path":"ldm/modules/embedding_manager.py","file_url":"https://github.com/xuduo35/UniTune/blob/HEAD/ldm/modules/embedding_manager.py","link_basis":"harvester_set","language":"python","status":"ran_honours","verification_level":1,"contract_check":"HONOURS","metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"d5726f9e3a5684c3"}},{"code_sha256_prefix":"41c6eb3a0aa3eb46","entry":"get_clip_token_for_string","repo":"xuduo35/UniTune","repo_kind":"listed","path":"ldm/modules/embedding_manager.py","file_url":"https://github.com/xuduo35/UniTune/blob/HEAD/ldm/modules/embedding_manager.py","link_basis":"harvester_set","language":"python","status":"ran_honours","verification_level":1,"contract_check":"HONOURS","metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"41c6eb3a0aa3eb46"}},{"code_sha256_prefix":"e466f56ae7a8bea6","entry":"get_clip_token_for_string","repo":"xuduo35/UniTune","repo_kind":"listed","path":"merge_embeddings.py","file_url":"https://github.com/xuduo35/UniTune/blob/HEAD/merge_embeddings.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":"e466f56ae7a8bea6"}},{"code_sha256_prefix":"71c2df28a1008d03","entry":"get_embedding_for_clip_token","repo":"xuduo35/UniTune","repo_kind":"listed","path":"ldm/modules/embedding_manager.py","file_url":"https://github.com/xuduo35/UniTune/blob/HEAD/ldm/modules/embedding_manager.py","link_basis":"harvester_set","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"MISDECLARED","metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"71c2df28a1008d03"}},{"code_sha256_prefix":"cb1a19e61d70046b","entry":"get_placeholder_loop","repo":"xuduo35/UniTune","repo_kind":"listed","path":"merge_embeddings.py","file_url":"https://github.com/xuduo35/UniTune/blob/HEAD/merge_embeddings.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":"cb1a19e61d70046b"}},{"code_sha256_prefix":"a3f07f0c1a9623c3","entry":"numpy_to_pil","repo":"xuduo35/UniTune","repo_kind":"listed","path":"gr_stable_txt2img.py","file_url":"https://github.com/xuduo35/UniTune/blob/HEAD/gr_stable_txt2img.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":"a3f07f0c1a9623c3"}},{"code_sha256_prefix":"9a299fe5ae09e407","entry":"uniq","repo":"xuduo35/UniTune","repo_kind":"listed","path":"ldm/modules/attention.py","file_url":"https://github.com/xuduo35/UniTune/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":"91610d6e2f2a67b4","entry":"get_bert_token_for_string","repo":"xuduo35/UniTune","repo_kind":"listed","path":"merge_embeddings.py","file_url":"https://github.com/xuduo35/UniTune/blob/HEAD/merge_embeddings.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":"91610d6e2f2a67b4"}},{"code_sha256_prefix":"d7a3942d0d5c6041","entry":"get_full_repo_name","repo":"xuduo35/UniTune","repo_kind":"listed","path":"train_unitune_colab.py","file_url":"https://github.com/xuduo35/UniTune/blob/HEAD/train_unitune_colab.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":"d7a3942d0d5c6041"}},{"code_sha256_prefix":"fadd22e702a7c11d","entry":"parse_args","repo":"xuduo35/UniTune","repo_kind":"listed","path":"train_unitune_colab.py","file_url":"https://github.com/xuduo35/UniTune/blob/HEAD/train_unitune_colab.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":"fadd22e702a7c11d"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}