Our new X account is live! Follow @wizwand_team for updates
WorkDL logo mark

Prompt-to-Prompt Image Editing with Cross Attention Control

About

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.

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

Related benchmarks

TaskDatasetResultRank
Image EditingPIE-Bench
PSNR27.54
116
Image ReconstructionMS-COCO 2017 (val)--
20
Image Semantic EditingPIE-Bench (test)
PSNR17.87
18
Image ReconstructionCOCO (val)
MSE0.019
15
Image Editing1024 x 1024 resolution
Runtime (4090, s)17.59
14
Image EditingEditEval v2
LPIPS0.499
14
Image Tone AdjustmentAnyEdit PIE-Bench
SSIM0.736
12
Text-Guided Image EditingGeneral Image Editing
Speedup1
12
Illumination-preserving image editing16 concepts under seven illuminants 1.0 (test)
Angular Error15.03
12
Text AlignmentUser Study
Average Ranking3.4
12
Showing 10 of 55 rows

Other info

Follow for update