Papers › Prompt-to-Prompt Image Editing with Cross Attention Control

Prompt-to-Prompt Image Editing with Cross Attention Control

2 Aug 2022arXiv:2208.01626archive 2025-07-28

Amir Hertz, Ron Mokady, Jay Tenenbaum, Kfir Aberman, Yael Pritch, Daniel Cohen-Or

Recent large-scale text-driven synthesis models have attracted much attention thanks to their remarkable capabilities of generating highly diverse images that follow given text prompts. Such text-based synthesis methods are particularly appealing to humans who are used to verbally describe their intent. Therefore, it is only natural to extend the text-driven image synthesis to text-driven image editing. Editing is challenging for these generative models, since an innate property of an editing technique is to preserve most of the original image, while in the text-based models, even a small modification of the text prompt often leads to a completely different outcome. State-of-the-art methods mitigate this by requiring the users to provide a spatial mask to localize the edit, hence, ignoring the original structure and content within the masked region. In this paper, we pursue an intuitive prompt-to-prompt editing framework, where the edits are controlled by text only. To this end, we analyze a text-conditioned model in depth and observe that the cross-attention layers are the key to controlling the relation between the spatial layout of the image to each word in the prompt. With this observation, we present several applications which monitor the image synthesis by editing the textual prompt only. This includes localized editing by replacing a word, global editing by adding a specification, and even delicately controlling the extent to which a word is reflected in the image. We present our results over diverse images and prompts, demonstrating high-quality synthesis and fidelity to the edited prompts.

PaperPDFCodeCode Syntology ran

In Syntology View this paper on Syntology: its repositories, every harvested function with whether it ran, its licence and the call to fetch it.

Open this paper in Syntology's Atlas, the map of the papers in Syntology's graph and their citations.

For agents, Syntology's MCP tool lists every function and class Syntology harvested from this paper and whether it ran (how to connect): get_harvested_code_for_paper(arxiv_id="2208.01626")

Code

Syntology Ran 8 of 15 code samples harvested from 5 repositories linked to this paper; 7 have no recorded run. Of those that ran: 1 ran · honoured contract; 1 ran · violated contract; 2 ran · our draft was wrong; 4 ran with no contract checked.

By repository: official repository: 1 sample from 1 repository, 0 ran; community (archive-listed): 12 samples from 4 repositories, 6 ran; 2 identical to code first harvested elsewhere. The run record, sample by sample. “Ran” means executed on a synthesized input, not that the code is correct or reproduces the paper.

google/prompt-to-prompt officialmentioned on GitHubpytorch report
bloc97/CrossAttentionControl mentioned on GitHubpytorchMIT report
chenwu98/cycle-diffusion mentioned on GitHubpytorch report
hansam95/nmg mentioned on GitHubpytorch report
miguelCalado/prompt-to-prompt-tensorflow mentioned on GitHubtfApache-2.0 report
phymhan/prompt-to-prompt mentioned on GitHubpytorch report

Repository list and official/mentioned flags are the archive's, frozen 2025-07-28. Reachability, where shown, is from one Syntology probe window (2026-09-16 to 2026-09-18); repositories not probed show nothing. GitHub stars are not tracked.

Code Syntology ran Syntology

15 samples harvested; 8 ran; 1 honoured the contract we drafted; 7 have no recorded run. Read from Syntology's graph 2026-09-25; that is when this build read the record, not when the samples ran.

1ran · honoured contract
1ran · violated contract
2ran · our draft was wrong
4ran
7unverified

Licence: 3 of the 15 samples are pointer only, meaning Syntology does not serve that copy's text. This page shows no code text for any sample; each one links to its file in the repository.

Harvested from 5 repositories linked to this paper, official or community; each sample names its own and says which. Some samples are identical code Syntology first harvested from another repository; for those, this paper's copy is not located and its licence is not recorded. “Ran” means the sample executed on a synthesized input. It does not mean the output is correct, and nothing here reproduces the paper's results. “Honoured” and “violated” refer to a contract Syntology drafted from the code itself; “our draft was wrong” and “fixture could not drive it” are failures of Syntology's instrument, not of the code.

Each sample ends with its code_sha256, Syntology's identity for that exact code. An agent fetches the stored sample with Syntology's MCP tool get_code(code_sha256="…") (how to connect); click an identity to copy that call.

Repository labels, per sample. official repository: The archive marks this repository official for the paper. named in the paper: The archive records that the paper mentions this repository; it is not marked official. community (archive-listed): In the archive's code links for this paper, not marked official and not recorded as mentioned in the paper. found in paper text by Syntology: 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. Samples from a repository marked official are listed first. Licence labels name the repository's licence as recorded at harvest. “Pointer only” means Syntology does not serve that copy's text, for one of four reasons: no licence file was found; the licence was not identified; the licence is recorded as permissive but that copy's record is not marked cleared; or the licence is outside the permissive list Syntology serves text under (MIT, Apache-2.0, BSD and similar). Some licences outside that list permit redistribution, such as WTFPL, and GPL-3.0 under its conditions; they are simply not on the list. Hover a licence label for the reason. File links open the file on GitHub at the default branch, which may have changed since the harvest.

register_attention_control google/prompt-to-prompt/ptp_utils.py official repository unverified Apache-2.0 (permissive) · 5427f43aa7709411 · report
AttentionStore hansam95/nmg/prompt_to_prompt/ptp_utils.py community (archive-listed) ran MIT (permissive) · f92b0f0ea89b9495 · report
CrossAttention chenwu98/cycle-diffusion/model/lib/stable_diffusion/ldm/modules/attention.py community (archive-listed) ran · metamorphic tier: deterministic licence not identified · pointer only · eb721f1e5050ad01 · report
get_mapper miguelCalado/prompt-to-prompt-tensorflow/seq_aligner.py community (archive-listed) ran fingerprinted Apache-2.0 (permissive) · e756b026e8544be8 · report
get_word_inds hansam95/nmg/prompt_to_prompt/ptp_utils.py community (archive-listed) ran · honoured contract MIT (permissive) · 90914e1d22798d8a · report
global_align miguelCalado/prompt-to-prompt-tensorflow/seq_aligner.py community (archive-listed) ran Apache-2.0 (permissive) · f019b0bdea83a11a · report
update_alpha_time_word hansam95/nmg/prompt_to_prompt/ptp_utils.py community (archive-listed) ran · our draft was wrong MIT (permissive) · 35d28dc49040562c · report
AttentionControl hansam95/nmg/prompt_to_prompt/ptp_utils.py community (archive-listed) unverified MIT (permissive) · 2f95aad416a92bda · report
AttentionControlEdit hansam95/nmg/prompt_to_prompt/ptp_utils.py community (archive-listed) unverified MIT (permissive) · 8681c8453f5e2137 · report
LocalBlend hansam95/nmg/prompt_to_prompt/ptp_utils.py community (archive-listed) unverified MIT (permissive) · 8a805bc148037fbd · report
get_matrix miguelCalado/prompt-to-prompt-tensorflow/seq_aligner.py community (archive-listed) unverified Apache-2.0 (permissive) · 81db21bf982ca0fe · report
get_time_words_attention_alpha hansam95/nmg/prompt_to_prompt/ptp_utils.py community (archive-listed) unverified MIT (permissive) · b84383c30daa723c · report
register_attention_control phymhan/prompt-to-prompt/ptp_utils.py community (archive-listed) unverified Apache-2.0 (permissive) · ea0c551b3830dfeb · report
default identical code first harvested elsewhere ran · violated contract licence of this copy not recorded · 424012cb37b31172 · report
max_neg_value identical code first harvested elsewhere ran · our draft was wrong fingerprinted licence of this copy not recorded · f2fe51a4a5646c6f · report

Tasks

Image GenerationText-based Image Editing

Results from the paper archive 2025-07-28

TaskDatasetModelMetricValueRank at snapshotLeaderboardReport
Text-based Image Editing PIE-Bench DDIM Inversion+Prompt-to-Prompt Background LPIPS 208.80 #17 of 18 Archive leaderboard report
Text-based Image Editing PIE-Bench DDIM Inversion+Prompt-to-Prompt Background PSNR 17.87 #17 of 18 Archive leaderboard report
Text-based Image Editing PIE-Bench DDIM Inversion+Prompt-to-Prompt CLIPSIM 25.01 #17 of 18 Archive leaderboard report
Text-based Image Editing PIE-Bench DDIM Inversion+Prompt-to-Prompt Structure Distance 69.43 #17 of 18 Archive leaderboard report

Ranks are positions in the archive's leaderboards as they stood at the 2025-07-28 snapshot. Results published since then are not among these rows, so a rank here is not a current standing.

Report a problem or propose a change · a person checks every report against the paper or source before anything changes; decisions are listed on /corrections