video-diffusion-pytorch
FrameworkFreeImplementation of Video Diffusion Models, Jonathan Ho's new paper extending DDPMs to Video Generation - in Pytorch
Capabilities12 decomposed
space-time factored attention for video denoising
Medium confidenceImplements a specialized attention mechanism that decomposes video processing into separate spatial (within-frame) and temporal (across-frame) attention operations. This factorization reduces computational complexity from O(T*H*W)² to O(T*(H*W)² + (T)²*H*W) by processing frame-level spatial dependencies independently before computing temporal relationships across the sequence, enabling efficient video-scale diffusion model training.
Decomposes video attention into independent spatial and temporal branches rather than computing full 3D attention, directly implementing the space-time factorization strategy from Ho et al.'s Video Diffusion Models paper with explicit ResNet blocks in both paths
More memory-efficient than full 3D attention mechanisms used in some video models, while maintaining temporal coherence better than purely frame-independent spatial processing
3d u-net architecture with resnet blocks for video denoising
Medium confidenceImplements a 3D convolutional U-Net backbone with symmetric encoder-decoder paths using ResNet blocks for skip connections. The architecture processes video tensors through progressive downsampling (reducing spatial dimensions) and upsampling (reconstructing resolution) while maintaining temporal information, with sinusoidal time embeddings injected at each block to condition the model on the diffusion noise schedule step.
Extends 2D U-Net design to 3D by using 3D convolutional layers throughout encoder-decoder paths with ResNet-style skip connections, combined with sinusoidal time embeddings that are broadcast and added to feature maps at each resolution level
More parameter-efficient than some transformer-based video models while maintaining strong inductive biases for spatiotemporal coherence through convolutional locality
model checkpointing and state dict serialization
Medium confidenceSaves and loads complete model state (U-Net weights, optimizer state, training step counter) to disk as PyTorch .pt files. Enables resuming training from checkpoints and deploying trained models for inference. Checkpoints are saved at configurable intervals (e.g., every N steps) and can be loaded back into memory with automatic device placement (CPU/GPU).
Implements straightforward PyTorch state dict serialization for saving/loading complete training state, integrated directly into the Trainer class without external dependencies
Simple and reliable for single-GPU training, though lacks advanced features like distributed checkpointing or experiment tracking found in frameworks like PyTorch Lightning
configurable noise schedule for diffusion process control
Medium confidenceAllows users to define the noise schedule (how much noise is added at each diffusion step) through configurable parameters like num_timesteps, beta_start, and beta_end. The schedule determines the variance of added noise at each step, controlling the trade-off between training stability and generation quality. Common schedules include linear and cosine variance schedules, which affect how quickly the model transitions from clean data to pure noise.
Provides configurable noise schedule parameters (num_timesteps, beta_start, beta_end) that are pre-computed during GaussianDiffusion initialization, enabling easy experimentation with different schedules without code changes
More flexible than fixed schedules, though requires manual tuning; provides standard linear/cosine options vs. more exotic schedules in research papers
gaussian diffusion forward-reverse process for video generation
Medium confidenceImplements the complete diffusion pipeline with a forward process (training) that progressively adds Gaussian noise to videos according to a noise schedule, and a reverse process (generation) that iteratively denoises from pure noise. The forward process learns to predict added noise at each step, while the reverse process uses the trained model to sample coherent videos by starting from random noise and applying learned denoising steps with optional classifier-free guidance scaling.
Extends image-based DDPM diffusion to video by applying the same noise schedule and denoising objective across the temporal dimension, with space-time factored attention enabling efficient processing of video tensors while maintaining temporal consistency through the diffusion process
More stable training and better mode coverage than GANs for video generation, though slower at inference; provides principled probabilistic framework vs. autoregressive models which can accumulate errors over long sequences
bert-based text conditioning with classifier-free guidance
Medium confidenceEncodes text descriptions through a pre-trained BERT model to create semantic embeddings that condition the video diffusion process. Implements classifier-free guidance by training the model to handle both conditioned (with text embeddings) and unconditional (with null embeddings) inputs, allowing control over guidance strength via a cond_scale parameter that interpolates between unconditional and fully-conditioned predictions during sampling.
Uses BERT embeddings as conditioning input to the U-Net (injected via cross-attention-like mechanisms in ResNet blocks) combined with classifier-free guidance training strategy, allowing dynamic control of text influence without separate guidance models
Simpler than training separate text encoders or guidance models; leverages pre-trained BERT knowledge without fine-tuning, though less flexible than custom-trained text encoders for domain-specific applications
gif-based video dataset loading with augmentation
Medium confidenceProvides a PyTorch Dataset class that loads video data from GIF files in a specified directory, converts them to normalized tensors with shape (channels, frames, height, width), and applies optional augmentations including resizing, horizontal flipping, and pixel normalization. Handles variable-length GIFs by extracting all frames and supports batch loading through standard PyTorch DataLoader integration.
Implements a minimal but functional Dataset class specifically for GIF loading with automatic frame extraction and normalization to [-1, 1] range, integrated directly with PyTorch DataLoader for seamless training pipeline integration
Simpler than building custom data loaders from scratch, though less feature-rich than production frameworks like NVIDIA DALI or torchvision for handling multiple formats and advanced augmentations
trainer orchestration with loss computation and checkpoint management
Medium confidenceProvides a Trainer class that orchestrates the complete training loop: iterates over batches, computes diffusion loss (L2 distance between predicted and actual noise), performs backpropagation, updates model weights, and saves checkpoints at regular intervals. Handles device placement (CPU/GPU), gradient accumulation, and learning rate scheduling while logging training metrics for monitoring convergence.
Implements a focused trainer specifically for diffusion models that handles noise prediction loss computation and checkpoint saving, with direct integration to GaussianDiffusion and Unet3D classes rather than generic PyTorch Lightning abstraction
More lightweight than PyTorch Lightning for simple diffusion training, though less flexible for complex multi-task or distributed scenarios; provides domain-specific loss computation vs generic frameworks
unconditional video generation from pure noise
Medium confidenceGenerates videos by starting with random Gaussian noise and iteratively applying the trained denoising model across a predefined number of diffusion steps (typically 100-1000). Each step reduces noise by a small amount, progressively revealing coherent video structure. The process is deterministic given a seed but produces diverse outputs across different random initializations, enabling sampling of the learned video distribution without any text or conditioning input.
Implements iterative denoising sampling loop that applies the trained U-Net model sequentially across diffusion steps, with support for deterministic seeding and optional intermediate step visualization for analyzing generation process
Produces more diverse and stable outputs than autoregressive models, though slower than GAN-based generation; provides principled probabilistic sampling vs. deterministic decoder approaches
text-conditional video generation with guidance scaling
Medium confidenceGenerates videos conditioned on text descriptions by combining unconditional and text-conditioned denoising predictions during the reverse diffusion process. Uses classifier-free guidance with a cond_scale parameter (typically 1.0-15.0) that interpolates between predictions: higher scales increase text influence but risk artifacts. The text is first encoded through BERT to create semantic embeddings that guide the denoising trajectory toward content matching the description.
Implements classifier-free guidance by computing both conditioned (with BERT embeddings) and unconditional denoising predictions, then interpolating them with cond_scale parameter during each reverse diffusion step, enabling dynamic control without separate guidance models
More controllable than unconditional generation while simpler than training separate guidance models; provides intuitive guidance scaling interface vs. complex prompt engineering in other text-to-video systems
sinusoidal time step embedding for diffusion schedule conditioning
Medium confidenceEncodes the current diffusion step (noise level) as sinusoidal positional embeddings (similar to transformer positional encodings) and injects them into the U-Net at each block. These embeddings allow the model to learn different denoising behaviors at different noise levels — early steps focus on coarse structure, later steps refine details. The sinusoidal encoding ensures smooth interpolation between steps and provides a continuous representation of the noise schedule.
Uses sinusoidal positional encodings (borrowed from transformer architecture) to represent diffusion time steps, enabling the model to learn smooth denoising trajectories across the noise schedule without learnable embeddings
More stable than learned embeddings for diffusion scheduling; provides continuous representation vs. discrete one-hot encodings, enabling better generalization across noise levels
noise prediction loss computation for diffusion training
Medium confidenceComputes the training objective by sampling random diffusion steps, adding corresponding amounts of Gaussian noise to clean videos, and training the U-Net to predict the added noise. Uses L2 (mean squared error) loss between predicted and actual noise, weighted equally across all diffusion steps. This noise prediction formulation is mathematically equivalent to score matching and enables stable, efficient training of the diffusion model.
Implements noise prediction loss by sampling random diffusion steps and computing L2 distance between U-Net predictions and ground-truth added noise, enabling efficient training without unrolling the full diffusion process
More computationally efficient than unrolled diffusion training; provides stable gradients compared to some alternative objectives, though equal step weighting may not optimize perceptual quality
Capabilities are decomposed by AI analysis. Each maps to specific user intents and improves with match feedback.
Related Artifactssharing capabilities
Artifacts that share capabilities with video-diffusion-pytorch, ranked by overlap. Discovered automatically through the match graph.
make-a-video-pytorch
Implementation of Make-A-Video, new SOTA text to video generator from Meta AI, in Pytorch
Hotshot-XL
✨ Hotshot-XL: State-of-the-art AI text-to-GIF model trained to work alongside Stable Diffusion XL
VideoCrafter
VideoCrafter2: Overcoming Data Limitations for High-Quality Video Diffusion Models
How Diffusion Models Work - DeepLearning.AI
 
Denoising Diffusion Probabilistic Models (DDPM)
* 🏆 2020: [An Image is Worth 16x16 Words: Transformers for Image Recognition at Scale (ViT)](https://arxiv.org/abs/2010.11929)
11-877: Advanced Topics in MultiModal Machine Learning (Fall 2022) - Carnegie Mellon University

Best For
- ✓researchers implementing video diffusion models
- ✓ML engineers building custom video generation pipelines
- ✓teams with GPU memory constraints training on video datasets
- ✓researchers implementing diffusion-based video generation
- ✓engineers building custom video synthesis models
- ✓teams experimenting with different video resolutions and frame counts
- ✓researchers training models over days/weeks
- ✓ML engineers building production video generation systems
Known Limitations
- ⚠Factored attention may miss some cross-frame spatial-temporal interactions that full attention would capture
- ⚠Temporal attention still scales quadratically with sequence length (number of frames)
- ⚠Requires careful tuning of attention head dimensions for optimal spatial-temporal balance
- ⚠Memory usage scales cubically with video resolution and frame count due to 3D convolutions
- ⚠Requires careful tuning of channel dimensions and depth for different video sizes
- ⚠No built-in support for variable-length video sequences — requires padding or fixed frame counts
Requirements
Input / Output
UnfragileRank
UnfragileRank is computed from adoption signals, documentation quality, ecosystem connectivity, match graph feedback, and freshness. No artifact can pay for a higher rank.
Repository Details
Last commit: May 3, 2024
About
Implementation of Video Diffusion Models, Jonathan Ho's new paper extending DDPMs to Video Generation - in Pytorch
Categories
Alternatives to video-diffusion-pytorch
Are you the builder of video-diffusion-pytorch?
Claim this artifact to get a verified badge, access match analytics, see which intents users search for, and manage your listing.
Get the weekly brief
New tools, rising stars, and what's actually worth your time. No spam.
Data Sources
Looking for something else?
Search →