Moving image · Research feature

AI Framework Improves Precision in Multi-Object Video Editing

A new AI method enables accurate, localized edits to multiple objects in videos without affecting others, using a dedicated dataset and evaluation metric.

Adapted from research by Samuel Teodoro, Agus Gunawan, Soo Ye Kim and colleagues.

arXiv preprint revision · 2026-10-14 · Attribution & reuse
In this article
Fig. 9: Ablation study on IPR (Sec. III-C).
Fig. 9: Ablation study on IPR (Sec. III-C).

Editor’s introduction

The study introduces PRIMEdit, a zero-shot framework designed for instance-aware multi-object video editing. It compares PRIMEdit against five global editing methods and two multi-object methods, measuring performance through editing faithfulness, leakage, and accuracy. A key innovation is the MIVE dataset, which includes videos with varying numbers of instances and sizes, enabling controlled analysis of scene complexity. The research also proposes a Cross-Instance Accuracy (CIA) Score to quantify editing leakage, showing strong alignment with human judgments. Findings indicate PRIMEdit achieves better precision and reduced leakage compared to existing methods.

Introduction

Recent VE methods leverage pre-trained text-to-image (T2I) models. Compared with training on large-scale datasets or fine-tuning on single videos, zero-shot methods continue to gain attraction for their efficiency and the availability of pre-trained T2I models. Most zero-shot approaches perform global editing that modifies the entire scene or single-object editing that may unintentionally affect other parts of the video. However, users often require precise object-level editing without altering the rest of the video, e.g., replacing explicit content, like cigarette, to create family-friendly versions.

Very recently, VideoGrain attempted to address attention leakage using object masks and attention modulation. However, modulation in spatio-temporal attention (STA) introduces significant memory and computational overhead, especially as the number of video frames increases (see Table XII). Moreover, to describe edited scenes, VideoGrain relies on global edit captions, which may be unavailable or difficult to generate for scenes with a large number of objects.

Furthermore, both GAV and VideoGrain are evaluated on limited datasets, insufficient for comprehensive testing of multi-instance VE across diverse viewpoints, instance sizes, and numbers of instances. In addition, the global editing metrics used in these methods fail to accurately measure local editing quality, which is essential for multi-instance VE.

From the above, four critical challenges remain in multi-instance VE: (i) Attention leakage. The lack of local control in pre-trained T2I models, imprecise input conditions, and reliance on a single global edit caption prevent previous methods from effectively disentangling edit prompts; (ii) Unfaithful editing. The absence of techniques to enhance editing faithfulness in multi-instance VE often leads to inaccurate edits; (iii) Lack of fast and intuitive multi-instance VE methods. Although modulation in enables per-object editing, it slows the generative process, and reliance on full-scene descriptions makes editing cumbersome, especially in cluttered videos. (iv) Lack of evaluation datasets and metrics. Recent methods are evaluated on limited datasets using metrics inadequate for assessing local VE quality.

Global Video Editing

Recent advances in diffusion models have accelerated progress in T2I and T2V models for generative tasks. These breakthroughs led to numerous video editing (VE) frameworks built on pre-trained backbones. Existing methods either fine-tune models for editing (training-based), optimize on a single input video, or enable VE without additional training or optimization (zero-shot). Our work belongs to the zero-shot category, allowing editing without additional training or optimization.

To address temporal inconsistency, Tune-A-Video proposes a one-shot tuning strategy and a spatio-temporal attention mechanism that extends spatial self-attention in latent diffusion models to capture inter-frame correlations. FateZero builds on this by enabling VE without tuning, storing intermediate attention maps during inversion and reusing them during editing to preserve structural and motion consistency.

Following these early works, many approaches improved temporal consistency by modifying spatio-temporal attention while preserving editing fidelity. For example, FLATTEN and COVE incorporate optical flow and diffusion feature correspondences, respectively, into the spatio-temporal attention computation, enabling patches with similar trajectories to attend across frames. FRESCO further disentangles spatio-temporal attention into intra-frame and inter-frame components to better capture spatial and temporal dependencies.

Another line of work modifies input formats or processing strategies to improve temporal coherence. RAVE uses latent grids and noise shuffling, while TokenFlow propagates diffusion features using inter-frame correspondences. ControlVideo uses ControlNet with spatio-temporal attention for structural alignment. Slicedit processes spatial and spatiotemporal slices during sampling. In contrast, our work adopts a T2V model to maintain temporal consistency while focusing on localized multi-instance editing fidelity.

Local Video Editing

Local Video Editing. Local VE aims to modify specific regions of input frames without modifying other parts. Similar to image generation and editing, the demand for fine-grained control in videos has led to several local VE methods. These methods typically adapt spatial control techniques from image generation to VE. In image generation, spatial control is achieved either by training additional adapters or by zero-shot techniques such as attention manipulation, optimization, and multi-branch sampling.

In particular, AVID adds motion modules to a T2I inpainting model (Stable Diffusion ) and trains a ControlNet-based structure guidance for tasks such as retexturing and uncropping. In the zero-shot setting, Video-P2P achieves single-object-level localized editing by adopting cross-attention control which combines cross-attention maps from the reconstruction branch to preserve unedited parts and the editing branch to edit a specific region. More recently, DreamMotion employs a T2V model and performs editing via score distillation sampling. Although capable of local control, these methods are designed for single-object editing and often fail when handling multiple objects simultaneously (see Appendix for Video-P2P results).

Multi-Instance Local Video Editing. To overcome the limitations of local VE, which either handles single-object editing but is prone to attention leakage or performs sequential object-by-object editing but accumulates noise, multi-instance VE aims to edit multiple objects simultaneously. Multi-instance VE remains relatively underexplored, with few works adapting image generation techniques for object localization. GAV leverages GLIGEN and integrates gated self-attention layers into transformer blocks for spatial control. However, GLIGEN requires retraining these layers for each new T2I model (e.g., SDv1.5 and SDv2.1), reducing flexibility. VideoGrain uses masks and attention modulation for the spatio-temporal attention (STA) and cross-attention layers. However, manipulating STA increases computational costs as the number of edited frames increases. Our work introduces a novel redistribution technique that operates only in cross-attention layers, enabling seamless integration with any T2I or T2V model and spatial control with minimal overhead. Table I presents a more detailed comparison between our work and two previous multi-instance VE SOTA methods. Compared to GAV and VideoGrain, our PRIMEdit enables mask-based multi-instance VE using a simpler localization mechanism, IPR, applied only in the U-Net’s cross-attention layers, and supports integration with T2I and T2V models.

MIVE Dataset Construction

Existing datasets are unsuitable for multi-instance video editing (VE) tasks. TGVE and TGVE+ contain few videos, limited objects with few instances per object class, and no instance masks. VideoGrain’s dataset similarly includes few objects and limited instances per class. GAV’s dataset is only partially available, and DAVIS does not distinguish multiple instances within the same class, making it unsuitable for multi-instance VE.

In addition to the source captions, we generate a target caption for each instance using Llama 3 to prompt edits such as retexturing or swapping, similar to. We instruct Llama 3 to generate five candidate target captions for each instance, and randomly select one for the final target instance caption. We then modify the global source caption by replacing its instance captions with the selected targets to form the global target caption. Although we focus on “thing” instances, we also generate captions for the “stuff” and background elements to enable future extensions with LLM-based target edits. Sample frames and captions are provided in the Appendix.

Cross-Instance Accuracy (CIA) Score

We propose a new metric, the Cross-Instance Accuracy (CIA) Score, to address limitations of existing VE metrics, particularly their inability to capture editing leakage, often referred to as attention leakage. Global Textual Faithfulness (GTF) and Frame Accuracy (FA) fail to detect cases where a prompt for one instance affects others, as they cannot capture the nuances of individual instances within the global captions and frames. Instance Accuracy (IA), defined as the percentage of instances more similar to their target instance caption than source instance caption, only measures target caption alignment and ignores interference from other instance captions. Local Textual Faithfulness (LTF) evaluates alignment between a cropped instance and its target instance caption but also overlooks leakage from other captions. Background Preservation (BP) measures background changes but cannot detect leakage affecting instances. We further observe cases where the LTF between a cropped instance and another instance’s target caption exceeds the score with its own instance caption, revealing cross-instance leakage.

Experiments

Evaluation metrics. To evaluate the edited frames, we report standard metrics: (i) Global Temporal Consistency (GTC): average cosine similarity of CLIP image embeddings between consecutive frames, (ii) Global Textual Faithfulness (GTF): average similarity between the frames and global edit prompts, and (iii) Frame Accuracy (FA): percentage of frames with greater similarity to the target than the source prompt.

Global metrics assess overall frame quality but they overlook nuances in individual instance edits, which is essential for multi-instance tasks. To address this, we use Local Temporal Consistency (LTC), Local Textual Faithfulness (LTF), and Instance Accuracy (IA). We crop each instance using the bounding boxes inferred from their masks and add padding to preserve their aspect ratios. LTF is calculated as the average cosine similarity between the CLIP image embeddings of each cropped instance and the text embeddings of its instance caption. LTC is similarly measured as the average cosine similarity between cropped instances across consecutive frames. The IA is the percentage of instances with a higher similarity to the target instance caption than to the source instance caption. We also quantify cross-instance leakage through our proposed CIA Score (Sec. IV-B) and background leakage through SSIM and LPIPS. Table IV provides a concise summary of all evaluation metrics and their definitions.

Experimental Results

We compare our PRIMEdit against recent zero-shot video editing (VE) methods: (i) five global editing methods: ControlVideo, FLATTEN, RAVE, FreSCo, TokenFlow, and (ii) two multi-object editing methods: GAV and VideoGrain. The five global editing methods use single global source and global target captions. For the multi-object editing methods, GAV and VideoGrain utilize a combination of a global source caption, instance source captions, a global target caption, and instance target captions along with bounding box and mask conditions per instance. Our PRIMEdit requires instance masks and local target captions only. We exclude Video-P2P since it edits one instance at a time, accumulating error when used in multi-instance editing scenarios. We also exclude ConMo, which, despite its ability to disentangle individual object motions, lacks explicit local control in assigning instance captions to specific target instances (see Appendix). For each baseline above, we use its default settings.

Quantitative comparison. Table V shows the quantitative comparisons. The SOTA methods yield (i) low LTF and IA scores, indicating less accurate instance-level editing, and (ii) low CIA scores, reflecting significant attention leakage. In contrast, our PRIMEdit achieves the best scores in key multi-instance VE metrics (LTC, LTF, IA, and CIA), demonstrating its superior ability in maintaining temporal consistency, fine-grained textual alignment, and instance-aware modifications. Note also that our PRIMEdit exhibits a robust performance for background preservation metrics, achieving the best SSIM and second-best LPIPS scores without relying on an inpainting model like GAV. This further underscores its effectiveness in isolating instance edits while preserving and preventing the editing leakage in the background.

Ablation Studies

Ablation study on core components. Table VI (top) reports the quantitative results of the core component ablations. We first disable IPR, equivalent to vanilla cross-attention, and use a DMS-only baseline. As expected, without local control, this setting yields lower LTF, IA, and CIA compared to IPR-based variants, although it achieves the highest LTC, indicating strong temporal consistency from full DMS harmonization.

Finally, activating both IPR and full DMS achieves the best overall balance, yielding the highest LTF and IA, second-best LTC and SSIM, and competitive CIA and LPIPS. This demonstrates that combining IPR with full DMS enhances editing faithfulness and instance discrimination while preserving strong temporal coherence.

Analyses on Difficulty Levels of Dataset

Here, we deeply analyze the performance of baseline methods and our PRIMEdit based on: (i) the instance sizes and (ii) the number of instances to know if there is any bias in the performance. For the experiments on instance size variations, we evaluate the local scores for different object sizes according to the COCO dataset categories on 200 videos of MIVE dataset. Meanwhile, for experiments on various numbers of instances, we classify 200 videos into three categories, depending on the number of edited instances per video. In addition, we also perform additional experiments on single instance video editing, where we select the largest instance to be edited.

For medium and large instances, our PRIMEdit achieves the best performance in textual faithfulness (LTF and IA) and the second-best (comparable to the best) performance in LTC. Both our PRIMEdit and VideoGrain significantly outperform the global video editing methods and the bounding box-based method (GAV) in LTF and IA metrics. This highlights the advantage of using masks over bounding boxes as conditioning mechanisms for multi-instance VE, allowing for more precise and context-aware instance modifications.

We further observe a trade-off between editing fidelity and temporal consistency in the multi-instance VE setting, as reflected in the performance comparison (Table VII) for our PRIMEdit, GAV and VideoGrain. There is a tendency of temporal consistency drop when we maximize the editing fidelity in multi-instance setting. Nonetheless, our PRIMEdit still maintains competitive LTC performance against global editing methods while achieving the best editing fidelity in terms of LTF and IA scores.

Similar to the quantitative results for different instance sizes, we can also observe a trade-off between temporal consistency and editing fidelity in multi-instance settings across different numbers of instances. Our PRIMEdit, however, effectively balances this trade-off, achieving a superior editing fidelity while maintaining competitive temporal consistency.

Analysis on DMS

Regarding leakage sensitivity, the CIA scores provide the clearest distinction. The differences in CIA are most pronounced under corruption types that introduce irregular or fragmented mask boundaries, such as jittered and hole-injected masks. In these settings, PRIMEdit maintains a clearer advantage, indicating stronger resistance to cross-instance interference when mask precision is disrupted in non-uniform ways. Even in corruption types where the relative percentage gaps are smaller (e.g., dilated or eroded masks), PRIMEdit still consistently achieves higher raw CIA scores than VideoGrain. This pattern suggests that cross-instance leakage is more strongly triggered by irregular mask perturbations than by uniform boundary scaling.

Overall, the combined quantitative (shown in the last column of Table X) and qualitative evidence demonstrates that PRIMEdit is less sensitive to mask inaccuracies (i.e., strong robustness against noisy masks enabled by the complementary interaction of IPR and DMS, where IPR stabilizes instance-level attention while DMS mitigates boundary distortions and missing regions). It preserves local scores, maintains stronger instance-level alignment, and exhibits better leakage control across different perturbation types, especially under severe corruption such as hole-injected and mixed-noise masks.

Runtime and GPU Memory Usage Comparison

The baselines are grouped into global (top) and local (bottom) editing methods. As shown in Table XII, larger numbers of instances or longer sequences lead to increased computational and memory demands for our PRIMEdit, which is expected for diffusion-based video generation models. However, our PRIMEdit still runs faster and uses less memory, compared to other multi-instance VE baselines.

Compared to the five global editing baselines, our PRIMEdit achieves competitive results. It should be noted, however, that the global video editing methods are incapable of localized multi-instance VE, as evidenced by their subpar performance (Local Scores and Leakage Scores) in Table V.

Conclusion

In this paper, we present PRIMEdit, a novel multi-instance video editing framework, featuring Instance-centric Probability Redistribution (IPR) and Disentangled Multi-instance Sampling (DMS), to elaborately handle instance-level video editing. PRIMEdit produces faithful, disentangled edits with minimal attention leakage, outperforming existing SOTA methods in qualitative, quantitative, and user studies on our newly proposed MIVE dataset, the first large-scale dataset dedicated to multi-instance video editing tasks. We further propose a new Cross-Instance Accuracy (CIA) Score to quantify the attention leakage from one instance to others, which often occurs in multi-instance video editing but has been overlooked by existing video editing metrics. Our user study supports the effectiveness of the CIA Score, showing the quality consistency with human’s visual perception.