TL;DR
MotionFlow is a training-free framework that transfers motion from a source video to a new text-generated scene by optimizing latent representations at test-time. By aligning the target video's attention patterns with "motion masks" extracted from the source, it achieves high-fidelity motion transfer across drastically different appearances without the artifacts common in direct attention-swapping methods.
What Problem Does This Paper Address?
While Text-to-Video (T2V) diffusion models have become incredibly powerful at generating diverse content, they remain notoriously difficult to control. If you want a "rabbit jumping into a river" to follow the exact trajectory of a "dog jumping into a lake" from a specific video, standard prompting won't cut it.
Existing motion transfer methods generally fall into two camps, both with significant drawbacks:
- Training-heavy methods: These require fine-tuning models on specific motion patterns, making them slow and inflexible for creative iteration.
- Attention-manipulation methods: These often involve "hot-swapping" attention maps from a source video into a target generation. While fast, this often forces the model into unnatural states, creating visual artifacts or unintentionally "leaking" the source's appearance (e.g., the rabbit starts looking like a dog) into the new scene.
MotionFlow seeks to provide a "third way": a training-free, test-time approach that preserves motion fidelity while allowing for total semantic freedom in the target video.
Methods
MotionFlow operates in two main stages: Inversion and Guided Generation.
1. Source Video Inversion & Mask Extraction
The process begins by taking a source video and its description. The authors use DDIM inversion to map the video back into the latent noise space of a pre-trained model (like ZeroScope). During this process, they extract cross-attention maps.
Because cross-attention maps represent where the model "looks" for specific words (tokens) in the prompt, they serve as a perfect proxy for the subject's position. MotionFlow converts these maps into binary spatio-temporal motion masks. These masks act as a "silhouette" of the motion trajectory over time, stripped of all texture and color.
2. Guided Video Generation
This is where the "Flow" happens. Instead of just running a standard denoising process, MotionFlow performs latent optimization during the first few steps of generation. For each timestep, the model calculates three specific losses:
- Cross-Attention Loss ($L_{CA}$): Forces the target subject (e.g., a "camel") to focus its attention within the source's motion masks (e.g., a "car's" trajectory).
- Self-Attention Loss ($L_{SA}$): Ensures that different parts of the generated subject (like a camel's legs and hump) move coherently together within the masked region.
- Temporal Attention Loss ($L_{TA}$): Maintains smooth motion and correspondence across frames to prevent flickering.
Crucially, MotionFlow optimizes the latents to satisfy these losses rather than overriding the attention maps directly. This allows the diffusion model to find a mathematically "natural" way to represent the new subject while still following the prescribed path.
Datasets
The researchers evaluated MotionFlow using:
- DAVIS (Densely Annotated VIdeo Segmentation): A standard benchmark for video object tasks. They sampled 100 video-prompt pairs to test diverse motion types (walking, jumping, riding, etc.).
- ZeroScope T2V: Used as the primary pre-trained backbone for experiments.
Key Insights and Ideas
- Optimization over Replacement: The "aha moment" here is that forcing attention maps (replacement) is too rigid. By treating attention as a guidance objective for latent optimization, the model retains its generative "creativity," leading to fewer artifacts and better adherence to the new text prompt.
- Semantic Flexibility: Because the guidance is based on abstract masks rather than raw pixels or features, the model can map motion between wildly different geometries—such as transferring the rigid motion of a train to the articulated movement of a motorbike, or a car's path to a walking camel.
- Architecture Agnostic: Although implemented on a UNet-based model, the authors note that the principle of attention-guided latent optimization is applicable to newer Diffusion Transformers (DiTs), making the method future-proof.
Key Results
MotionFlow was compared against state-of-the-art baselines including DMT, MotionDirector, and Motion Inversion.
- Quantitative: MotionFlow achieved the highest Text Similarity (0.322), indicating it follows the new prompt better than competitors while maintaining a high Motion Fidelity (0.940).
- User Study: In a study with 50 participants, MotionFlow was preferred significantly more often than all other methods across three categories: Prompt Alignment, Motion Fidelity, and Visual Quality.
- Efficiency: It is significantly faster to set up (49 seconds) than training-based methods like MotionDirector, though the test-time optimization makes the final generation slower than simple inversion-based methods.
Limitations and Future Work
- Computational Cost: Performing 20 optimization iterations per diffusion step adds overhead. While faster than training a new model, it's not yet "real-time."
- Manual Token Selection: The user currently needs to specify which tokens (e.g., "dog") should be used to generate the motion masks. Automating this via LLMs or object detection could further streamline the pipeline.
- Complex Interactions: While the paper shows great results for single subjects, transferring motion in scenes with multiple interacting subjects remains a complex frontier.
Summary updated