MagicMotion: Controllable Video Generation with Dense-to-Sparse Trajectory Guidance

Quanhao Li, Zhen Xing, Rui Wang, Hui Zhang, Qi Dai, Zuxuan Wu

TL;DR

MagicMotion introduces a novel framework for controllable video generation, allowing users to guide object movement with unprecedented flexibility using dense (masks) to sparse (bounding boxes) trajectory controls. This is achieved through a progressive training strategy and a new latent segmentation loss, enabling high-quality video synthesis with precise object adherence and consistency, outperforming existing methods.

What Problem Does This Paper Address?

Recent advances in video generation, particularly with diffusion models, have significantly improved visual quality and temporal coherence. However, a critical gap remains in achieving precise control over object motion. Existing methods often struggle with complex multi-object scenarios, leading to imprecise trajectory adherence, inconsistent object appearance, and compromised visual quality. Furthermore, these methods typically offer only a single type of trajectory control (e.g., points, masks, or boxes), limiting their applicability. The field also lacks large-scale, publicly available datasets and standardized benchmarks tailored for trajectory-controllable video generation, hindering robust development and evaluation.

Methods

MagicMotion tackles these challenges with a multi-stage approach:

  • Trajectory ControlNet: Inspired by ControlNet, this component integrates trajectory information into a pre-trained diffusion transformer (DiT) model. It encodes trajectory conditions (masks, boxes, sparse boxes) and injects them into the diffusion process via zero-initialized convolutional layers, allowing for fine-grained motion guidance.
  • Progressive Training: MagicMotion employs a three-stage training strategy, moving from dense to sparse control. Stage 1 trains the Trajectory ControlNet with dense mask conditions. Stage 2 refines the ControlNet and introduces a trainable segment head using bounding box conditions. Stage 3 further fine-tunes both components, enabling sparse box control. This progressive approach leverages knowledge from previous stages, leading to better performance than training from scratch.
  • Latent Segmentation Loss: To improve object shape perception, especially with sparse controls, a novel latent segmentation loss is introduced. This loss predicts segmentation masks directly in the latent space, avoiding computationally expensive pixel-space operations. It helps the model better understand fine-grained object shapes, enhancing consistency.

Datasets

  • MagicData: A newly introduced, large-scale dataset specifically for trajectory-controllable video generation. It comprises 23K video samples, each annotated with a <video, text, trajectory> triplet. The dataset was curated using a pipeline involving LLMs for object extraction and SAM2 for mask and bounding box generation, followed by rigorous filtering.
  • MagicBench: A comprehensive benchmark also introduced by the authors. It consists of 600 videos and is categorized into 6 groups based on the number of foreground objects (1 to 5+, with 100 videos per category). MagicBench evaluates models on both video quality and trajectory control accuracy, considering the number of controlled objects.
  • DAVIS: Used for evaluation, a standard dataset for video object segmentation.

Key Insights and Ideas

  • Dense-to-Sparse Control is Crucial: The paper argues that offering a spectrum of control from dense (masks) to sparse (boxes) is essential for practical usability. Masks offer precision but are hard to create, while sparse controls are user-friendly but less precise. MagicMotion bridges this gap.
  • Progressive Training Boosts Performance: Training the model in stages, starting with dense controls and moving to sparser ones, significantly improves performance. This suggests that learning precise motion from detailed cues first helps the model generalize better to less detailed controls.
  • Latent Space for Shape Perception: Performing segmentation and loss calculation in the latent space is an efficient way to enhance fine-grained object shape understanding without the high computational cost of pixel-level operations. This is particularly important for maintaining object consistency during motion.
  • Object Count Matters: The introduction of MagicBench, which categorizes evaluations by the number of controlled objects, highlights that controlling multiple objects presents distinct challenges compared to single-object control. This is a crucial factor often overlooked in prior benchmarks.

Key Results

MagicMotion demonstrates state-of-the-art performance on both MagicBench and DAVIS datasets.

  • Quantitative: On MagicBench, MagicMotion achieves significantly lower FID and FVD scores (indicating better video quality) and higher Mask_IoU and Box_IoU scores (indicating better trajectory control) compared to existing methods. For instance, using CogVideoX as a base, MagicMotion achieves FID of 15.06 and FVD of 112.69 on MagicBench, with M_IoU of 91.57% and B_IoU of 87.75%.
  • Qualitative: Visual comparisons show MagicMotion successfully controlling object motion along specified trajectories while maintaining object consistency and high visual quality. In contrast, other methods exhibit defects like object deformation, artifacts, and inconsistencies. Ablation studies show that using MagicData and the proposed progressive training and latent segmentation loss significantly improve results.

Limitations and Future Work

  • Limitations: The paper acknowledges that while MagicMotion offers significant advancements, challenges remain in handling extremely complex multi-object interactions and maintaining perfect consistency across very long video sequences. The current implementation is trained for one epoch, suggesting potential for further improvement with more extensive training.
  • Future Work: The authors suggest that their framework can be extended to more complex scenarios, such as controlling camera motion in conjunction with object motion. The development of more comprehensive datasets and benchmarks like MagicData and MagicBench is crucial for future research in this domain. The paper also implies that further exploration of latent space manipulation for enhanced control and consistency is a promising direction.

Summary updated

BibTeX
@inproceedings{li2025magicmotion,
  author = {Quanhao Li and Zhen Xing and Rui Wang and Hui Zhang and Qi Dai and Zuxuan Wu},
  title = {{MagicMotion: Controllable Video Generation with Dense-to-Sparse Trajectory Guidance}},
  booktitle = {IEEE/CVF International Conference on Computer Vision},
  year = {2025},
}
Figure