SnapVideoModel<T>

Models & Types · AiDotNet.Diffusion.Video.LongVideo

Snap Video scaled spatiotemporal transformer for text-to-video.

Inheritance: DiffusionModelBase<T> → LatentDiffusionModelBase<T> → VideoDiffusionModelBase<T> → SnapVideoModel<T>

For Beginners

SnapVideo from Snap uses a scaled spatiotemporal transformer that processes space and time jointly for high-quality video generation. Its efficient architecture scales well to longer durations.

How It Works

References:

  • Paper: “Snap Video: Scaled Spatiotemporal Transformers for Text-to-Video Synthesis” (Snap, 2024)

Snap Video uses a scaled spatiotemporal transformer architecture for efficient text-to-video synthesis. The model scales transformer attention across both spatial and temporal dimensions with efficient factorization strategies. Achieves strong quality with efficient generation.

Technical specifications:

  • Architecture: Scaled Spatiotemporal Transformer
  • Latent channels: 16
  • Default: 48 frames at 24 FPS
  • Supports I2V: Yes | T2V: Yes | V2V: No

Example

var options = new DiffusionModelOptions<float> { LatentChannels = 16, DefaultInferenceSteps = 50 };
var noise = Tensor<float>.CreateRandom(new[] { 1, 16, 48, 64, 64 });
var trainX = Tensor<float>.CreateRandom(4, 8);
var trainY = Tensor<float>.CreateRandom(4, 2);
var result = new AiModelBuilder<float, Tensor<float>, Tensor<float>>()
    .ConfigureModel(new SnapVideoModel<float>(options: options))
    .Build(trainX, trainY);
var video = result.Predict(noise);

Constructors

Constructor Summary
SnapVideoModel(NeuralNetworkArchitecture<T> architecture, DiffusionModelOptions<T> options, INoiseScheduler<T> scheduler, DiTNoisePredictor<T> predictor, TemporalVAE<T> temporalVAE, IConditioningModule<T> conditioner, int defaultNumFrames, int defaultFPS, int? seed) Initializes a new instance of SnapVideoModel with full customization support.

Properties

Property Summary
IConditioningModule<T> Conditioner { get; }
INoisePredictor<T> NoisePredictor { get; }
IVAEModel<T> TemporalVAE { get; }
IVAEModel<T> VAE { get; }
bool SupportsImageToVideo { get; }
bool SupportsTextToVideo { get; }
bool SupportsVideoToVideo { get; }
int LatentChannels { get; }

Methods

Method Summary
ModelMetadata<T> GetModelMetadata()