Abstract
We consider the problem of text-to-video generation tasks with precise control for various applications such as camera movement control and video-to-video editing. Most methods tacking this problem rely on providing user-defined controls, such as binary masks or camera movement embeddings. In our approach we propose OnlyFlow, an approach leveraging the optical flow firstly extracted from an input video to condition the motion of generated videos. Using a text prompt and an input video, OnlyFlow allows the user to generate videos that respect the motion of the input video as well as the text prompt. This is implemented through an optical flow estimation model applied on the input video, which is then fed to a trainable optical flow encoder. The output feature maps are then injected into the text-to-video backbone model. We perform quantitative, qualitative and user preference studies to show that OnlyFlow positively compares to state-of-the-art methods on a wide range of tasks, even though OnlyFlow was not specifically trained for such tasks. OnlyFlow thus constitutes a versatile, lightweight yet efficient method for controlling motion in text-to-video generation.
Introduction
While text-to-video (T2V) models have achieved remarkable success in generating high-quality imagery, they frequently struggle with precise motion controllability. Describing complex physical dynamics, such as a specific swirl in flowing paint or an exact surfing trajectory, is often beyond the descriptive power of text prompts alone. Existing solutions typically rely on simplistic user-defined controls like binary masks or require heavy fine-tuning (e.g., LoRA), which can degrade the model's ability to follow the original text prompt.
OnlyFlow addresses this gap by introducing a lightweight and versatile method for controlling motion using optical flow as a conditioning signal. By extracting motion from a reference video—whether real or synthetic—and injecting it into a frozen T2V model, OnlyFlow enables precise control over camera movements and object dynamics without sacrificing creative flexibility.
Methodology
OnlyFlow builds upon the AnimateDiff architecture, introducing a plug-and-play Motion Encoder to translate optical flow into the diffusion model's latent space.
- Optical Flow Extraction: The system utilizes a pre-trained RAFT model to extract pixel-level displacement maps from a reference video.
- The Motion Encoder ($\Phi$): This trainable module processes the raw optical flow through pixel-unshuffling, ResNet blocks, and temporal attention layers to match the model's latent dimensions.
- Feature Injection: Motion features are injected specifically into the temporal attention layers of the U-Net. This design choice reflects the fact that motion is inherently a time-based phenomenon, making temporal layers more effective than spatial ones for conditioning.
- Conditioning Strength ($\gamma$): An adjustable parameter allows users to control the influence of the motion signal during inference, providing a "knob" to balance motion fidelity with prompt adherence.
During training, the base T2V model remains frozen, ensuring computational efficiency and preserving the model's original generative capabilities.
Key Insights and Results
Optical Flow as a Universal Language
Unlike camera-specific embeddings, optical flow is agnostic to the source of motion. It treats all movement as pixel displacement, allowing the model to transfer motion from diverse sources, including drone shots, handheld cameras, or even synthetic wave patterns, with equal efficacy.
Semantic Alignment and Realism
A notable finding is that increasing motion conditioning strength often improves the Fréchet Video Distance (FVD). This suggests that real-world motion data guides the diffusion model toward more physically plausible generations. Furthermore, the model occasionally performs "semantic mapping," where the flow of one object (e.g., a person's smile) is mapped to a semantically different but structurally similar element in the target prompt (e.g., a clothesline), capturing subtle structural cues within the flow.
Performance Comparison
In user preference studies, OnlyFlow consistently outperformed state-of-the-art models such as Gen-1, VideoComposer, and TokenFlow, with preference rates ranging from 54.5% to 71.1%. Crucially, OnlyFlow maintains high CLIP scores, demonstrating that it does not compromise text prompt adherence to achieve motion control. Even in zero-shot camera control tasks, OnlyFlow outperformed specialized models like CameraCtrl in complex scenarios.
Conclusion and Future Work
OnlyFlow provides a robust framework for motion-conditioned video generation. While highly effective, its output quality is currently bounded by the base diffusion model (AnimateDiff) and the resolution of the training data (WebVid-10M). Future work may explore the integration of Kalman Filtering or homography-based estimation to better distinguish between camera and object motion, further refining the granularity of control.
Summary updated