Abstract
Sora has unveiled the immense potential of the Diffusion Transformer (DiT) architecture in single-scene video generation. However, the more challenging task of multi-scene video generation, which offers broader applications, remains relatively underexplored. To bridge this gap, we propose Mask^2DiT, a novel approach that establishes fine-grained, one-to-one alignment between video segments and their corresponding text annotations. Specifically, we introduce a symmetric binary mask at each attention layer within the DiT architecture, ensuring that each text annotation applies exclusively to its respective video segment while preserving temporal coherence across visual tokens. This attention mechanism enables precise segment-level textual-to-visual alignment, allowing the DiT architecture to effectively handle video generation tasks with a fixed number of scenes. To further equip the DiT architecture with the ability to generate additional scenes based on existing ones, we incorporate a segment-level conditional mask, which conditions each newly generated segment on the preceding video segments, thereby enabling auto-regressive scene extension. Both qualitative and quantitative experiments confirm that Mask^2DiT excels in maintaining visual consistency across segments while ensuring semantic alignment between each segment and its corresponding text description.
Introduction
While models like OpenAI’s Sora have demonstrated the power of Diffusion Transformers (DiT) for high-quality video generation, they primarily excel at single-scene clips. Generating a long video with multiple distinct scenes—each requiring its own unique prompt—remains a significant challenge. Existing approaches often suffer from discontinuity, where characters or backgrounds change abruptly between clips, or scalability issues, as older architectures struggle with long-range dependencies. Mask^2DiT addresses these gaps by establishing fine-grained alignment between video segments and text annotations while maintaining global visual coherence.
Methodology
Mask^2DiT builds upon the CogVideoX architecture, introducing a "dual-mask" strategy to decouple local semantic alignment from global temporal consistency.
Symmetric Binary Attention Mask
In a multi-scene setup, feeding multiple prompts simultaneously can lead to semantic confusion where details from one prompt bleed into another scene. Mask^2DiT employs a symmetric binary mask at each attention layer. This mask ensures that text tokens for a specific scene interact exclusively with the visual tokens of that scene. Crucially, visual tokens retain the ability to attend to one another across scenes, preserving the "visual thread" and temporal flow.
Segment-level Conditional Mask
To support auto-regressive scene extension beyond the training window, the model utilizes a segment-level conditional mask. During training, certain segments are treated as clean context, guiding the denoising of subsequent segments. This allows the model to generate additional scenes that are seamlessly integrated with preceding content.
Grouped Attention Mechanism
To manage the computational load of long sequences, a grouped attention strategy is implemented. By dividing sequences into smaller chunks for cross-attention, the model significantly reduces memory usage and improves processing efficiency.
Experiments and Results
The model was pre-trained on 1 million samples from the Panda70M dataset and fine-tuned on a curated dataset of high-quality multi-scene videos. Captions were enhanced using Google's Gemini to ensure consistent labeling of characters (e.g., "Actor 1").
Mask^2DiT demonstrates superior performance compared to state-of-the-art models like StoryDiffusion and TALC. Quantitative results show a 15.94% improvement in visual consistency over the base CogVideoX model and a significantly lower Fréchet Video Distance (FVD) of 720.01, compared to StoryDiffusion's 905.69. Qualitative evaluations confirm that Mask^2DiT maintains character persistence (e.g., clothing and features) across diverse camera angles and scene transitions.
Conclusion
Mask^2DiT represents a significant advancement in cinematic-quality long video generation. By decoupling text-to-video alignment from video-to-video coherence through a dual-masking approach, it achieves high semantic fidelity and visual stability. Future work will focus on improving real-world generalization, supporting adaptive scene lengths, and scaling to higher resolutions.
Summary updated