PC-Edit: Prompt-Contrastive Region Discovery and Region-Guided Editing Jian Zhang1 , Zhijun Zhang1 1
School of Electronic and Information Engineering, South China University of Technology, Guangzhou, China [email protected], [email protected] Project page: https://jianzhang-chick.github.io/PC-Edit/
arXiv:2607.21318v1 [cs.CV] 23 Jul 2026
Abstract Replacing an object with one that differs in category or shape requires complete source removal, natural target formation unconstrained by the source silhouette, and preservation of unrelated content. Existing training-free editors either localize edits from terminal predictions under source and target prompts or preserve unrelated content through spatially unselective source-feature reuse without explicit region discovery. Before reaching the terminal predictions, prompt-induced semantic differences undergo additional network transformations that may obscure their spatial localization, reducing localization precision. Spatially unselective feature reuse forces a tradeoff between edit completeness and background preservation. Therefore, we propose PC-Edit, a prompt-contrastive framework for training-free MM-DiT editing. PC-Edit contrasts the image-token attention outputs under the source and target prompts, capturing prompt-induced semantic differences directly where text-conditioned information is delivered to image tokens. The same contrast identifies a source-erasure region during inversion and a target-emergence region during denoising. Their union suppresses source remnants while allowing the target object to form naturally. PC-Edit further couples region discovery and background preservation within each sampling step by estimating the current edit region from preceding attention blocks and immediately injecting cached source K/V features outside it in subsequent blocks, thereby protecting unrelated content before the latent update. Experiments on PIE-Bench and our EditRegion-Bench, with humanverified edit-region annotations for single- and multi-object addition and replacement, show that PC-Edit achieves the best editing quality and background preservation among methods without user-specified edit regions.
Introduction Text-to-image generation has rapidly shifted from UNetbased latent diffusion (Rombach et al. 2022) to transformer backbones (Peebles and Xie 2023) trained with flow matching (Lipman et al. 2023; Liu, Gong, and Liu 2023), such as SD3 (Esser et al. 2024) and FLUX (Black Forest Labs 2024). Building on these models, training-free text-guided editing enables diverse local and global modifications through improved inversion (Mokady et al. 2023; Ju et al. 2024; Rout et al. 2025; Wang et al. 2025) and internal-feature manipulation (Hertz et al. 2022; Cao et al. 2023; Tumanyan et al. 2023; Avrahami et al. 2025). Yet object replacement remains difficult when the source and target objects differ substantially in
category, silhouette, and spatial extent. Successful replacement must fully remove the source object, allow the target to form in its own shape, and preserve unrelated content. Without user-provided edit region masks, the central challenge of replacement tasks is automatic region discovery. Mask-conditioned methods such as FLUX.1-Fill (Black Forest Labs 2024) and KV-Edit (Zhu et al. 2025) can preserve the background well, but shift the burden of localization to the user and constrain the target object to a prescribed region. Automatic methods instead derive edit regions from prompt-conditioned terminal predictions. DiffEdit (Couairon et al. 2023) compares noise predictions under two prompts, while Follow-Your-Shape (FYS) (Long et al. 2026) compares token-wise velocity differences across the source inversion and target editing trajectories. However, by the time terminal predictions are produced, subsequent network transformations may have obscured the spatial response of promptinduced semantic differences. The cross-trajectory comparison in FYS additionally changes the latent state, introducing interference from trajectory mismatch and solver error. These factors reduce spatial localization precision. To address these issues, we propose PC-Edit, a promptcontrastive framework for training-free MM-DiT editing. As illustrated in Fig. 1, PC-Edit supports single- and multi-object addition and replacement without user-provided masks while automatically discovering edit regions. At the same latent state and timestep, PC-Edit contrasts the imagetoken attention outputs under the source and target prompts. Since these outputs carry text-conditioned information written into image tokens through joint attention, their difference directly reveals which image locations respond to the prompt change, providing a more direct and accurate localization signal than terminal predictions. However, accurate localization alone is insufficient for large-shape replacement because the source-erasure and target-emergence footprints need not coincide. A mask that only follows the emerging target can leave source-object remnants, whereas a mask restricted to the source footprint can suppress the target’s natural shape. PC-Edit applies the same contrast during inversion to identify a source-erasure region and during denoising to track a target-emergence region. Their union suppresses sourceobject remnants while allowing the target to extend beyond the source silhouette. PC-Edit further couples region discovery and preserva-
Single Object replacement
Addition Task
Source image A woman is sitting in a café.
Single object
Two objects A woman is sitting in a café with a cake and a cup of coffee on the table.
A woman is sitting in a café, wearing black glasses. A girl is playing with a toy bucket and a ball.
A dog is playing with a toy bucket and a ball.
Three objects
A woman is sitting in a café, wearing earrings, a gray hat, and a pearl necklace. A girl is playing with a teddy bear and a ball.
A girl is playing with a toy bucket and a toy truck.
A bicycle and a car...
Two objects replacement
A small dog and an orange cat ...
Three objects replacement
A fox and a goose ...
A Mickey Mouse and a Donald Duck... A fruit plate containing watermelon, lemons, and cherries...
A fruit plate …, a vase …, a dessert plate …
A fruit plate …, a vase …, a dessert plate with a cup of mango juice, tarts, and toasts.
A fruit plate …, a vase holding a tulip, a red rose, and a peony ...
Figure 1: Visual results of PC-Edit. Each example pairs an edited image (left) with its automatically discovered edit region (right), covering single- and multi-object addition and replacement.
tion within each sampling step. It estimates the current edit region from preceding attention blocks and immediately injects cached source K/V features outside it in subsequent blocks. This same-step design uses the latest region estimate to guide each latent update, thereby reducing background drift. To evaluate automatic region discovery and editing quality, we introduce EditRegion-Bench, a 484-case benchmark for single- and multi-object addition and replacement, with manually annotated edit regions. Extensive experiments on EditRegion-Bench and PIE-Bench validate the effectiveness of the proposed localization and editing mechanisms. Our main contributions are as follows: • We identify differences between MM-DiT image-token attention outputs under source and target prompts as an effective edit-region localization signal and develop a corresponding prompt-contrastive localization method. • We develop an editing mechanism that separately models source-erasure and target-emergence regions and injects source K/V features outside their union within the same sampling step, allowing the target to form without being constrained by the source silhouette while suppressing source remnants and preserving unrelated content. • We introduce EditRegion-Bench, a 484-case benchmark with manually annotated edit regions for single- and multi-object editing, enabling evaluation of edit-region localization, background fidelity, and visual quality. • Experiments on EditRegion-Bench and PIE-Bench demonstrate that PC-Edit achieves the best editing quality and background preservation among methods without
user-specified edit regions.
Related Work Training-free image editing. Training-free editing modifies images using a frozen pretrained text-to-image model, typically through source-image inversion and internalfeature manipulation. On UNet-based diffusion models, Prompt-to-Prompt (Hertz et al. 2022) controls crossattention, Null-text Inversion (Mokady et al. 2023) and Direct Inversion (Ju et al. 2024) improve reconstruction, and MasaCtrl (Cao et al. 2023) and Plug-and-Play (Tumanyan et al. 2023) reuse internal features to preserve structure. Recent methods extend these ideas to diffusion transformers and rectified-flow models. DiT4Edit (Feng et al. 2025), RF-Inversion (Rout et al. 2025), and RF-Edit (Wang et al. 2025) improve inversion or trajectory recovery, while FlowEdit (Kulikov et al. 2025) constructs a direct source-totarget transport path. Stable Flow (Avrahami et al. 2025) preserves source structure through feature injection. However, these methods focus on improving inversion fidelity, sourceto-target transport, or content preservation through attention and feature control, without explicit edit-region localization. Automatic region discovery and region-guided editing. Mask-conditioned methods such as FLUX.1-Fill (Black Forest Labs 2024) and KV-Edit (Zhu et al. 2025) achieve strong background preservation, but require a user-provided region and constrain the target object to that region. Mask-free methods instead infer the edit region from prompt-conditioned
Double Stream Block
Source prompt: a gray wolf, a white sheep, and a white goose standing in a row on a sandy path
VAE Encode
Double Stream Block
Single Stream Block
⋯
Single Stream Block
𝑥𝑥0
Source image VAE Decode
Target image Target prompt: a white duck, a red fox, and a white goat standing in a row on a sandy path
𝑧𝑧0
Single Stream Block
𝑀𝑀𝑠𝑠𝑠𝑠𝑠𝑠 U𝑀𝑀1
Single Stream Block
Double Stream Block
⋯
Double Stream Block
Double Stream Block
⋯
Double Stream Block
Single Stream Block Temporal averaging
Single Stream Block
𝑥𝑥𝑇𝑇−1
⋯ 𝑧𝑧1
𝑀𝑀src
𝑥𝑥𝑇𝑇 Single Stream Block
𝑀𝑀src U𝑀𝑀𝑇𝑇
Single Stream Block
Double Stream Block
Double Stream Block
Mask from 𝑀𝑀src U𝑀𝑀1
Inject KV from Target Denoising Trajectory Inject KV from Source Inversion Trajectory
𝑧𝑧𝑇𝑇
Forward with src prompt
Feature latent
Forward with tgt prompt
Otsu binary
Element-wise subtraction
MM-DiT
Figure 2: Overview of PC-Edit. Inversion caches source K/V features and estimates the source-erasure mask Msrc . Denoising tracks the target-emergence mask, combines it with Msrc , and injects source K/V outside the resulting region within the same sampling step to preserve unrelated content.
predictions. DiffEdit (Couairon et al. 2023) compares noise predictions conditioned on the source and target prompts, while FYS (Long et al. 2026) compares velocity predictions along source inversion and target denoising trajectories. However, because these signals are read from terminal predictions, subsequent network transformations may have obscured the spatial response of prompt-induced semantic differences. The cross-trajectory comparison in FYS also changes the latent state, which may introduce trajectory mismatch and solver error. Moreover, a single edit region does not explicitly distinguish the source-erasure region from the target-emergence region. PC-Edit instead reads prompt contrast from image-token attention outputs (Vaswani et al. 2017) at the same latent state and timestep, models source erasure and target emergence separately, and applies regionguided source K/V injection within the same sampling step.
Methodology Given a source image Isrc and source and target prompts (csrc , ctgt ), PC-Edit performs the requested object addition or replacement while preserving unrelated content. As illustrated in Fig. 2, the method consists of source inversion and target denoising. During inversion, we map the source latent x0 to xT , cache source K/V features, and estimate a source-erasure region. Starting from zT = xT , denoising dynamically tracks the target-emergence region and uses the resulting edit region to guide same-step source K/V injection.
Motivation Disentangling prompt contrast from state mismatch. The trajectory-divergence method (Long et al. 2026) compares the source inversion trajectory {xt } under csrc with the target denoising trajectory {zt } under ctgt . Its velocity difference changes both the prompt and the latent state and
can be decomposed as vθ (zt , ctgt ) − vθ (xt , csrc ) = vθ (xt , ctgt ) − vθ (xt , csrc ) {z } | prompt contrast, shared state
+ vθ (zt , ctgt ) − vθ (xt , ctgt ) . | {z } state mismatch, shared prompt
(1) The first term measures the prompt-conditioned change at a shared latent state, whereas the second reflects differences between the inversion and denoising states, including trajectory mismatch and solver error. To avoid this state-dependent interference, PC-Edit varies only the text condition while holding the latent state and timestep fixed. Reading prompt contrast from attention outputs. State matching determines how the source and target prompts should be compared, but still leaves the question of where their difference should be obtained. Existing predictiondifference methods read prompt contrast from terminal noise or velocity predictions (Couairon et al. 2023; Long et al. 2026). Before reaching these predictions, the promptconditioned response produced by text–image interaction undergoes further network processing. These later transformations may dilute the prompt-induced semantic contrast and make it less spatially localized. Therefore, we seek an internal readout closer to where text conditioning modulates image tokens. In MM-DiT backbones, text and image tokens interact through joint attention. For each image token, joint attention incorporates text-derived value content into an image-side attention output AttnOut, which carries the textconditioned modulation of the image representation. Therefore, its source–target difference provides a more direct signal for locating the spatial response induced by a prompt change. Separating source erasure from target emergence. Prediction-difference methods such as DiffEdit (Couairon et al. 2023) and FYS (Long et al. 2026) derive an edit region, but do not explicitly distinguish the source footprint
that must be erased from the region in which the target object should emerge. This distinction becomes critical when the source and target differ substantially in shape or spatial extent. Meanwhile, feature-reuse methods such as Plug-andPlay (Tumanyan et al. 2023), MasaCtrl (Cao et al. 2023), and Stable Flow (Avrahami et al. 2025) do not explicitly distinguish regions that should retain source features from those that should remain target-driven. Reusing source features in regions that must change can leave source remnants or hinder target formation, whereas weakening reuse reduces the protection of unrelated content. PC-Edit addresses this preservation–editability trade-off by separately modeling source-erasure and target-emergence regions and injecting source K/V features only outside their union.
Target-emergence tracking during denoising. At denoising step t, before source K/V injection, we run two forward passes from the current latent zt , conditioned on csrc and ctgt , respectively, and compute ∆AttnOutt from the localization blocks Bloc . We then apply Otsu’s threshold to obtain the target-emergence mask Mt . Early in denoising, Mt is typically broad, allowing the target object to extend beyond the source silhouette. As denoising proceeds, Mt gradually contracts around the emerging shape of the target object. We combine source erasure and target emergence as Msrc ∪ Mt , t ≤ ts , Rt = (4) Rts , t > ts .
PC-Edit
The union covers both the disappearing source object and the emerging target object. Because late-stage contrastive responses become less reliable for localization, we freeze the region at step ts .
We introduce PC-Edit, a prompt-contrastive framework that automatically discovers source-erasure and target-emergence regions during inversion and denoising, respectively, and injects source K/V features outside their union within each region-guided sampling step. Prompt-contrastive localization signal. Let Bloc denote the set of attention blocks used for region localization. At timestep t, PC-Edit runs two forward passes on the same latent, conditioned on csrc and ctgt , respectively, and computes X 1 src ∆AttnOutt = AttnOuttgt t,b − AttnOutt,b , |Bloc | b∈Bloc (2) where the norm over feature channels produces a token-wise heatmap. The latent is xt during inversion and zt during denoising, so the two forward passes differ only in their text conditions. Source-erasure footprint during inversion. Along the source inversion trajectory, we cache the key and value features of the injection blocks Binj at every timestep, denoted src src by {Kt,b , Vt,b }b∈Binj . These cached features are later reused to anchor regions that should remain unchanged. For object replacement, we estimate the source-erasure footprint during inversion. Specifically, at each selected timestep t, we perform an additional target-conditioned forward pass at the same inversion latent xt to compute ∆AttnOutt . Responses near the clean endpoint tend to be weak, whereas those near the noise endpoint become spatially diffuse. Since intermediate states retain recognizable source structure while providing clear source–target contrast, we select an intermediate timestep window Tprobe , average the resulting heatmaps, and apply Otsu’s threshold (Otsu 1975): X 1 Hsrc = ∆AttnOutt , |Tprobe | t∈Tprobe
Msrc = Binarize(Hsrc , Otsu(Hsrc )) . (3) Here, Binarize(H, τ ) applies an element-wise threshold at τ , assigning one to responses above the threshold and zero otherwise. Msrc identifies where source K/V injection must be disabled to remove the original object. For object addition, no source object needs to be erased, so we set Msrc = 0.
Same-step region-guided K/V injection. PC-Edit first constructs Rt from the prompt-contrastive responses of the localization blocks Bloc , and then immediately uses it to guide source K/V injection in the subsequent blocks Binj . For each b ∈ Binj , we compute tgt src Kt,b = Rt ⊙ Kt,b + (1 − Rt ) ⊙ Kt,b , tgt src Vt,b = Rt ⊙ Vt,b + (1 − Rt ) ⊙ Vt,b .
(5)
The binary mask Rt is broadcast over feature channels and applied only to image tokens. Features inside Rt remain target-driven, while regions outside Rt are anchored by cached source K/V features to preserve unrelated content. Because Bloc precedes Binj , the current edit region is localized before source K/V injection, preventing the injected features from affecting the localization signal. During the first few denoising steps, we apply global source K/V injection over a short warm-up window Twarm to anchor the early latent evolution to the source layout and appearance before switching to region-guided K/V injection.
Experiments Implementation We evaluate PC-Edit using FLUX.1-dev (Black Forest Labs 2024) as the backbone on a single NVIDIA A800 GPU. We use 15 inversion steps and 15 denoising steps at a resolution of 1024 × 1024. Following the block and timestep analysis in Fig. 6, we set Bloc to double-stream blocks 13–18 and Binj to the last 18 single-stream blocks. For replacement, Msrc is estimated from Tprobe = {6, 7, 8}, whereas addition sets Msrc = 0. The first two denoising steps use global K/V injection (Twarm = {1, 2}), after which the dynamic mask is updated until ts = 10 and then kept fixed.
Datasets We evaluate PC-Edit on EditRegion-Bench and PIE-Bench. EditRegion-Bench contains 484 object-editing cases, comprising 236 additions and 248 replacements, as well as 330 one-object, 87 two-object, and 67 three-object edits. Source
Addition
Source
PnP
MasaCtrl
RF-Inv.
Stable Flow FlowEdit
a girl sitting on a wooden stool
a city street
three teddy bears sitting in a row
RF-Edit
KV-Edit
FLUX.1-Fill
Ours
a city street with a parked car and a walking dog
three teddy bears in a row, left with a bow tie, middle with a scarf, right with a hat
a wicker picnic basket on a picnic blanket
Replacement
FYS
a girl sitting on a wooden stool, wearing glasses
a breakfast tray holding two croissants and a glass of orange juice
a fox, a wolf, and a deer standing on a snowy path
a small brown puppy on a picnic blanket
a breakfast tray holding two bagels and a cup of coffee
a husky, a polar bear, and a rabbit standing on a snowy path
Figure 3: Qualitative comparison on addition and replacement. PC-Edit completes single- and multi-object edits while better preserving unrelated content.
images are generated using Seedream (Gao et al. 2025) and GPT-Image-2 (OpenAI 2026) or collected through web image search, and all images are resized to 1024 × 1024. Each case provides source and target prompts together with bounding boxes for all edited objects. The annotations are manually created and independently verified by a second annotator, enabling direct evaluation of both single- and multi-object localization. We additionally use the 240 object-addition and object-replacement cases from PIE-Bench (Ju et al. 2024).
Baselines We compare PC-Edit against seven mask-free training-free methods. UNet-based baselines include PnPInversion (Ju et al. 2024) and MasaCtrl (Cao et al. 2023). Rectified-flow baselines include RF-Inversion (Rout et al. 2025), Stable Flow (Avrahami et al. 2025), FlowEdit (Kulikov et al. 2025), FYS (Long et al. 2026), and RF-Edit (Wang et al. 2025). We further report two mask-guided references, FLUX.1Fill (Black Forest Labs 2024) and KV-Edit (Zhu et al. 2025), which are given the ground-truth edit boxes as input.
Metrics Localization is evaluated against the union of the annotated boxes using five metrics. AP evaluates whether edit-region pixels receive higher responses than background pixels (Fan et al. 2017). Normalized foreground–background contrast (FBC) quantifies response separation. bgp99 denotes the 99th percentile of responses outside the annotated edit region. PeakHit reports whether the maximum-response pixel falls inside the annotated region. mIoU measures the overlap between the predicted mask and the annotated region (Everingham et al. 2010). Editing quality is evaluated using the
LAION aesthetic score (AS) (Schuhmann et al. 2022) for overall visual quality, CLIP similarity (CLIPsim ) (Radford et al. 2021) for semantic alignment with the target prompt, and PSNR and LPIPS (Zhang et al. 2018) for pixel-level and perceptual background fidelity. Background metrics are computed outside the union of the annotated boxes. To directly assess source-object removal, we additionally employ Qwen2.5-VL (Bai et al. 2025) as a frozen automatic evaluator on the replacement cases. We report the Effective SourceErasure Rate (ESER), which counts a case as successful only when the source concept is no longer recognizable and the annotated edit region undergoes a meaningful change. Detailed prompts, definitions, and auxiliary metrics are provided in the supplementary material.
Quantitative Results Edit-region localization. We compare six candidate readouts for prompt-contrastive localization. For each one, we evaluate the source and target prompts on the same latent at the same timestep and compute the token-wise difference ∆Xt = ∥Xttgt − Xtsrc ∥. We consider the image-token query Q, key K, and value V projections, image-to-image attention weights A, the image-token attention output AttnOut, and the terminal velocity vθ . Except for vθ , all signals are extracted from double-stream blocks 13–18. All signals use the same evaluation samples, heatmap normalization, thresholding, and post-processing. We additionally evaluate the FYSstyle cross-trajectory velocity difference, which compares the source inversion latent xt with the target denoising latent zt at the same timestep. As shown in Table 2, ∆AttnOut achieves the best results across all five metrics. Figure 4 shows the same trend qualitatively, with more concentrated
EditRegion-Bench Method
×103
PIE-Bench 3
CLIPsim ↑
ESER↑
AS↑
PSNR ↑
LPIPS×10 ↓
CLIPsim ↑
ESER↑
80.91 87.23 181.36 57.06 82.38 65.53 104.23
27.48 26.14 27.82 26.44 28.18 28.22 27.99
62.10 27.42 65.73 27.02 70.56 73.39 73.39
6.43 6.29 6.51 6.25 6.56 6.53 6.39
27.34 22.29 20.69 25.95 23.33 24.62 25.41
49.54 84.07 190.76 82.74 87.15 116.90 127.95
25.89 25.67 26.04 24.36 26.25 25.74 25.81
45.00 30.00 58.75 22.50 55.00 60.00 62.50
35.43 37.47
6.18 3.97
28.30 27.41
81.68 65.32
6.20 6.38
36.58 36.22
11.65 8.54
25.46 24.42
66.25 50.00
34.37
16.40
28.44
82.44
6.58
29.71
38.92
26.42
67.50
AS↑
PSNR ↑
PnPInversion MasaCtrl RF-Inversion Stable Flow FlowEdit FYS RF-Edit
6.35 6.26 6.52 6.52 6.54 6.59 6.53
24.39 22.37 20.71 25.85 23.63 25.77 26.01
FLUX.1-Fill† KV-Edit†
6.47 6.52
PC-Edit (ours)
6.62
LPIPS
↓
Table 1: Editing results on two datasets. † denotes methods given ground-truth masks. Bold indicates the best result among methods without specified edit regions.
Signal
AP↑ FBC↑ bgp99 ↓ PeakHit↑ mIoU↑
∆Q ∆K ∆V ∆A ∆vθ Cross-trajectory ∆vθ
58.2 60.3 63.9 66.6 62.9 49.5
27.6 26.8 26.8 36.5 39.3 27.1
40.8 39.7 37.0 41.9 37.8 52.0
83.5 86.1 86.5 78.2 82.0 71.1
32.0 33.3 35.1 38.6 28.0 24.9
∆AttnOut (ours)
74.4 44.8
32.6
87.2
40.4
Table 2: Edit-region localization on EditRegion-Bench. All signals except Cross-trajectory ∆vθ use shared-state prompt contrast. Cross-trajectory ∆vθ follows the FYS-style trajectory-divergence setting. Only bgp99 is lower-is-better.
3
Settings
AS↑ PSNR ↑ LPIPS×10 ↓ CLIP↑
w/o Msrc Static target mask Staged control Full PC-Edit (ours)
6.50 6.54 6.55 6.57
34.11 30.55 26.61 33.25
18.87 31.12 50.78 19.50
28.00 28.17 28.13 28.21
Table 3: Component ablation on the 248 replacement cases of EditRegion-Bench. Source
∆Q
∆K
∆V
∆A
∆𝑣𝑣𝜃𝜃
∆𝑣𝑣𝜃𝜃
(Cross-trajectory) ∆Attnout
Target add glasses
addition region
cat→dog
responses and less background activation. The Q/K/V signals are taken from the projections before attention aggregation, whereas ∆A reflects changes in image-to-image attention distributions without accounting for the value content being aggregated. The terminal velocity is obtained after the prompt-conditioned response has passed through subsequent network computation. Moreover, the lower performance of the FYS-style cross-trajectory signal suggests additional interference from comparing different latent states. Overall, these results identify ∆AttnOut as the most reliable readout among the compared signals for edit-region localization. Editing quality. Table 1 shows that PC-Edit achieves the best overall balance between editability and content preservation among methods without externally specified edit regions. It provides the highest background fidelity across both benchmarks, while also attaining the best aesthetic quality and target-prompt alignment. Compared with the GT-boxguided references, PC-Edit substantially narrows the preservation gap without access to ground-truth boxes, while producing more visually appealing and semantically faithful edits. A complementary Qwen2.5-VL-based evaluation on replacement cases further shows that PC-Edit achieves the highest ESER score among all methods, indicating effective source removal alongside strong background preservation.
replacement region
Figure 4: Qualitative comparison of edit-region localization signals. ∆AttnOut yields the most concentrated responses with less background activation.
Full evaluator details and auxiliary metrics are provided in the supplementary material.
Qualitative Results Figure 3 presents qualitative comparisons on single- and multi-object addition and replacement. PC-Edit successfully performs both small localized edits and large cross-category replacements while preserving unrelated regions. Compared with mask-free baselines, it exhibits fewer missed edits, source remnants, and unintended background changes. Figure 5 further shows that explicitly modeling Msrc suppresses residual source content. Although GT-box-guided methods preserve the background well, their predefined regions may restrict target formation when the source and target have different silhouettes. By jointly modeling the source-erasure region and tracking target emergence during denoising, PCEdit allows the target to extend beyond the source footprint while preserving unrelated content.
Source
Stable flow
FYS
Ours w/o 𝑀𝑀src
Ours
(a) Layer-wise localization during inversion Double-stream
AP ↑
FBC ↑
D13--D18
Single-stream
→ a small bird on a shelf
a cat and a fox beside a fence → a wolf and a dog beside a fence
residual source texture
no old-object residue
60
40
20
0
residual source texture
no old-object residue
Figure 5: Effect of source-erasure modeling. Explicit Msrc suppresses residual source textures observed in competing methods and the variant without Msrc .
Ablation Study We first examine the architectural and temporal design choices for region discovery, followed by component-wise ablations of PC-Edit. Block and inversion-step selection. Figure 6 evaluates ∆AttnOut across FLUX blocks and inversion steps. Averaged over inversion steps, double-stream blocks 13–18 yield the strongest and most stable localization. With these blocks fixed, both AP and FBC peak in the middle of inversion. Therefore, we set Bloc = {13, . . . , 18} and Tprobe = {6, 7, 8} for constructing Msrc . Component ablation. We evaluate the main components of PC-Edit on the 248 replacement cases of EditRegionBench, where source removal is explicitly required. We consider three variants. w/o Msrc removes the inversion-time source-erasure footprint and defines the edit region solely from the denoising-time target-emergence mask. Static target mask estimates the target-emergence region once after the global-injection warm-up and reuses it throughout the remaining denoising steps, thereby removing online edit region refinement. Staged control follows an FYS-style schedule, allowing the latent to denoise freely under the target prompt while accumulating the edit mask, and applying source K/V injection outside the resulting mask only during the final denoising steps. As shown in Table 3, the variants exhibit different trade-offs between source removal and background preservation. Although removing Msrc slightly improves the background-fidelity metrics, it leaves more source remnants because the target-emergence region may not fully cover the source footprint, particularly when the source and target silhouettes differ substantially. The Qwen-based evaluation confirms this limitation: adding Msrc increases ESER from 72.18% to 82.44%, while Figure 5 qualitatively shows residual source content in the variant without Msrc . Staged control degrades background fidelity, as background drift accumulated during early unconstrained denoising cannot be fully corrected by source K/V injection in the final steps. The static target mask is estimated only once after warm-up, while the target response is still relatively diffuse, and remains fixed thereafter. It therefore cannot adapt as the target structure emerges, often resulting in an overly broad edit re-
D0 D2 D4 D6 D8 D10 D12 D14 D16 D18S0
S4
S8
2
S1
6
S1
0
S2
4
S2
8
S2
2
S3
6
S3
FLUX block (individual layer)
(b) Step-wise localization with D13--D18
AP ↑
FBC ↑
peak at s7
80
Localization metric (%)
a wooden toy horse on a shelf
Localization metric (%)
80
70
60
50
40
30 s0 0
s1 184
s2 327
s3 441
s4 535
s5 612
s6 678
s7 734
s8 783
s9 826
s10 863
s11 897
s12 927
s13 954
s14 978
Inversion step / shifted timestep (×1000)
Figure 6: Localization across FLUX blocks and inversion steps. (a) Per-block AP and FBC averaged over steps. (b) Per-step results using double-stream blocks 13–18.
gion and weakened background preservation. Delaying mask collection could yield a more accurate region estimate, but would leave the preceding denoising steps unconstrained and inherit the same limitation as staged control. In contrast, PCEdit refines the target-emergence region online after warmup and immediately applies region-guided control within the same sampling step, maintaining edit coverage while limiting background drift.
Conclusion We presented PC-Edit, a training-free framework for promptcontrastive region discovery in MM-DiT editing. By holding the latent state and timestep fixed while varying only the prompt, PC-Edit captures prompt-induced semantic differences from image-token attention outputs. Applying the same contrast during inversion and denoising produces sourceerasure and target-emergence regions, whose union defines the edit region. Within each sampling step, PC-Edit immediately injects cached source K/V features outside this region, preserving unrelated content before the latent update. We introduced EditRegion-Bench, which provides human-verified edit-region annotations for single- and multi-object addition and replacement. Experiments on EditRegion-Bench and PIE-Bench demonstrate that PC-Edit achieves more accurate edit-region localization and the best balance of editing quality and background preservation among methods that do not require manually specified edit regions.
References Avrahami, O.; Patashnik, O.; Fried, O.; Nemchinov, E.; Aberman, K.; Lischinski, D.; and Cohen-Or, D. 2025. Stable flow: Vital layers for training-free image editing. In Proceedings of the Computer Vision and Pattern Recognition Conference, 7877–7888. Bai, S.; Chen, K.; Liu, X.; Wang, J.; Ge, W.; Song, S.; Dang, K.; Wang, P.; Wang, S.; Tang, J.; Zhong, H.; Zhu, Y.; Yang, M.; Li, Z.; Wan, J.; Wang, P.; Ding, W.; Fu, Z.; Xu, Y.; Ye, J.; Zhang, X.; Xie, T.; Cheng, Z.; Zhang, H.; Yang, Z.; Xu, H.; and Lin, J. 2025. Qwen2.5-VL Technical Report. arXiv preprint arXiv:2511.21631. Black Forest Labs. 2024. FLUX. https://github.com/blackforest-labs/flux. Cao, M.; Wang, X.; Qi, Z.; Shan, Y.; Qie, X.; and Zheng, Y. 2023. Masactrl: Tuning-free mutual self-attention control for consistent image synthesis and editing. In Proceedings of the IEEE/CVF international conference on computer vision, 22560–22570. Couairon, G.; Verbeek, J.; Schwenk, H.; and Cord, M. 2023. DiffEdit: Diffusion-based Semantic Image Editing with Mask Guidance. In ICLR 2023 (Eleventh International Conference on Learning Representations). Esser, P.; Kulal, S.; Blattmann, A.; Entezari, R.; Müller, J.; Saini, H.; Levi, Y.; Lorenz, D.; Sauer, A.; Boesel, F.; et al. 2024. Scaling rectified flow transformers for high-resolution image synthesis. In Forty-first international conference on machine learning. Everingham, M.; Van Gool, L.; Williams, C. K.; Winn, J.; and Zisserman, A. 2010. The pascal visual object classes (voc) challenge. International journal of computer vision, 88(2): 303–338. Fan, D.-P.; Cheng, M.-M.; Liu, Y.; Li, T.; and Borji, A. 2017. Structure-measure: A new way to evaluate foreground maps. In Proceedings of the IEEE international conference on computer vision, 4548–4557. Feng, K.; Ma, Y.; Wang, B.; Qi, C.; Chen, H.; Chen, Q.; and Wang, Z. 2025. Dit4edit: Diffusion transformer for image editing. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 39, 2969–2977. Gao, Y.; Gong, L.; Guo, Q.; Hou, X.; Lai, Z.; Li, F.; Li, L.; Lian, X.; Liao, C.; Liu, L.; et al. 2025. Seedream 3.0 technical report. arXiv preprint arXiv:2504.11346. Hertz, A.; Mokady, R.; Tenenbaum, J.; Aberman, K.; Pritch, Y.; and Cohen-Or, D. 2022. Prompt-to-Prompt Image Editing with Cross Attention Control. arXiv e-prints, arXiv–2208. Ju, X.; Zeng, A.; Bian, Y.; Liu, S.; and Xu, Q. 2024. Pnp inversion: Boosting diffusion-based editing with 3 lines of code. In International Conference on Learning Representations, volume 2024, 23395–23422. Kulikov, V.; Kleiner, M.; Huberman-Spiegelglas, I.; and Michaeli, T. 2025. Flowedit: Inversion-free text-based editing using pre-trained flow models. In Proceedings of the IEEE/CVF International Conference on Computer Vision, 19721–19730.
Lipman, Y.; Chen, R. T.; Ben-Hamu, H.; Nickel, M.; and Le, M. 2023. Flow Matching for Generative Modeling. In 11th International Conference on Learning Representations, ICLR 2023. Liu, X.; Gong, C.; and Liu, Q. 2023. Flow Straight and Fast: Learning to Generate and Transfer Data with Rectified Flow. In The Eleventh International Conference on Learning Representations (ICLR). Long, Z.; Zheng, M.; Feng, K.; Zhang, X.; Liu, H.; Yang, H.; Zhang, L.; Chen, Q.; and Ma, Y. 2026. Follow-Your-Shape: Shape-Aware Image Editing via Trajectory-Guided Region Control. In The Fourteenth International Conference on Learning Representations. Mokady, R.; Hertz, A.; Aberman, K.; Pritch, Y.; and CohenOr, D. 2023. Null-text inversion for editing real images using guided diffusion models. In Proceedings of the IEEE/CVF conference on computer vision and pattern recognition, 6038–6047. OpenAI. 2026. GPT Image 2. https://developers.openai. com/api/docs/models/gpt-image-2. Otsu, N. 1975. A threshold selection method from gray-level histograms. Automatica, 11: 285–296. Peebles, W.; and Xie, S. 2023. Scalable diffusion models with transformers. In Proceedings of the IEEE/CVF international conference on computer vision, 4195–4205. Radford, A.; Kim, J. W.; Hallacy, C.; Ramesh, A.; Goh, G.; Agarwal, S.; Sastry, G.; Askell, A.; Mishkin, P.; Clark, J.; et al. 2021. Learning transferable visual models from natural language supervision. In International conference on machine learning, 8748–8763. PmLR. Rombach, R.; Blattmann, A.; Lorenz, D.; Esser, P.; and Ommer, B. 2022. High-resolution image synthesis with latent diffusion models. In Proceedings of the IEEE/CVF conference on computer vision and pattern recognition, 10684– 10695. Rout, L.; Chen, Y.; Ruiz, N.; Caramanis, C.; Shakkottai, S.; and Chu, W.-S. 2025. Semantic Image Inversion and Editing using Rectified Stochastic Differential Equations. In The Thirteenth International Conference on Learning Representations. Schuhmann, C.; Beaumont, R.; Vencu, R.; Gordon, C.; Wightman, R.; Cherti, M.; Coombes, T.; Katta, A.; Mullis, C.; Wortsman, M.; et al. 2022. Laion-5b: An open largescale dataset for training next generation image-text models. Advances in neural information processing systems, 35: 25278–25294. Tumanyan, N.; Geyer, M.; Bagon, S.; and Dekel, T. 2023. Plug-and-play diffusion features for text-driven image-toimage translation. In Proceedings of the IEEE/CVF conference on computer vision and pattern recognition, 1921– 1930. Vaswani, A.; Shazeer, N.; Parmar, N.; Uszkoreit, J.; Jones, L.; Gomez, A. N.; Kaiser, Ł.; and Polosukhin, I. 2017. Attention is all you need. Advances in neural information processing systems, 30.
Wang, J.; Pu, J.; Qi, Z.; Guo, J.; Ma, Y.; Huang, N.; Chen, Y.; Li, X.; and Shan, Y. 2025. Taming Rectified Flow for Inversion and Editing. In International Conference on Machine Learning, 64044–64058. PMLR. Zhang, R.; Isola, P.; Efros, A. A.; Shechtman, E.; and Wang, O. 2018. The unreasonable effectiveness of deep features as a perceptual metric. In Proceedings of the IEEE conference on computer vision and pattern recognition, 586–595. Zhu, T.; Zhang, S.; Shao, J.; and Tang, Y. 2025. Kv-edit: Training-free image editing for precise background preservation. In Proceedings of the IEEE/CVF International Conference on Computer Vision, 16607–16617.
Supplementary Material This supplement presents the complete PC-Edit inference procedure and fixed configuration, further details of EditRegion-Bench, metric definitions, Qwen2.5-VL-based source-erasure evaluation, additional qualitative results, and the complete evaluator prompts. Unless otherwise stated, notation follows the main paper.
Inference Procedure and Configuration Algorithm 1 and 2 summarize the inference procedure of PCEdit. During inversion, source-conditioned forward passes advance the source trajectory and cache the corresponding K/V features. For object replacement, additional targetconditioned passes are performed at the inversion latents indexed by Tprobe to estimate the source-erasure mask Msrc . Addition skips this stage and sets Msrc = 0. During denoising, prompt-contrastive localization is performed in Bloc before source K/V injection in Binj , allowing the region estimated at the current step to guide the same latent update. Global source K/V injection is applied during the warm-up steps Twarm . The edit region is subsequently updated until the freeze step ts and kept fixed. Table 4 lists the fixed configuration used in all main-paper experiments.
EditRegion-Bench Details EditRegion-Bench contains 484 evaluation cases: 236 additions and 248 replacements, covering one-, two-, and threeobject edits as reported in the main paper. Each case includes a 1024×1024 source image, a source prompt, a target prompt, and one human-annotated bounding box for each requested edit target. Localization evaluation uses the union of these boxes. The annotations were drawn by one annotator and independently verified by a second. They mark the image regions expected to change under the editing instruction and are used only for evaluation, without being provided to PC-Edit or any other mask-free method during inference. Since valid edits may occur at different reasonable locations and cover different areas, our annotations indicate where the edit should happen rather than define an exact pixel-level mask. Figures 7 and 8 show representative examples from EditRegionBench, where the red overlays visualize the corresponding human annotations. EditRegion-Bench is publicly available at https://zenodo.org/records/21502501. Component
Setting
Backbone Image resolution Inversion / denoising steps Guidance scale Localization blocks Bloc Injection blocks Binj Probing steps Tprobe Source-erasure mask for addition Mask binarization Warm-up steps Twarm Region-update steps Region-freeze step ts Hardware
FLUX.1-dev 1024 × 1024 15/15 3.0 Double-stream blocks 13–18 Last 18 single-stream blocks {6, 7, 8} Msrc = 0 Otsu thresholding {1, 2} 3–10 10 One NVIDIA A800 GPU
Table 4: Fixed inference configuration of PC-Edit.
Algorithm 1: PC-Edit source inversion 1: Input: Source image Isrc , conditions (csrc , ctgt ), edit type e, Bloc , Binj , and Tprobe
2: Output: Inverted latent xN , cached source features {Ct }N t=1 , and source-erasure mask Msrc
3: x0 ← Encode(Isrc ) 4: Hsrc ← ∅ 5: for t = 1 to N do 6: Run the source-conditioned forward pass to obtain vtsrc and imagetoken attention outputs AttnOutsrc t from Bloc
src , V src } 7: Cache the source K/V features Ct = {Kt,b t,b b∈Binj 8: if e = replacement and t ∈ Tprobe then 9: Obtain AttnOuttgt tP from Bloc at (xt−1 , τt , ctgt ) src 10: Ht ← |Bloc |−1 b∈Bloc ∥AttnOuttgt t,b − AttnOutt,b ∥ 11: Append Ht to Hsrc 12: end if 13: xt ← InvertStep(xt−1 , vtsrc ) 14: end for 15: if e = replacement then 16: Msrc ← Otsu(Mean(Hsrc )) 17: else 18: Msrc ← 0 19: end if 20: return xN , {Ct }N t=1 , and Msrc
Algorithm 2: PC-Edit target denoising 1: Input: Inverted latent xN , conditions (csrc , ctgt ), cached source fea-
tures {Ct }N t=1 , source-erasure mask Msrc , Bloc , Binj , Twarm , and ts 2: Output: Edited image Iedit 3: zN ← xN 4: R ← Msrc 5: for k = 1 to N do 6: t←N −k+1 7: if k ∈ Twarm then 8: Run the target-conditioned forward pass using cached source K/V for all image tokens to obtain vt 9: else 10: Run the target-conditioned forward pass through Bloc to obtain AttnOuttgt t 11: if k ≤ ts then 12: Obtain AttnOutsrc t from Bloc at (zt , τt , csrc ) P src 13: Ht ← |Bloc |−1 b∈Bloc ∥AttnOuttgt t,b − AttnOutt,b ∥ 14: R ← Msrc ∪ Otsu(Ht ) 15: end if 16: Continue the target-conditioned forward pass through Binj using target K/V inside R and cached source K/V outside R to obtain vt 17: end if 18: zt−1 ← DenoiseStep(zt , vt ) 19: end for 20: return Iedit ← Decode(z0 )
Metric Definition Localization Metrics Let H be a heatmap, where H(p) denotes the response at pixel p, and let G denote the set of pixels covered by the union of the human-annotated boxes. Each heatmap is independently normalized to [0, 1]: H(p) − Hmin , Hmax > Hmin , b H(p) = Hmax − Hmin (6) 0, H =H , max
min
(a) 1-object Source
(b) 1-object GT annotation
(d) 2-object Source
Source
(b) (c) (d) (e) (f)
GT annotation
Source
(e) 2-object GT annotation
Source
Panel Source prompt (a)
(c) 1-object GT annotation
(f) 3-object GT annotation
Source
GT annotation
Target prompt
a portrait of a freckled woman with wavy auburn hair, a portrait of a freckled woman with wavy auburn hair, against a light olive backdrop against a light olive backdrop, wearing an amber bead necklace an empty café table near a window an empty café table near a window with a cup of coffee on it a sandy beach near the ocean a sandy beach near the ocean with a colorful beach ball on it a kitchen counter near a sunny window a kitchen counter near a sunny window with a bowl of oranges and a glass of milk on it a quiet lake shore with wooden steps a quiet lake shore with wooden steps, a small boat, and a duck on the water a calm riverside walkway with benches a calm riverside walkway with benches, a parked bicycle, a person sitting on a bench, and a small dog nearby
Figure 7: Representative EditRegion-Bench addition cases and their prompts. Each panel pairs the source image with the human edit-region annotation. Panels (a)–(c) are single-object additions, (d)–(e) are two-object additions, and (f) is a three-object addition. where Hmin and Hmax are the minimum and maximum responses over all pixels, respectively. Average precision (AP). Pixels in G are treated as positives and all remaining pixels as negatives. We sort all pixels in descending order of their normalized heatmap responses and compute the standard non-interpolated average precision: X AP = (Rk − Rk−1 )Pk , (7) k
where Pk and Rk are the precision and recall at the kth point on the precision–recall curve. AP evaluates whether annotated-region pixels receive higher responses. Foreground–background contrast (FBC). Let N denote the total number of pixels. We first compute the mean responses inside and outside the annotated region: X 1 X b 1 b µfg = H(p), µbg = H(p). (8) |G| N − |G| p∈G
p∈G /
FBC is then defined as FBC =
µfg − µbg . µfg + µbg + ε
(9)
We use ε = 10−8 . FBC lies in [−1, 1], with higher values indicating stronger separation between annotated and background regions. Background 99th percentile (bgp99 ) and PeakHit. The high-background response is defined as b bgp99 = Q0.99 {H(p)|p ∈ / G} , (10) where Q0.99 denotes the 99th percentile and lower values are better. PeakHit is defined as b PeakHit = arg max H(p) ∈ G, p
(11)
which indicates whether the strongest heatmap response falls inside an annotated edit region.
(a) 1-object Source
(b) 1-object GT annotation
(d) 2-object Source
Source
GT annotation
(e) 2-object GT annotation
Source
(b) (c) (d) (e) (f)
Source
GT annotation
(f) 3-object GT annotation
Panel Source prompt (a)
(c) 1-object
Source
GT annotation
Target prompt
a young man wearing a red baseball cap, standing on a a young man wearing a blue baseball cap, standing on a city sidewalk, lit by soft daylight city sidewalk, lit by soft daylight a photo of a cat in a basket a photo of a dog in a basket a red rose on a wooden table a pink tulip on a wooden table a tabby cat and a brown rabbit sitting in a row on green a brown hare and a small dog sitting in a row on green grass grass a wooden table set with a bowl of ramen and chopsticks, a wooden table set with a bowl of salad and a fork, photographed from a slightly higher angle photographed from a slightly higher angle a red apple, a green pear, and a red rose arranged in a an orange, a ripe mango, and a pink tulip arranged in a row on a marble counter row on a marble counter
Figure 8: Representative EditRegion-Bench replacement cases and their prompts. Panels (a)–(c) are single-object replacements, (d)–(e) are two-object replacements, and (f) is a three-object replacement. Each annotated view shows the union’s constituent human boxes before unioning. Mask IoU (mIoU). We apply Otsu’s threshold to each heatmap to obtain a binary mask M . The per-case IoU is IoU =
|M ∩ G| , |M ∪ G| + ε
(12)
where ε = 10−8 . mIoU is the mean IoU over all cases.
Editing Metrics Aesthetic score (AS). The aesthetic quality of the edited images is evaluated using the LAION aesthetic score. CLIP score (CLIPsim ). We use TorchMetrics CLIPsim with openai/clip-vit-large-patch14 to measure the image–text similarity between Iedit and the target prompt ctgt . The score is reported on its native 0–100 scale, with higher values indicating stronger semantic alignment. Background fidelity. We evaluate background preservation using PSNR and LPIPS. Let B denote the background binary mask. Background PSNR is computed from the masked edited and source images: PSNR = −10 log10 (MSE (B ⊙ Iedit , B ⊙ Isrc )) , (13)
where the image range is [0, 1]. The MSE is computed over the complete masked images, so pixels inside the annotated edit region are set to zero in both images. For LPIPS, the same masked images are mapped from [0, 1] to [−1, 1] and evaluated using the SqueezeNet-based LPIPS network. The tables report LPIPS × 103 where indicated. Qwen-based source-erasure evaluation. To directly evaluate whether the source concept is effectively removed, we additionally employ Qwen2.5-VL-7B-Instruct as a frozen automatic evaluator on replacement cases. For each edited result, the evaluator first determines whether the source concept or any recognizable sourcespecific cue remains in the edited image, including characteristic parts, colors, textures, materials, or silhouettes. It then compares the source and edited images to determine whether the annotated edit region undergoes a meaningful visual or semantic change. For the i-th edited result, let si ∈ {absent, minor_residue, major_residue} (14)
Table 5: Qwen2.5-VL-based automatic source-erasure evaldenote its source-residue label, where uation on the replacement cases of EditRegion-Bench and • absent indicates that neither the source concept nor any PIE-Bench. Bold indicates the best result among methods recognizable source-specific residue remains. without externally specified edit regions. † denotes methods • minor_residue indicates that a small but recognizprovided with ground-truth edit boxes. able source-specific part, texture, color, or silhouette remains. EditRegion-Bench PIE-Bench Method • major_residue indicates that the source concept or SRR↓ REFR↓ ESER↑ SRR↓ REFR↓ ESER↑ substantial source-specific content remains clearly recogPnPInversion 32.66 22.58 62.10 37.50 47.50 45.00 nizable. MasaCtrl 65.32 50.40 27.42 46.25 58.75 30.00 RF-Inversion 31.45 17.34 65.73 38.75 15.00 58.75 For the i-th edited result, let ri denote the fine-grained Stable Flow 63.71 55.65 27.02 55.00 67.50 22.50 identity class returned by Qwen2.5-VL. We determinisFlowEdit 24.60 19.35 70.56 37.50 32.50 55.00 FYS 21.37 18.95 73.39 31.25 25.00 60.00 tically map TARGET_ONLY and NEITHER to absent, RF-Solver-Edit 20.56 20.16 73.39 28.75 17.50 62.50 HYBRID_TARGET_DOMINANT to minor_residue, FLUX.1-Fill† 14.71 4.23 81.68 27.50 21.25 66.25 and OLD_ONLY, HYBRID_OLD_DOMINANT, and KV-Edit† 29.84 22.98 65.32 37.50 38.75 50.00 HYBRID_BALANCED to major_residue. PC-Edit w/o Msrc 23.39 14.52 72.18 27.50 27.50 58.75 Similarly, let PC-Edit (ours) 15.53 11.50 82.44 21.25 23.75 67.50 ci ∈ {meaningful_change, weak_change, unchanged} (15) denote the regional-change label, where Automatic Source-Erasure Evaluation with • meaningful_change indicates a clear visual or seQwen2.5-VL mantic change within the annotated edit region. We use Qwen2.5-VL-7B-Instruct as a frozen automatic • weak_change indicates only limited or insufficient evaluator for source-erasure analysis on replacement cases. changes, such as slight movement, small texture variaAs illustrated in Fig. 9, the evaluator first extracts tions, or minor color fluctuations. the source concept and target concept, and then pre• unchanged indicates that the annotated edit region redicts a class of source residue from the edited immains essentially unchanged. age and its enlarged region crops, which is deterministically mapped to one of three source-residue levels: Source Residue Rate (SRR). SRR measures the proporabsent, minor_residue, or major_residue. Seption of edited results in which the source concept or recarately, it compares the source and edited images to ognizable source-specific content remains. Both minor and classify the regional change as meaningful_change, major residues are counted: weak_change, or unchanged. These labels are used to N 1 X compute SRR, REFR, and ESER. The complete evaluation SRR = {i | si ∈ {minor_residue, major_residue}} prompts are provided in Sec. . N i=1
(16) A lower SRR indicates more complete removal of the source concept. Regional Edit Failure Rate (REFR). REFR measures the proportion of cases in which the annotated edit region undergoes only a weak change or remains nearly unchanged: N 1 X REFR = {i | ci ∈ {weak_change, unchanged}} . N i=1 (17) A lower REFR indicates fewer insufficiently edited cases.
Results. Table 5 reports SRR, REFR, and ESER on the replacement cases of EditRegion-Bench and PIE-bench. Among methods without externally specified edit regions, PC-Edit achieves the lowest SRR and REFR and the highest ESER. Compared with the variant without Msrc , the full method substantially reduces SRR and REFR while improving ESER, confirming the effectiveness of the sourceerasure footprint. These results indicate that the inversiontime source-erasure footprint more effectively suppresses recognizable source content while reducing insufficient edits.
More Qualitative Results
Effective Source-Erasure Rate (ESER). ESER counts Figures 10 and 11 provide additional qualitative comparisons a case as successful only when the source concept is no on object addition and replacement, respectively, complelonger recognizable and the annotated edit region undergoes menting the results reported in the main paper. For addition, a meaningful change: PC-Edit more consistently introduces the requested objects N while preserving unrelated scene content. For replacement, it 1 X ESER = 1− {i | si = absent ∧ ci = meaningful_change}better . removes the source objects, accommodates the shapes N i=1 of the target objects, and limits unintended changes out(18) side the edited regions. These examples further demonstrate Unlike 1 − SRR, ESER excludes cases in which the source the effectiveness of prompt-contrastive region discovery and concept is judged absent but the designated region remains region-guided source-feature injection across diverse editing nearly unchanged. It therefore provides a stricter measure of scenarios. effective source removal.
Stage 1: Edit-specification extraction Input: source prompt, target prompt Output: source concept, target concept, unchanged context
Stage 2: Source-residue assessment Input: edited image, enlarged edit-region crops, and extracted source/target concepts Output: source-residue class
Stage 3:Regional-change assessment Input: source and edited images, together with paired region crops Output: regional-change class
Deterministic label mapping Source-residue and regional-change labels
Source-erasure metrics SRR • REFR • ESER
Figure 9: Overview of the Qwen2.5-VL-based source-erasure evaluation. The evaluator first extracts the intended edit from the prompts. It then independently assesses source residue from the edited result and regional change from source–edited comparisons. The outputs are deterministically mapped to the labels used to compute SRR, REFR, and ESER.
Src image
PnP
MasaCtrl
RF-Inv.
Stable Flow FlowEdit
FYS
RF-Edit
a woman
a woman wearing a blue backpack
a gardener
a gardener wearing sun hat
a rabbit
a rabbit wearing round glasses
a horse
a horse wearing a red collar
a man
a desk with a pen and a notebook on it
a desk
a desk with a vase and some cakes on it
a boy and a fluffy sheepdog
FLUX.1-Fill
Ours
a man wearing a red hat
a desk
city street
KV-Edit
city street with a motorcycle and a dog on it
a boy and a fluffy sheepdog, the boy wearing a tan cap, and the dog with a red collar
a woman
a grass by the roadside
a woman wearing a headband, a pearl necklace, and earrings
a grass by the roadside with a basket, a soccer ball, and a dog on it
Figure 10: Additional qualitative comparisons on object addition. PC-Edit introduces the requested objects while better preserving unrelated content.
Src image
PnP
MasaCtrl
RF-Inv.
Stable Flow FlowEdit
FYS
a woman wearing a black backpack
RF-Edit
Ours
a rugby
a rose
a tulip
a cucumber
a banana
a pair of boots
a pair of sneakers
a surfboard and a beach ball
a cake and a fruit bowl
a dog and a seagull
a bird and a rabbit
a cat and a dog
a penguin doll and a teddy bear
a cat and a dog
a penguin doll and a teddy bear
a rose, a tulip, and a daisy in a vase
FLUX.1-Fill
a woman wearing a yellow backpack
a volleyball
an apple, a pear, and a banana on the table
KV-Edit
an orange, a mango, and a pumpkin on the table
a sunflower, a lily, and a carnation in a vase
Figure 11: Additional qualitative comparisons on object replacement. PC-Edit more completely removes the source objects and generates the target objects while better preserving unrelated content.
Complete Qwen2.5-VL Evaluation Prompts The following prompts are reproduced exactly for completeness. Placeholders enclosed by braces are replaced with the corresponding case-specific information during evaluation.
Stage A: Edit-Specification Extraction System prompt You precisely compare captions. Return JSON only.
User prompt Extract only the intended visual edit from two captions. Do not inspect any image. Separate changed concepts from shared context. SOURCE PROMPT: {src} TARGET PROMPT: {dst} TASK TYPE: {edit_type} For category replacement, old_concept is the complete old object identity and new_concept is the complete new object identity. For attribute replacement, old_concept/new_concept are only the changed attributes, while the shared object belongs in shared_context. For addition, old_concept is "none". Return JSON only: { "old_concept": "specific identity/attribute or none", "new_concept": "specific identity/attribute", "shared_context": ["unchanged concepts"], "edit_subtype": "category_replacement | attribute_replacement | addition | multi_edit" }
Stage B: Source Residue Classification For this stage, the evaluator receives the edited full image and the enlarged crops of the annotated edit regions. The source image is not provided. System prompt Judge literal visible evidence in the edited image only. Return JSON only.
User prompt Inspect only the EDITED result, especially each numbered region. OLD CONCEPT THAT SHOULD HAVE BEEN REMOVED: {old_concept} REQUESTED TARGET CONCEPT: {new_concept} First describe the visible identity, colors, texture/material, diagnostic parts, and silhouette. Then choose exactly one mutually-exclusive class: - OLD_ONLY: The old concept remains recognizable and the target is absent. - TARGET_ONLY:
The target is recognizable and no old-specific cue remains. - HYBRID_OLD_DOMINANT: Both old and target concepts contribute, with strong or extensive old identity remaining. - HYBRID_TARGET_DOMINANT: The target is recognizable, but a small old-specific part, color, texture, outline, or silhouette remains recognizable. - HYBRID_BALANCED: Both old and target identities are substantially visible. - NEITHER: Neither the old nor the target concept is recognizable. For category replacement, explicitly check old-specific body shape, silhouette, material/texture, and diagnostic parts even when the face or surface resembles the target. For attribute replacement, any recognizable old color or texture is old residue. The shared object category is not residue. Common features shared by the old and target concepts do not count as residue. Do not use a source image and do not reward the requested text. Return exactly one JSON object: { "visible_description": "literal visible identity and old/target cues", "class": "OLD_ONLY | TARGET_ONLY | HYBRID_OLD_DOMINANT | HYBRID_TARGET_DOMINANT | HYBRID_BALANCED | NEITHER", "evidence": "short decisive visible evidence" }
Stage C: Regional-Change Classification For this stage, the evaluator receives the source and edited full images together with paired source and edited crops of the annotated regions. System prompt Judge literal visible evidence in the edited image only. Return JSON only.
User prompt Compare SOURCE versus EDITED only inside and immediately around the numbered regions. Choose exactly one class: - MEANINGFUL_CHANGE: A clear object or attribute rewrite is visible. - WEAK_CHANGE: Only movement, tiny texture or color fluctuation, or reconstruction noise is visible. - UNCHANGED: Essentially no visible change is present. This question is only about change magnitude, not target success. Return exactly: { "class":
"MEANINGFUL_CHANGE | WEAK_CHANGE | UNCHANGED", "evidence": "literal visible difference" }