Abstract
LayerFlow is a unified diffusion-based framework designed to generate multi-layer video content, including transparent foregrounds, clean backgrounds, and seamlessly blended scenes. By representing different layers as sub-clips within a single sequence and utilizing a novel three-stage LoRA training strategy, LayerFlow achieves high-fidelity video decomposition and recomposition while maintaining perfect inter-layer harmony.
Introduction
Recent advancements in text-to-video generation have produced impressive results, yet most existing models generate "flat" videos. For professional video editors, this lack of structural depth necessitates labor-intensive post-processing tasks such as rotoscoping and inpainting to isolate or modify specific elements. LayerFlow addresses this by introducing a layer-aware model capable of generating and decomposing video into editable components.
Methodology: Unified Sequence Representation
The core of LayerFlow is built upon a Diffusion Transformer (DiT) backbone, specifically CogVideoX-2B. To handle multiple video streams (RGB, Alpha masks, and Backgrounds) without separate models, LayerFlow employs a Unified Sequence Representation.
By concatenating sub-clips of each layer into a single long sequence, the transformer's self-attention mechanism can simultaneously process all layers. This ensures spatial and temporal alignment; for instance, a shadow on the background naturally tracks the movement of a foreground object because the model "sees" both during the same attention pass.
Three-Stage LoRA Training
To overcome the scarcity of high-quality multi-layer video data, the authors developed a "sandwich" training approach:
- Base Training: Initial training on coarse layered videos created via automated segmentation (SAM-Track) and inpainting.
- Motion LoRA: Training on static, high-quality layered images (duplicated as frozen videos) to teach the model spatial quality and transparency without losing motion priors.
- Content LoRA: Fine-tuning on a mix of image and video data to refine visual fidelity.
Key Insights
A pivotal discovery in LayerFlow's development is the Motion vs. Quality trade-off. By using Motion LoRAs, the model can leverage high-resolution details from static image datasets while preserving fluid dynamics learned from video data. Furthermore, the model exhibits versatility through Noise Manipulation. By selectively removing noise from specific sub-clips during the diffusion process, LayerFlow can be conditioned for various tasks like background-conditioned generation or video decomposition without architectural changes.
Results and Evaluation
LayerFlow demonstrates significant improvements over ad-hoc pipelines that combine separate matting and motion modules.
Quantitatively, LayerFlow achieved a Text Alignment score of 0.2350 on VBench, significantly higher than the 0.1674 achieved by a LayerDiffuse+Motion baseline. Qualitatively, the model produces cleaner alpha mattes and avoids the common "halo" artifacts associated with automated inpainting. In user studies, LayerFlow was consistently preferred for its artistic quality and inter-layer harmony.
Conclusion and Future Work
While LayerFlow provides a robust framework for layer-aware generation, it currently operates with a fixed number of layers (Foreground, Alpha, Background, Blended). Future research will focus on supporting a variable number of layers to accommodate more complex production needs and improving computational efficiency for longer sequences.
Summary updated