SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2208.01626 · 2022

Prompt-to-Prompt Image Editing with Cross Attention Control

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

arXiv · PDF · Open in the Atlas

Code that ran

We lifted 15 functions out of this paper's own repositories and ran 8 of them in a sandbox. "Ran" means the function executed on a synthesized input and returned a value. It is not a reproduction of the paper's results.

RepositoryRoleRan
hansam95/nmg — 3 of 7
miguelCalado/prompt-to-prompt-tensorflow pwc_unofficial 2 of 3
copy not recorded — 2 of 2
chenwu98/cycle-diffusion — 1 of 1
phymhan/prompt-to-prompt — 0 of 1
google/prompt-to-prompt — 0 of 1
FunctionStatusWhere it lives
AttentionStore Ran hansam95/nmg/prompt_to_prompt/ptp_utils.py
code served (permissive licence) · get_code("f92b0f0ea89b9495")
CrossAttention Ran chenwu98/cycle-diffusion/model/lib/stable_diffusion/ldm/modules/attention.py
pointer only (licence: NOASSERTION) · get_code("eb721f1e5050ad01")
default Ran this paper's copy was not recorded; identical code first harvested from ashen-sensored/sd_webui_SAG
pointer only · get_code("424012cb37b31172")
get_mapper Ran miguelCalado/prompt-to-prompt-tensorflow/seq_aligner.py
code served (permissive licence) · get_code("e756b026e8544be8")
get_word_inds Ran hansam95/nmg/prompt_to_prompt/ptp_utils.py
code served (permissive licence) · get_code("90914e1d22798d8a")
global_align Ran miguelCalado/prompt-to-prompt-tensorflow/seq_aligner.py
code served (permissive licence) · get_code("f019b0bdea83a11a")
max_neg_value Ran this paper's copy was not recorded; identical code first harvested from lucidrains/En-transformer
pointer only · get_code("f2fe51a4a5646c6f")
update_alpha_time_word Ran hansam95/nmg/prompt_to_prompt/ptp_utils.py
code served (permissive licence) · get_code("35d28dc49040562c")
AttentionControl Not yet run hansam95/nmg/prompt_to_prompt/ptp_utils.py
code served (permissive licence) · get_code("2f95aad416a92bda")
AttentionControlEdit Not yet run hansam95/nmg/prompt_to_prompt/ptp_utils.py
code served (permissive licence) · get_code("8681c8453f5e2137")
LocalBlend Not yet run hansam95/nmg/prompt_to_prompt/ptp_utils.py
code served (permissive licence) · get_code("8a805bc148037fbd")
get_matrix Not yet run miguelCalado/prompt-to-prompt-tensorflow/seq_aligner.py
code served (permissive licence) · get_code("81db21bf982ca0fe")
get_time_words_attention_alpha Not yet run hansam95/nmg/prompt_to_prompt/ptp_utils.py
code served (permissive licence) · get_code("b84383c30daa723c")
register_attention_control Not yet run phymhan/prompt-to-prompt/ptp_utils.py
code served (permissive licence) · get_code("ea0c551b3830dfeb")
register_attention_control Not yet run google/prompt-to-prompt/ptp_utils.py
code served (permissive licence) · get_code("5427f43aa7709411")

Repositories linked to this paper

Some links come from the archived Papers with Code dataset (CC BY-SA 4.0): attribution and licence.

Abstract

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-toprompt 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. * Performed this work while working at Google.

For agents

The same record, over MCP at https://syntology.ai/mcp:

get_harvested_code_for_paper("2208.01626")
get_code_for_paper("2208.01626")
have("2208.01626")

Connect an agent — have() is free.