Add-it: Training-Free Object Insertion in Images With Pretrained Diffusion Models

## Abstract

Abstract Adding Object into images based on text instructions is a challenging task in semantic image editing, requiring a balance between preserving the original scene and seamlessly integrating the new object in a fitting location. Despite extensive efforts, existing models often struggle with this balance, particularly with finding a natural location for adding an object in complex scenes. We introduce Add-it , a training-free approach that extends diffusion models’ attention mechanisms to incorporate information from three key sources: the scene image, the text prompt, and the generated image itself. Our weighted extended-attention mechanism maintains structural consistency and fine details while ensuring natural object placement. Without task-specific fine-tuning, Add-it achieves state-of-the-art results on both real and generated image insertion benchmarks, including our newly constructed ” Additing Affordance Benchmark” for evaluating object placement plausibility, outperforming supervised methods. Human evaluations show that Add-it is preferred in over 80% of cases, and it also demonstrates improvements in various automated metrics.
Our code and data will be available at: https://research.nvidia.com/labs/par/addit/

## 1 Introduction

Adding objects to images based on textual instructions is a challenging task in image editing, with numerous applications in computer graphics, content creation and synthetic data generation. A creator may want to use text-to-image models to iteratively build a complex visual scene, while autonomous driving researchers may wish to draw pedestrians in new scenarios for training their car-perception system. Despite considerable recent research efforts on text-based editing, this particular task remains a challenge . When adding objects, one needs to preserve the appearance and structure of the original scene as closely as possible, while inserting the novel objects in a way that appears natural. To do so, one must first understand affordance—the deep semantic knowledge of how people and objects interact, in order to position an object in a reasonable location. For brevity, we call this task Image Additing.

Several studies (Hertz et al., ; Meng et al., ) tried addressing this task by leveraging modern text-to-image diffusion models. This is a natural choice since these models embody substantial knowledge about arrangements of objects in scenes and support open-world conditioning on text. While these methods perform well for various editing tasks, their success rate for adding objects is disappointingly low, failing to align with both the source image and the text prompt.
In response, another set of methods took a more direct learning approach (Brooks et al., ; Zhang et al., ; Canberk et al., ). They trained deep models on large image editing datasets, pairing images with and without an object to add. However, these often struggle with generalization beyond their training data, falling short of the general nature of the original diffusion model itself. This typically manifests as a failure to insert the new object, the creation of visual artifacts, or more commonly – failing to insert the object in the correct place, i.e. struggling with affordances.
Indeed, we remain far from achieving open-world object insertions from text instructions.

Here we describe an open-world, training-free method that can successfully leverage the knowledge stored in text-to-image foundation models, to naturally add objects into images. As a guiding principle, we propose that addressing the affordance challenge requires methods to carefully balance between the context of the existing scene and the instructions provided in the prompt. We achieve this by: first, extending the multi-modal attention mechanism (Esser et al., ) of recent T2I diffusion models to also consider tokens from a source image; and second, controlling the influence of each multi-modal attention component: the source image, the target image and the text prompt.
A main contribution of this paper is a mechanism to balance these three sources of attention during generation. We also apply a structure transfer step and introduce a novel subject-guided latent blending mechanism to preserve the fine details of the source image while enabling necessary adjustments, such as shadows or reflections. Our full pipeline is shown at fig. 2.
We name our method Add-it.

Image Additing methods typically face three main failure modes: neglect, appearance, and affordance. While current CLIP-based evaluation protocols can partially assess neglect and appearance, there is a lack of reliable methods for evaluating affordance. To address this gap, we introduce the “Additing Affordance Benchmark,” where we manually annotate suitable areas for object insertion in images and propose a new protocol specifically designed to evaluate the plausibility of object placement. Additionally, we introduce a metric to capture object neglect. Add-it outperforms all baselines, improving affordance from 47% to 83%. We also evaluate our method on an existing benchmark (Sheynin et al., ) with real images, as well as our newly proposed Additing Benchmark for generated images. Add-it consistently surpasses previous methods, as reflected by CLIP-based metrics, our object inclusion metric, and human preference, where our method is favored in over 80% of cases, even against methods specifically trained for this task.

Our contributions are as follows: (i) We propose a training-free method that achieves state-of-the-art results on the task of object insertion, significantly outperforming previous methods, including supervised ones trained for this task. (ii) We analyze the components of attention in a modern diffusion model and introduce a novel mechanism to control their contribution, along with novel Subject Guided Latent Blending and a noise structure transfer. (iii) We introduce an affordance benchmark and a new evaluation protocol to assess the plausibility of object insertion, addressing a critical gap in current Image Additing evaluation methods.

## 2 Related Work

#### Object Placement and Insertion.

Inserting objects into images remains a core challenge in image editing. Traditional computer graphics methods often depend on manual object placement (C. Wang, ) or utilize synthetic data-driven approaches (Fisher et al., ). Early computer vision techniques employed contextual cues to predict possible object positions (Choi et al., ; Lin et al., ; Zhao et al., ). With advancements in deep learning, generative models have been trained to learn object placements. For example, Compositing GAN (Azadi et al., ) generates object composites by refining geometry and appearance, while RelaxedPlacement (Lee et al., ) optimizes object placement and sizing based on relationships depicted in scene graphs. OBJect3DIT (Michel et al., ) explores 3D-aware object insertion guided by language instructions, primarily using synthetic data. Despite their effectiveness, these methods often struggle with the complexities of real-world placement scenarios.

#### Editing with Text-to-Image Diffusion Models.

The emergence of high-performing text-to-image diffusion models (Rombach et al., ; Saharia et al., ; Ramesh et al., ; Balaji et al., ; Esser et al., ) has paved the way for effective text-based image editing techniques.
Methods like Prompt-to-Prompt (Hertz et al., ) modify attention maps by injecting the input caption’s attention into the target caption’s attention, while SDEdit (Meng et al., ) uses a stochastic differential equation to iteratively denoise and enhance the realism of user-provided pixel edits. For editing real images, inversion techniques (Mokady et al., ; Wallace et al., ; Pan et al., ; Samuel et al., ; Deutch et al., ; Huberman-Spiegelglas et al., ; Tsaban & Passos, ; Brack et al., ; Garibi et al., ) first invert an input image to its latent noise representation using a given caption, enabling edits via methods like SDEdit or Prompt2Prompt.
Cao et al. () further improves real image editing using a mutual extended self-attention mechanism, an idea later extended to an array of generation (Tewel et al., ) and editing tasks like style- and appearance-transfer (Alaluf et al., ; Hertz et al., ) or object-dragging (Avrahami et al., ).
Despite their effectiveness in various tasks, these methods struggle with object addition, often failing to align new objects with both the original image and the text prompt.

To improve editing performance, several methods proposed to directly fine-tune diffusion models.
Imagic (Kawar et al., ) fine-tunes text embeddings (Gal et al., ) and the diffusion U-Net (Ronneberger et al., ) to handle complex textual instructions, whereas Text2LIVE (Bar-Tal et al., ) and Blended Diffusion (Avrahami et al., ) blend edited regions throughout the generation. InstructPix2Pix (Brooks et al., ) introduced an instructable image editing model trained on a large synthetic dataset for instruction-based edits, while MagicBrush (Zhang et al., ) enhances this approach by fine-tuning InstructPix2Pix on a manually annotated dataset collected through an online editing tool. EmuEdit (Sheynin et al., ) trains a diffusion model on a large
synthetic dataset to perform different editing tasks given a task embedding. EraseDraw (Canberk et al., ) leverages
inpainting models to automatically generate high-quality training data for learning object insertion.
They show that one can train models to realistically insert diverse objects into images based on language instructions.

Despite advancements in instruction-based image editing, we demonstrate that current methods still face significant challenges in accurately interpreting and executing object addition within images. In this paper, we propose a novel approach addressing the challenging task of object insertion. We show that by controlling the various attention components in the diffusion model, one can add new objects to existing images without further training or fine-tuning of the diffusion model.

Figure: Figure 2: Architecture outline: Given a tuple of source noise $X_{source}^{T}$, target noise $X_{target}^{T}$, and a text prompt $P_{target}$, we first apply Structure Transfer to inject the source image’s structure into the target image. We then extend the self-attention blocks so that $X_{target}^{T}$ pulls keys and values from both $P_{target}$ and $X_{source}^{T}$, with each source weighted separately. Finally, we use Subject Guided Latent Blending to retain fine details from the source image.
Refer to caption: x2.png

## 3 Method

Our goal is to insert an object into a real or generated image using a simple textual prompt, ensuring the result appears natural and consistent with the source image. To achieve this, we leverage a pretrained diffusion model without any additional training or optimization. Our solution consists of three core components: (1) a weighted extended self-attention mechanism that balances information from the source image, text prompt, and target image, (2) a noising approach that preserves the source image’s structure, and (3) a novel Subject-Guided Latent Blending mechanism to retain fine background details. For real images, we also introduce an inversion step, detailed below.

### 3.1 Preliminaries: Attention in MM-DiT blocks

Modern Diffusion Transformers (DiTs) models, such as SD3 (Esser et al., ) and FLUX (Black-Forest, ), process concatenated sequences of textual-prompt and image-patch tokens through unified multi-modal self-attention blocks (MM-DiT blocks). Specifically, FLUX has two types of attention blocks: Multi-stream blocks which use separate projection matrices (${\bm{W}}_{K},{\bm{W}}_{V},{\bm{W}}_{Q}$) for text and image tokens, and Single-stream blocks where the same projection matrices are used for both. Both block types compute attention on the concatenated tokens as follows:

$$ $A=\textit{softmax}([Q_{p},Q_{img}][K_{p},K_{img}]^{\top}/\sqrt{d_{k}}),\quad h =A\cdot[V_{p},V_{img}]$ (1) $$

where $Q_{p}$, $Q_{img}$ are the textual-prompt and the image-patch queries, respectively. The same applies to $K$ and $V$.
Notably, Flux is composed of a series of Multi-stream blocks followed by a series of Single-stream blocks.

### 3.2 Weighted Extended Self-Attention

Our approach builds on top of the attention mechanism in MM-DiT blocks. In this attention mechanism, tokens are drawn from two sources: the image patches $X_{image}$ and the textual prompt $P$. In prior attention-based diffusion architectures, it was shown that the appearance of a source image can be transferred to a target through an extended self-attention mechanism, where the new image can attend to the tokens of the source. We propose a similar extension here, by allowing the multi-modal attention to include another source — the tokens of the input image we wish to edit. More formally, we define the three sources of information as: the source image $X_{source}$, the generated image $X_{target}$ and the textual prompt describing the edit $P_{target}$. To compute the source image tokens, we simply denoise it in parallel to the target image, and concatenate its keys and values to the self-attention blocks, extending eq. 1:

$$ $A=\textit{softmax}([Q_{p},Q_{target}][K_{source},K_{p},K_{target}]^{\top}/ \sqrt{d_{k}}),\quad h=A\cdot[V_{source},V_{p},V_{target}]$ (2) $$

where $K_{source}$ and $V_{source}$ are the keys and value extracted from the source image, and $K_{p}$, $V_{p}$, $K_{target}$, $V_{target}$ are the keys and values from the prompt and target image respectively. When $X_{source}$ is a generated image, denoising it in parallel is trivial - we simply need to start denoising from the same seed that created $X_{source}$. Dealing with a real image is more complicated, and we will describe our solution in the inversion section below.

However, we notice that simply appending the keys and values of the source image to the attention blocks leads to the source image controlling the attention, which in turn leads to neglect of the edit prompt, with the final generated image being a simple copy of the source image. We explore the dynamics of this phenomenon in detail in section 5. To avoid this effect, we can re-balance the contribution of different attention components by weighting their keys. Indeed, by reducing the weight of the source image tokens, we can achieve better balance and allow for more changes. However, if this is not done carefully, then we risk upsetting the balance in the opposite fashion and seeing alignment with the source image completely ignored. Hence, we can introduce a weighting term to each source of information, giving us the following multi-modal attention equation:

$$ $\displaystyle A$ $\displaystyle=\textit{softmax}([Q_{p},Q_{target}][\gamma_{s}\cdot K_{source}, \gamma_{p}\cdot K_{p},\gamma_{t}\cdot K_{target}]^{\top}/\sqrt{d_{k}})$ (3) $\displaystyle h$ $\displaystyle=A\cdot[V_{source},V_{p},V_{target}]$ $$

where $\gamma_{s}$, $\gamma_{p}$, $\gamma_{t}$ represent the weighting terms for the source image, the prompt, and the target image, respectively. In section 5 we explore the dynamics of the attention distribution across these three sources. In practice, we find that it is necessary to balance two key terms: the first is the attention distributed over the source image $A_{\text{source}}\!=\!\frac{\exp(Q_{p}\cdot K_{\text{source}})}{Z}$
and the second is the attention distributed over the target image, $A_{\text{target}}\!=\!\frac{\exp(\gamma\cdot Q_{p}\cdot K_{\text{target}})}{Z}$, where $Z$ is the softmax normalization term. To determine $\gamma$ we define the function $f(\gamma)\!=\!A_{\text{source}}\!-\!A_{\text{target}}$ and use a root-solver algorithm to find $\gamma$ such that $f(\gamma)\!=\!0$.

### 3.3 Structure Transfer

The weighted extended-attention mechanism allows to balance between information from the source image and the prompt, but the added objects do not always adhere to the image context (e.g. dog is too big for the chair). We attribute this issue to different seeds dictating specific structures in the generated image, which do not always align with the source image. We show that effect in fig. 8, where images generated with the same seed produce similar objects with or without the extended attention mechanism. To address this problem, we propose to ”choose” seeds with a structural similarity to the source image. We do so by noising the source latent $X_{source}$ to a very high noise level $t_{\textit{struct}}$ with randomly sampled noise $\epsilon\sim\mathcal{N}(0,I)$ following the recitified flow denoising formula $X_{t}=(1-\sigma_{t})x_{0}+\sigma_{t}\epsilon$. When $t_{\textit{struct}}$ is high enough, starting the denoising process from $X_{t_{\textit{struct}}}$ will result in an image with similar global structure to the source image, while still allowing for changes to image content as demonstrated in fig. 8.

### 3.4 Subject Guided Latent Blending

The combination of structure transfer and the weighted attention mechanism ensures that the target image remains consistent with the structure and appearance of the source image, though some fine details, such as textures and small background objects, may still change. Our goal is to preserve all elements of the source image not affected by the added object. To achieve this, we propose Latent Blending; A naive approach would involve identifying the pixels unaffected by the object insertion and keeping them identical to those in the source image. However, two challenges arise: First, a perfect mask is needed to separate the object from the background to avoid artifacts. Second, we aim to preserve collateral effects from the object insertion, such as shadows and reflections. To address these issues, we propose generating a rough mask of the object, which is then refined using SAM-2 (Ravi et al., ) to obtain a final mask $M$. We then blend (Avrahami et al., ) the source and target noisy latents at timestep $T_{blend}$ based on this mask.

To extract the rough object mask, we gather the self-attention maps corresponding to the token representing the object. We achieve this by multiplying the queries from the target image patches, $Q_{target}$, with the key associated with the added object token, $k_{object}$. These maps are then aggregated across specific timesteps and layers that we identified as generating the most accurate results (further details can be found in the section A.1. We then apply a dynamic threshold to the attention maps using the Otsu method (Otsu, ) to obtain a rough object mask, $M_{r}$. Finally, we refine this mask using the general-purpose segmentation model, SAM-2.
Since SAM-2 operates on images rather than noisy latents, we first estimate an image, $X_{0}$, from the model’s velocity prediction, $v_{\theta}$, using the formula $X_{0}=X_{T_{blend}}+(\sigma_{T_{blend}+1}-\sigma_{T_{blend}})\cdot v_{\theta}$.
In addition to an input image, SAM-2 requires a localization prompt in the form of points, a bounding box, or an input mask. In our method, we provide input points, as they tend to produce the most accurate masks. To extract these localization points, we iteratively sample local maxima from the attention maps - full details of this sampling process are provided in section A.1. Using these input points, we generate the refined object mask, $M$. Finally, we apply a simple latent blending step at timestep $T_{blend}$, where we compute $Z_{\text{target}}=M\odot Z_{\text{target}}+(1-M)\odot Z_{\text{source}}$. We present results with and without latent blending, along with the resulting mask $M$, in fig. 9.

### 3.5 Additing Real Images and Step-by-Step Generation

In the previous sections, we described our method for generating an edited image by drawing information from a source image within the same batch. When editing a generated image, this process is straightforward: one can save the source noise, $\epsilon_{source}$, that generated the source image and create an input batch containing both $\epsilon_{source}$ and a random noise, $\epsilon_{target}$, used to generate the target image. However, when editing an existing image, $x_{source}$, we do not have access to its original noise. A common approach would be to use an inversion method to recover the original noise, $\epsilon_{source}$, that generated $X_{source}$. However, in our experiments, popular inversion methods, such as DDIM inversion (Song et al., ), do not adequately reconstruct the image using FLUX. We propose a simple solution: instead of recovering the original noise $\epsilon_{source}$, we sample a random noise $\epsilon$. At each denoising step $t$, we produce a noisy source latent, $X^{t}_{source}=(1-\sigma_{t})X_{source}+\sigma_{t}\epsilon$. We then apply our method as usual, using the input batch at timestep $t$, $[X^{t}_{source},X^{t}_{target}]$, where the target image draws information from the source image. This simple technique ensures perfect reconstruction of the source image, since $\sigma_{0}=0$ and therefore $X^{0}_{source}=X_{source}$.

Our method, applicable to both generated and real images, can be extended for step-by-step generation. Users can start with an initial image from a textual prompt and iteratively modify it with additional prompts, progressively adding elements or changes to the scene. Examples of step-by-step generation are shown in fig. 1 and fig. 11.

**Table 1: Comparison of methods based on Affordance score for the Additing Affordance Benchmark.**
|  | I-Pix2Pix | Erasedraw | Magicbrush | SDEdit | P2P | Ours |
| --- | --- | --- | --- | --- | --- | --- |
| Affordance | 0.276 | 0.341 | 0.418 | 0.397 | 0.474 | 0.828 |

Figure: Figure 3: User Study results evaluated on the real images from the Emu Edit Benchmark.
Refer to caption: x3.png

**Table 2: CLIP and Inclusion metric results for EmuEdit and Additing Benchmark.**
|  | Emu Edit | Additing Benchmark |  |  |  |  |  |  |
| --- | --- | --- | --- | --- | --- | --- | --- | --- |
| Method | $\text{CLIP}_{dir}$ | $\text{CLIP}_{out}$ | $\text{CLIP}_{im}$ | Inc. | $\text{CLIP}_{dir}$ | $\text{CLIP}_{out}$ | $\text{CLIP}_{im}$ | Inc. |
| InstructPix2Pix | 0.074 | 0.312 | 0.929 | 34% | 0.074 | 0.244 | 0.943 | 55% |
| Erasedraw | 0.088 | 0.313 | 0.941 | 65% | 0.117 | 0.248 | 0.958 | 76% |
| Magicbrush | 0.091 | 0.313 | 0.927 | 66% | 0.114 | 0.250 | 0.925 | 86% |
| SDEdit | — | — | — | — | 0.091 | 0.248 | 0.955 | 60% |
| Prompt2Prompt | — | — | — | — | 0.170 | 0.280 | 0.850 | 97% |
| Ours | 0.101 | 0.322 | 0.929 | 81% | 0.200 | 0.261 | 0.968 | 93% |

Figure: Figure 5: Qualitative Results from the Emu-Edit Benchmark. Unlike other methods, which fail to place the object in a plausible location, our method successfully achieves realistic object insertion.
Refer to caption: x5.png

Figure: Figure 6: Qualitative Results from the Additing Benchmark. While Prompt-to-Prompt fails to align with the source image, and SDEdit fails to align with the prompt, our method offers Additing that adheres to both prompt and source image.
Refer to caption: x6.png

## 4 Experiments

#### Evaluation Baselines

We compare our method with two classes of baselines: (1) Training-Free methods that leverage the existing capabilities of text-to-image models: Prompt-to-Prompt (Hertz et al., ), a method which injects the attention map of the source image into the target image to preserve its structure, and SDEdit (Meng et al., ), a method that adds partial noise to an existing image and then denoises it. Both methods were re-implemented on the FLUX.1-dev model for fair comparison. (2) Pretrained Instruction following models, specifically trained to edit and add objects to existing images: InstructPix2Pix (Brooks et al., ) an instruction following model trained on a large scale of synthetic instruction data, Magicbrush (Zhang et al., ) a version of InstructPix2Pix fine-tuned on manually annotated editing dataset, and Erasedraw (Canberk et al., ) a model trained on large dataset constructed using an inpainting model. Add-it implementation details can be found in section A.1.

#### Metrics

We evaluate the results of our method and the baselines using automatic metrics and human evaluations for each source and target image-caption pair. Automatic Metrics: we start by adopting the CLIP (Radford et al., ) based metrics proposed in Emu-Edit (Sheynin et al., ): (i) $\text{CLIP}_{dir}$ (Gal et al., ) measures the agreement between change in captions and the change in images. (ii) $\text{CLIP}_{img}$ measures similarity between source and target images. (iii) $\text{CLIP}_{out}$ measures the target image and caption similarity. We propose two additional metrics: (iv) Inclusion measures the portions of cases the object was added to the image, evaluated automatically using the open-vocabulary detection model Grounding-DINO (Liu et al., ). (v) Affordance measures whether the object was added to a plausible location, utilizing Grounding-DINO and a manually annotated set of possible locations. Human Evaluations: we ask human raters to pick the best Additing output when faced with a source image, instruction and images generated by our method and a competing baseline. Further details in section A.5.

### 4.1 Evaluation results

#### Emu-Edit Benchmark

Following EraseDraw (Canberk et al., ) we evaluate our method on a subset of EmuEdit’s (Sheynin et al., ) validation set with the task class of ”Add”, designed for insertion instructions. The benchmark consists of sets of images and prompts before and after an edit, and the corresponding instruction.
Table 2 shows our model outperforms all previous approaches in the $\text{CLIP}_{dir}$, $\text{CLIP}_{out}$ and the Inclusion metrics. In the $\text{CLIP}_{im}$ metric, which indicates how close the edited image is to the source image, we are second only to Erasedraw. This result is not surprising given that in 35% of the cases Erasedraw did not add an object to the image (indicated by the Inclusion metric), artificially boosting the image similarity score. Due to the limitations of automatic metrics, especially in assessing the naturalness of edits, we conducted a head-to-head evaluation with human raters against each baseline, as shown in fig. 4. Our method’s outputs were preferred in  80% of cases. Finally, we present a qualitative comparison to other methods using images from the EmuEdit benchmark in fig. 5. Previous methods often produce artifacts, unnatural object placements, or fail to modify the image. In contrast, our method generates high-quality outputs that consider the context of the source image.

#### Additing Benchmark

To evaluate our method against both pre-trained models and zero-shot methods, which tend to perform better on generated images, we created a benchmark for the Additing task. We asked ChatGPT to generate 200 sets of source and target prompts along with Additing instructions. Using Flux, we generated images and filtered 100 sets where the instructions were viable. We report all results in Table 2. Our method outperforms all baselines on the $\text{CLIP}_{dir}$ and $\text{CLIP}_{im}$ metrics. Although Prompt-to-Prompt slightly surpasses us on $\text{CLIP}{out}$ and Inclusion, it does so by heavily altering the source image, as shown by its low $\text{CLIP}{im}$ score. As in the EmuEdit Benchmark, we asked human raters to compare our method against the zero-shot baseline. Our method was preferred in 90% of cases against Prompt2Prompt and 83% against SDEdit fig. 4. Finally,  fig. 6 shows a comparison on the Additing Benchmark, where other methods struggle to balance object addition, background preservation, and context, while ours produces natural, appealing outputs.

#### Additing Affordance Benchmark

Throughout our experiments we observed that the major shortcoming of existing methods is incorrect affordance, namely, objects are added at implausible locations (see the basket in  fig. 5). To automatically quantify affordance, we constructed an affordance benchmark. It contains 200 images and prompts, with manually annotated bounding-boxes indicating the plausible locations to add objects in each image. Dataset construction and evaluation protocol details are available in section A.4.
We present the results of all methods in  table 1. As expected, previous methods perform poorly, with low affordance scores, particularly trained models like InstructPix2Pix, which scored as low as 0.276. In contrast, Add-it scores nearly double that of the best-performing method, demonstrating its ability to balance information from the source image and target prompt.
We explore additional results of our method in section A.2.

Figure: Figure 7: (A) Affordance and Object Inclusion scores across weight scale values, with our automatic weight scale achieving a good balance between the two. (B) Visualization of the prompt token attention spread across different sources, model blocks, and weight scales, averaged over multiple examples from a small validation set. (C) A representative example demonstrating the effect of varying target weight scales.
Refer to caption: x7.png

Figure: Figure 8: Ablation over various steps for applying the Structure Transfer mechanism. Applying it too early misaligns the generated images with the source image’s structure while applying it too late causes the output image to neglect the object. Our chosen step strikes a balance between both.
Refer to caption: x8.png

Figure: Figure 9: Images generated by Add-it with and without the latent blending step, along with the resulting affordance map. The latent blending block helps align fine details from the source image, such as removing the girl’s glasses or adjusting the shadows of the bicycles.
Refer to caption: x9.png

## 5 Analysis

In this section, we analyze the attention distribution in the MM-DiT block and the key components of our method to better justify our design choices. In section A.3 we analyze the role of positional encoding in the extended-attention mechanism.

#### MM-DiT Attention Distribution

First, we analyze the different attention components in the extended MM-DiT blocks. Recall that in the extended-attention mechanism described in section 3.2 there are three token sets: the source image $X_{source}$, the target image $X_{target}$ and the prompt $P_{target}$. In our experiments, we notice that simply applying the extended attention mechanism results in the target image closely following the appearance of the source image while neglecting the prompt - meaning no object is added to the image. We attribute this problem to the way the attention is distributed across the three sets of tokens. In particular, we find empirically that the target prompt’s attention $A_{p}\propto\exp(Q_{p}\cdot[K_{source},K_{p},K_{target}])$ serves as an effective proxy for balancing the three sources of attention. A simple way to control the attention distribution is by introducing scale factor $\gamma_{p},\gamma_{target}$ so that $A_{p}\propto\exp(Q_{p}\cdot[K_{source},\gamma_{p}\cdot K_{p},\gamma_{target}
\cdot K_{target}])$. In practice, we find that using $\gamma=\gamma_{p}=\gamma_{target}$ is adequate.
In fig. 7 (B) we visualize the prompt attention $A_{p}$ spread across the three token sets. In the standard extended-attention case ($\gamma=1.0$), the source image tokens (purple) receive more attention than the target image tokens (orange), preventing the generated image from incorporating the added object. On the other hand when scaling up too much ($\gamma=1.2$), the target image tokens overwhelm the source image token, causing the output image to stray away from the source image structure. Finally, when the scaling value balances the attention between $X_{source}$ and $X_{target}$ ($\gamma=\mathrm{Auto}$), the output image successfully incorporates the added object, while preserving the target image structure and taking into account its context when placing the object. These observations are qualitatively shown in fig. 7 (C) and are also reflected in fig. 7 (A), where the scale that balances the attention offers a good balance between affordance and Object Inclusion.

#### Ablation Study

Next, we evaluate the impact of different components of our method. First, we demonstrate the effect of the weight scale, $\gamma$. In fig. 7 (A) we present a graph showing affordance and Object Inclusion as functions of different weight scales. As the weight scale increases, the added object tends to appear more frequently in the image. However, beyond a certain threshold, the affordance score drops. This decline occurs when the target image ignores the structure of the source image, generating objects in unnatural locations, as illustrated in fig. 7 (C).
Next, we explore the effect of latent blending. In fig. 9 we show output images with and without the latent blending step, along with the affordance map automatically extracted by our method. Notice how the blending step aligns the fine details of the source image without introducing artifacts.
Finally, we examine the structure transfer component. In fig. 8 we illustrate the effect of applying the structure transfer step at different stages of the denoising process. When the structure transfer is applied too early, the affordance score is low, meaning the target image does not adhere to the structure of the source image. On the other hand, applying it later in the process results in a lower object inclusion metric, indicating that the target image neglects the object. Ultimately, when the structure transfer is applied at $t=933$, we achieve a balance between object inclusion and affordance. A qualitative example is also provided in fig. 8.

Figure: Figure 10: Add-it may fail to add a subject that already exists in the source image. When prompted to add another dog to the image, Add-it generates the same dog instead, though it successfully adds a person behind the dog.
Refer to caption: x10.png

## 6 Limitations

Add-it shows strong performance across various benchmarks, but it has some limitations. Since the method relies on pretrained diffusion models, it may inherit biases from the training data, which could affect object placement in unfamiliar or highly complex scenes. Additionally, because our method uses target prompts rather than explicit instructions, users may need to construct more detailed prompts to achieve the same edit. For instance, with an image of a dog, the prompt “A dog” won’t add another dog to the scene, as seen in fig. 10. Instead, the user would need to provide alternative prompts, such as “Two dogs sitting on the grass”. Lastly, we observe that Additing on real images is still not as effective as it is on generated images. We attribute this shortcoming to the current FLUX inversion algorithm and believe that a more advanced inversion algorithm could help bridge this gap. Additional failure cases of the model are presented in fig. 16.

## 7 Conclusion

We introduced Add-it, a training-free method for adding objects to images using simple text prompts.
We analyzed the attention distribution in MM-DiT blocks and introduced novel mechanisms such as weighted extended-attention and Subject-Guided Latent Blending.
Additionally, we addressed a critical gap in evaluation by creating the ”Additing Affordance Benchmark,” which allows for an accurate assessment of object placement plausibility in image Additing methods.
Add-it consistently outperforms previous approaches, improving affordance from 47% to 83% and achieving state-of-the-art results on both real and generated image benchmarks. Our work demonstrates that leveraging the knowledge in pretrained diffusion models is a promising direction for tackling challenging tasks like image Additing. As diffusion models continue to evolve, methods like Add-it have the potential to drive further advancements in semantic image editing and related applications.

## Ethics Statement

In this work, we acknowledge the ethical considerations associated with image editing technologies. While our method enables advanced object insertion capabilities, it also has the potential for misuse, such as creating misleading or harmful visual content. We strongly encourage the responsible and ethical use of this technology, emphasizing transparency and consent in its applications. Additionally, biases present in pretrained models may affect generated outputs, and we recommend further research to mitigate such issues in future work. Human evaluations were conducted with informed consent.

## Acknowledgments

We thank Assaf Shocher, Lior Hirsch and Omri Kaduri for useful discussions and for providing feedback on an earlier version of this manuscript. This work was completed as part of the first author’s PhD thesis at Tel-Aviv University.

## Appendix A Appendix

### A.1 Implementation Details

#### Add-it

When evaluating Add-it, we use $t_{struct}=933$ for generated images and $t_{struct}=867$ for real images and $t_{blend}=500$. For the scaling factor $\gamma$, we use the root-finding solver described in section 3.2 on a set of validation images and set $\gamma$ to 1.05, as it is close to the average result and performs well in practice. We generate the images with 30 denoising steps, building upon the diffusers implementation of the FLUX.1-dev model. We apply the extended attention mechanism until step $t=670$ in the multi-stream blocks, and step $t=340$ for the single-stream blocks.

#### Latent Blending Localization

To extract a refined object mask as part of the Subject Guided Latent Blending component, we begin by extracting subject attention maps. Empirically, we find that the best-performing layers for this task are: ["transformer_blocks.13","transformer_blocks.14", "transformer_blocks.18", "single_transformer_blocks.23", "single_transformer_blocks.33"]. To refine the mask from these attention maps, we need to identify points to use as prompts for SAM-2. To extract points from the attention map, we first select the point with the highest attention value. Then, we exclude the area around the chosen point and select the next highest point. This process is repeated until we either identify 4 points or the current maximal point value falls below $0.35\cdot p_{max}$, where $p_{max}$ is the initial maximum attention value. Finally, we feed the points to the SAM-2 model to end up with a refined object mask.

Figure: Figure 11: Step-by-Step Generation: Add-it can generate images incrementally, allowing it to better adapt to user preferences at each step.
Refer to caption: x11.png

### A.2 Additional Results

In fig. 11 we present step-by-step outputs generated with Add-it. Notice that the scene remains unchanged, while each prompt adds an additional ”layer” to the final image, resulting in a more complex scene.

In fig. 12 we show additional results from the Additing Affordance benchmark. In each case, the object must be added to a specific location in the source image. Across all examples, Add-it successfully places the object in a plausible location, preserving the natural appearance of the image.

In fig. 13 we demonstrate that Add-it can operate on non-photorealistic source images, such as paintings and pixel art. Since our method requires no tuning, we preserve all the generation capabilities of the base model.

In fig. 14 we show various generation results produced by our model, each originating from a different initial noise. Our method preserves the diversity of the base model, enabling users to generate multiple variations of the added object until they find the desired one.

Figure: Figure 12: Qualitative results of our method on the Additing Affordance Benchmark show that our method successfully adds objects naturally and in plausible locations.
Refer to caption: x12.png

Figure: Figure 13: Our method can operate on non-photorealistic images.
Refer to caption: x13.png

Figure: Figure 14: Our method generates different outputs when given different starting noises. All the outputs remain plausible.
Refer to caption: x14.png

Figure: Figure 15: Positional Encoding Analysis: shifting the positional encoding of the source image results in a corresponding shift in the object’s location in the generated image.
Refer to caption: x15.png

Figure: Figure 16: Failure cases: Add-it may fail generating the added object in the right location (sunglasses), it can be biased to replace existing object in the scene (Pikachu) and it can struggle with complicated scenes (woman cooking).
Refer to caption: x16.png

### A.3 The Role of Positional Encoding

Here, we examine the significance of positional encodings in the extended attention mechanism. fig. 15 demonstrates their role through a simple experiment: we applied our method to a source image where the positional encoding vectors were shifted down and to the right. This misalignment resulted in a mismatch between the positional encoding of the child’s head in the source and target images. Consequently, instead of generating headsets at the actual position of the child’s head, the model produced them in the area corresponding to the ”shifted head” position. This outcome demonstrates that the model heavily relies on positional information to transfer features between the source and target images. Despite the target image containing ”laptop” features instead of ”head” features at the relevant location, the model chose to place the headphones there. This decision was based on the area having the same positional encoding as the ”head area” in the source image, rather than on the actual content of the target image at that location. We believe further research on the role of positional encoding vectors is an interesting direction for future work in the context of DiT models.

### A.4 Additing Affordance Benchmark

#### Dataset Construction

Here, we provide the details for constructing the Additing Affordance Benchmark dataset. First, we used ChatGPT-4 to generate a dataset of tuples, each consisting of a source prompt and a target prompt, representing an image before and after object insertion, along with an instruction for the transition and a subject token representing the object to be added. The exact prompt is shown in fig. 18. Next, we used FLUX.1-dev to generate the source images from the source prompts in each tuple. We manually filtered out images where the object had no plausible location or too many possible locations, resulting in a dataset of 200 images. Finally, we manually annotated bounding boxes for each image, marking the plausible locations where the object could be added, as shown in fig. 17.

#### Evaluation protocol:

Given a set of an Additing model output images, we use Grounding-DINO to detect the area where new objects were added and set the affordance score of a single image to be the fraction of added object that at least 0.5 of their area falls inside the GT box.

Figure: Figure 17: Visual examples from the Additing Affordance Benchmark. Each image is annotated with bounding boxes highlighting the plausible areas where the object can be added.
Refer to caption: x17.png

Figure: Figure 18: The prompt provided to ChatGPT in order to generate the Affordance Benchmark.

### A.5 User Study Details

We evaluate the models through an Amazon Mechanical Turk user study using a two-alternative forced choice protocol. In the study, raters saw an instruction, a source image, and two edited images, each produced by a different approach. They chose the edit that best followed the instruction, taking into account: image quality and realism, instruction following and preservation of the source image. For the evaluation, each head-to-head example was rated by two raters. In fig. 19 we show an example of a single trial a rater has seen.

Figure: Figure 19: One trial of the Additing user study.
Refer to caption: x18.png

## Peer Reviews

confidence: 4
contribution: 3
initial_rating: 6
presentation: 3
questions: - Did the authors experiment with using a coarse mask as an input for SAM2? If so, how does it perform compared to point-based prompts?
- In the ablation study, the authors claim that setting \gama = auto yields the best results. However, Figure 7(a) appears to show a peak at approximately 1.07, which surpasses the performance of the auto setting.
soundness: 3
strengths: - **Clarity and Presentation.** The paper is well-written and easy to follow. The figures are thoughtfully designed and effectively illustrate the proposed method.
- **Visual Quality.**  The results are visually compelling; the added objects are integrated seamlessly, with the original image's details preserved well.
summary: This paper introduces Add-it, a novel, training-free method for inserting objects into images based on text instructions. The approach extends multi-modal self-attention mechanisms in Diffusion Transformer to incorporate a source image as an additional input, reweighting the attention values to effectively balance information between source and target images. Furthermore, the method transfers structural details from the source image and blends the latent representation with guidance from SAM2. To validate Add-it, the authors propose a new benchmark and a custom evaluation metric, demonstrating its effectiveness.
weaknesses: - **Dataset Size.** The evaluation affordance dataset is relatively small, containing only 200 images, which may limit the generalizability of the findings.

- **Computation Speed.** The need to run additional models (e.g., SAM2) for mask estimation could impact processing speed, especially in comparison to the original FLUX. It would be valuable to provide a direct comparison regarding computational efficiency.

- **Prompt Complexity.** *Add-it* requires text prompts for target images and thus may introduce additional complexity. Previous methods like InstructPix2Pix or MagicBrush may offer a more straightforward user experience.

---

confidence: 3
contribution: 3
initial_rating: 6
presentation: 2
questions: Please refer to the weakness. Anyway, from my view as a Diffusion Models researcher, adding objects to images is a pretty hard task. Although this paper is having several limitations, I still like the basic idea.
soundness: 3
strengths: 1. The paper proposes a novel training-free method called Add-it for adding objects to both real and generated images using simple textual prompts. The method doesn't require fine-tuning or training a separate model for object insertion. Instead, it directly leverages the knowledge embedded within pretrained text-to-image diffusion models. 

2. Add-it extends the multi-modal attention mechanism of diffusion models to carefully balance information from three key sources: the source image, the text prompt, and the generated image itself. 

3. Add-it introduces a novel Subject-Guided Latent Blending mechanism to preserve the fine details of the source image while enabling necessary adjustments like shadows and reflections.
summary: Add-it leverages pretrained diffusion models to insert objects into images based on text prompts, without requiring any training. 
The method extends the multi-modal attention mechanism to incorporate information from the source image, prompt, and generated image, resulting in natural object placement.  
Add-it also introduces a novel “Additing Affordance Benchmark” to evaluate object placement plausibility.
weaknesses: 1. Lack of comparison with the existing methods for adding objects [1,2]. Both of them have codes and have been released half a year ago.

2. The paper doesn't fully discuss the potential limitations of relying on SAM-2 for refining the object mask. SAM is a large powerful segmentation model, might not always accurately capture the desired object boundaries. There are also papers using self-attention and cross-attention maps to relieve this requirement [3,4].

3. The paper only briefly mentions potential biases inherited from the pretrained diffusion models. These biases could impact the object placement in unexpected ways. For instance, the model might consistently place objects associated with certain demographics in specific locations based on learned biases, potentially leading to unfair or discriminatory outcomes. 

[1] Paint by Inpaint: Learning to Add Image Objects by Removing Them First
[2] ObjectAdd: Adding Objects into Image via a Training-Free Diffusion Modification Fashion
[3] Localizing Object-level Shape Variations with Text-to-Image Diffusion Models
[4] Dynamic Prompt Learning: Addressing Cross-Attention Leakage for Text-Based Image Editing

---

confidence: 4
contribution: 2
initial_rating: 5
presentation: 3
questions: 1. Could you please briefly outline the advantages of the benchmark you've proposed over the existing benchmarks? It would be particularly helpful if you could illustrate these advantages with some statistical data.
2. Have you experimented with modifying the input to incorporate multiple target objects, or just edit it? eg. in the second line of the fig 6 in your paper, the prompt change to "The man is holding a shopping bag in the rain." or "The man wears a red shirt".
3. Although your paper focuses on the 'Add-it' method, I'm curious to know if this editing approach could also be adapted to perform operations like 'remove something' from the image.
4. could you please provide more details about Structure Transfer?
soundness: 3
strengths: 1. The writing is concise, which makes the paper easy to follow and understand.
2. The method is straightforward and innovatively.
3. The experimental results substantiate the effectiveness of the method proposed in this paper.
summary: This paper introduces Add-it, a training-free method leveraging extended attention mechanisms to seamlessly integrate objects into images from text instructions. Besides, it shows a new benchmark for evaluating object placement plausibility.
weaknesses: 1. The newly introduced benchmark's advantages over other benchmarks are not clearly articulated, and there is a lack of comparison with more existing benchmarks, like MagicBrush. 
2. The paper lacks comparison with traditional image quality metrics such as FID and IS, which are commonly used to evaluate the quality of generated images in terms of their realism and diversity.
3. Moreover, while a new benchmark is proposed, there seems to be a scarcity of details regarding it in the paper.

---

confidence: 4
contribution: 2
initial_rating: 5
presentation: 3
questions: The findings in lines 210-212 are interesting. I am curious whether this phenomenon arises from differences in the text encoder or the diffusion model architecture. Could the authors provide insights into the underlying reasons for this observation?
soundness: 2
strengths: 1. The paper proposes a training-free method that achieves state-of-the-art results in object insertion.
2. The analysis of MM-DiT Attention Distribution is interesting and introduces an effective mechanism to control their contribution.
3. The paper Introduces a benchmark to assess the plausibility of object insertion.
4. The writing and presentation are mostly clear and easy to follow. The authors provide hyperparameters and detailed settings used in experiments and method implementation, which is helpful for reproducibility.
summary: The paper proposes a tuning-free method for adding objects into images based on text instructions. They introduce Add-it, a training-free approach that extends the attention mechanisms of diffusion models to incorporate information from three key sources: the scene image, the text prompt, and the generated image itself. The experimental results show that it effectively maintains structural consistency and fine details while ensuring natural object placement compared to existing approaches.
weaknesses: The proposed techniques are incremental, lacking sufficient novelty to make a significant contribution to the field. The WEIGHTED EXTENDED SELF-ATTENTION, STRUCTURE TRANSFER, and SUBJECT GUIDED LATENT BLENDING methods are commonly used in Unet-based free-tuning image editing [1,2,3,4,5], and the modifications presented here do not represent a substantial advancement.

- In the WEIGHTED EXTENDED SELF-ATTENTION section, the approach of applying a coefficient to the key is similar to existing techniques in the community, such as scaling text embeddings [1]. This makes the proposed contribution appear incremental rather than innovative.
- In the STRUCTURE TRANSFER section, the proposed technique shows only minor improvements compared to SDEdit [2], without introducing a fundamentally new approach.
- In the SUBJECT GUIDED LATENT BLENDING section, similar blending operations have been previously demonstrated in [3, 4, 5]. Furthermore, using SAM to assist image blending, while effective, is a straightforward extension and lacks the originality needed to stand out.
- The selection of tuning-free editing baselines is also inadequate. Methods such as Masactrl [3], Proximal Guidance [4], and InfEdit [5] provide more sophisticated attention or mask control mechanisms. I recommend including a more comprehensive comparison with these existing baselines to better contextualize the contribution of the proposed method.

Other error:
Incorrect usage of quotation marks on line 237: The word 'choose' is improperly quoted.

[1] https://huggingface.co/docs/diffusers/using-diffusers/weighted_prompts#prompt-weighting

[2] C. Meng, Y. He, Y. Song, J. Song, J. Wu, J.-Y. Zhu, and S. Ermon, "SDEdit: Guided Image Synthesis and Editing with Stochastic Differential Equations," International Conference on Learning Representations (ICLR), 2022.

[3] M. Cao, X. Wang, Z. Qi, Y. Shan, X. Qie, and Y. Zheng, "MasaCtrl: Tuning-Free Mutual Self-Attention Control for Consistent Image Synthesis and Editing," Proceedings of the IEEE/CVF International Conference on Computer Vision (ICCV), 2023, pp. 22560-22570.

[4] L. Han, S. Wen, Q. Chen, Z. Zhang, K. Song, M. Ren, R. Gao, A. Stathopoulos, X. He, Y. Chen, D. Liu, Q. Zhangli, J. Jiang, Z. Xia, A. Srivastava, and D. N. Metaxas, "ProxEdit: Improving Tuning-Free Real Image Editing with Proximal Guidance," Proceedings of the IEEE/CVF Winter Conference on Applications of Computer Vision (WACV) 2024, pp. 4279-4289

[5] S. Xu, Y. Huang, J. Pan, Z. Ma, and J. Chai, "Inversion-Free Image Editing with Language-Guided Diffusion Models," Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), 2024, pp. 9452-9461.

Meta-review: The paper proposes a training-free approach to insert new objects into images based on text prompts, with a pretrained diffusion model. Reviewers acknowledge several strengths of the paper, including the good presentation, effectiveness of the proposed approach validated in experiments, and the novel and straightforward idea. The weaknesses proposed by reviewers include lack of comparison to other baseline approaches and other benchmarks, additional results, analysis, and ablations. The authors addressed these questions in the rebuttal and all reviewers give a positive score of 6. Area chair agree with reviewers and would recommend accepting this paper as poster.

Decision: Accept (Poster)