factorized pseudo-3d convolution with axial decomposition
Implements efficient pseudo-3D convolutions by factorizing full 3D operations into separate 2D spatial convolutions and 1D temporal convolutions, reducing computational complexity from O(D×H×W) to O(D+H+W). This PseudoConv3d module enables the model to leverage pre-trained 2D image weights while adding temporal processing, allowing video generation without retraining from scratch on massive video datasets.
Unique: Factorizes 3D convolutions into separable 2D+1D components rather than using full 3D kernels, enabling direct weight transfer from 2D image models while maintaining temporal expressiveness through dedicated 1D temporal convolutions
vs alternatives: More parameter-efficient than full 3D convolutions (reduces parameters by ~70%) while maintaining better temporal coherence than naive frame-by-frame processing, enabling practical video generation on consumer hardware
spatiotemporal attention with cross-frame relationships
Implements SpatioTemporalAttention module that applies attention mechanisms across both spatial dimensions (within frames) and temporal dimensions (across frames), capturing long-range dependencies between pixels within individual frames and semantic relationships across video frames. Uses Flash Attention for efficient computation, reducing quadratic attention complexity through kernel fusion and block-wise computation.
Unique: Combines spatial and temporal attention in a unified module rather than applying them sequentially, enabling direct modeling of spatiotemporal relationships; integrates Flash Attention for kernel-fused computation reducing memory bandwidth bottlenecks
vs alternatives: More memory-efficient than standard multi-head attention (40-50% reduction with Flash Attention) while capturing richer temporal dependencies than frame-independent spatial attention, enabling longer coherent video generation
configurable temporal processing depth and granularity
Provides fine-grained control over where and how temporal processing occurs in the network through configuration parameters like enable_time (global on/off), temporal_conv_depth (which layers include temporal convolutions), and attention_temporal_depth (which layers include temporal attention). This enables researchers to experiment with different temporal processing strategies without modifying core architecture code.
Unique: Exposes temporal processing configuration at multiple granularity levels (global, per-depth, per-layer) rather than fixed temporal processing patterns, enabling systematic exploration of temporal processing strategies
vs alternatives: More flexible than fixed architectures while maintaining cleaner code than fully parameterized designs, enabling practical experimentation without architectural modifications
gradient checkpointing for memory-efficient training
Implements gradient checkpointing (activation checkpointing) to reduce memory usage during training by recomputing activations during backward pass instead of storing them. This trades computation for memory, enabling larger batch sizes or longer videos on memory-constrained hardware. Checkpointing can be selectively enabled at different network depths.
Unique: Implements selective gradient checkpointing at multiple network depths rather than global checkpointing, enabling fine-tuned memory-computation tradeoffs
vs alternatives: More memory-efficient than naive training while maintaining faster convergence than extreme batch size reduction, enabling practical training on consumer hardware
dual-mode image-video processing with dynamic temporal gating
Implements SpaceTimeUnet architecture that processes both images and videos through the same model by dynamically enabling or disabling temporal processing layers based on input shape and enable_time parameter. When processing images (4D tensors), temporal convolutions and attention are skipped; when processing videos (5D tensors), full spatiotemporal processing is activated. This enables training on image datasets first, then fine-tuning on video data.
Unique: Single UNet architecture handles both image and video through runtime shape detection and conditional layer activation, rather than maintaining separate image and video models, enabling seamless transfer learning from image to video domain
vs alternatives: More parameter-efficient than maintaining separate image and video models while enabling direct weight transfer from image pre-training, avoiding the need for expensive video-only training from scratch
hierarchical multi-scale feature processing with skip connections
Implements standard UNet encoder-bottleneck-decoder architecture with skip connections across multiple resolution levels (typically 4-5 scales), allowing the model to capture both high-level semantic information (in bottleneck) and fine-grained spatial details (through skip connections). Each scale level uses ResnetBlock modules with optional temporal processing, enabling progressive refinement of generated video frames.
Unique: Combines standard UNet skip connections with spatiotemporal processing at each scale level, rather than applying temporal processing only at bottleneck, enabling temporal coherence to be maintained across all resolution levels
vs alternatives: Better detail preservation than single-scale models while maintaining temporal consistency across scales, compared to naive multi-scale approaches that process spatial and temporal dimensions independently
text-to-video generation with diffusion-based denoising
Implements text-to-video generation by integrating the SpaceTimeUnet with a diffusion process where the model learns to denoise progressively noisier video frames conditioned on text embeddings. The architecture accepts text prompts, encodes them into embeddings (typically via CLIP or similar), and uses these embeddings to guide the denoising process across multiple timesteps, generating coherent videos that match the text description.
Unique: Extends diffusion-based image generation to video by incorporating spatiotemporal processing throughout the denoising steps, rather than generating frames independently or using post-hoc temporal smoothing
vs alternatives: More temporally coherent than frame-by-frame generation while maintaining the flexibility of diffusion models for diverse output generation, compared to autoregressive models that accumulate errors over long sequences
efficient temporal convolution with 1d kernels
Implements 1D temporal convolutions as part of the PseudoConv3d factorization, processing temporal dimension separately from spatial dimensions. These 1D kernels operate along the frame axis, capturing temporal patterns and motion information with minimal computational overhead. The temporal convolutions are applied after spatial convolutions, enabling efficient sequential processing of temporal relationships.
Unique: Uses 1D temporal convolutions as part of factorized 3D operations rather than full 3D kernels, enabling direct reuse of 2D image model weights while adding lightweight temporal processing
vs alternatives: More efficient than 3D convolutions (10-20x fewer parameters for temporal dimension) while capturing basic temporal patterns, though less expressive than full 3D convolutions for complex motion
+4 more capabilities