FlowVidModel<T>

Models & Types · AiDotNet.Diffusion.Video.VideoEditing

FlowVid optical flow guided video-to-video synthesis.

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

For Beginners

FlowVid uses optical flow (tracking pixel movement between frames) to guide video-to-video synthesis. This ensures that edits follow the natural motion in the original video for temporal consistency.

How It Works

References:

  • Paper: “FlowVid: Taming Imperfect Optical Flows for Consistent Video-to-Video Synthesis” (2024)

FlowVid uses optical flow to guide video-to-video synthesis, maintaining temporal consistency by warping features along motion trajectories. The method handles imperfect optical flows through a flow-guided attention mechanism that adaptively weighs contributions from neighboring frames.

Technical specifications:

  • Architecture: Optical Flow Guidance + Flow-Guided Attention
  • Latent channels: 4
  • Default: 24 frames at 8 FPS
  • Supports I2V: No | T2V: Yes | V2V: Yes

Example

var options = new DiffusionModelOptions<float> { LatentChannels = 4, DefaultInferenceSteps = 30 };
var input = Tensor<float>.CreateRandom(new[] { 1, 4, 24, 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 FlowVidModel<float>(options: options))
    .Build(trainX, trainY);
var edited = result.Predict(input);

Constructors

Constructor Summary
FlowVidModel(NeuralNetworkArchitecture<T> architecture, DiffusionModelOptions<T> options, INoiseScheduler<T> scheduler, VideoUNetPredictor<T> predictor, TemporalVAE<T> temporalVAE, IConditioningModule<T> conditioner, int defaultNumFrames, int defaultFPS, int? seed) Initializes a new instance of FlowVidModel 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()