FlashVSROptions

Options & Configuration · AiDotNet.Video.Options

Configuration options for FlashVSR, real-time diffusion-based streaming video super-resolution.

Inheritance: ModelOptions → NeuralNetworkOptions → FlashVSROptions

For Beginners

FlashVSR sharpens video as it streams in. It turns a video generation model into a one-step upscaler that only looks a few frames back and only at the parts of each frame that matter, which makes it fast enough for real time.

How It Works

Defaults follow Zhuang et al. 2025 (arXiv 2510.12747) and the release (OpenImagingLab/FlashVSR): Wan 2.1-T2V-1.3B as the backbone (1,536 wide, 30 blocks of 12 heads, an 8,960-wide feed-forward, a 256-wide frequency embedding, 512 T5 tokens of 4,096) fine-tuned with LoRA of rank 384; the released LR projection (hidden widths 2,048 and 3,072, one DiT layer); the block-sparse attention at sparse ratio 2, a three-chunk KV cache and an 11-block locality window; the tiny conditional decoder (512, 256, 128, 128); and Wan 2.1’s VAE (96 wide, multipliers 1, 2, 4, 4, two residual blocks) for the training latents. Training is AdamW at 1e-5 with weight decay 0.01, LPIPS weighted 2.

Constructors

Constructor Summary
FlashVSROptions() Initializes a new instance with default values.
FlashVSROptions(FlashVSROptions other) Initializes a new instance by copying from another instance.

Properties

Property Summary
OnnxModelOptions OnnxOptions { get; set; } Gets or sets the ONNX runtime options.
bool ColorFix { get; set; } Gets or sets whether the output’s per-frame color statistics are matched to the LR upscale (AdaIN, as the release does).
double LearningRate { get; set; } Gets or sets the AdamW learning rate (1e-5).
double LpipsWeight { get; set; } Gets or sets the LPIPS weight λ in the distillation and decoder losses (2).
double NormEpsilon { get; set; } Gets or sets the norms’ epsilon (1e-6).
double SigmaShift { get; set; } Gets or sets the flow-matching schedule’s shift (Wan’s 5).
double SparseRatio { get; set; } Gets or sets the sparse ratio (the release recommends 1.5 or 2; 2 is more stable).
double WeightDecay { get; set; } Gets or sets the AdamW weight decay (0.01).
int DecoderIterations { get; set; } Gets or sets the tiny decoder’s iterations.
int FfnDim { get; set; } Gets or sets the feed-forward width (8,960).
int FrequencyDim { get; set; } Gets or sets the sinusoidal timestep embedding width (256).
int KvCacheChunks { get; set; } Gets or sets how many earlier two-frame chunks the KV cache keeps (kv_ratio, 3).
int LocalRange { get; set; } Gets or sets the locality window in 8x8-token blocks (the release recommends 9 or 11; 11 is more stable).
int LoraRank { get; set; } Gets or sets the LoRA rank on the DiT’s attention and feed-forward maps (384, Sec.
int LqHiddenDim1 { get; set; } Gets or sets the LR projection’s first hidden width (2,048).
int LqHiddenDim2 { get; set; } Gets or sets the LR projection’s second hidden width (3,072).
int LqProjectionLayers { get; set; } Gets or sets how many DiT blocks receive the LR tokens (the release’s layer_num, 1).
int ModelDim { get; set; } Gets or sets the DiT width (Wan 2.1-1.3B: 1,536).
int NumFrames { get; set; } Gets or sets the training clip length (89 frames, Sec.
int NumHeads { get; set; } Gets or sets the attention heads (12).
int NumLayers { get; set; } Gets or sets the DiT blocks (30).
int NumTrainTimesteps { get; set; } Gets or sets the flow-matching training timesteps (1,000).
int ScaleFactor { get; set; } Gets or sets the upscaling factor (4).
int SparseIterations { get; set; } Gets or sets the block-sparse causal adaptation’s iterations (Stage 2); distillation follows.
int TeacherIterations { get; set; } Gets or sets the full-attention teacher’s flow-matching iterations (Stage 1).
int TextDim { get; set; } Gets or sets the T5 embedding width of the fixed prompt (4,096).
int TextLength { get; set; } Gets or sets the fixed prompt’s token count (512, Wan’s text length).
int VaeDim { get; set; } Gets or sets Wan 2.1 VAE’s base width (96).
int VaeResidualBlocks { get; set; } Gets or sets the VAE’s residual blocks a stage (2).
int[] DecoderChannels { get; set; } Gets or sets the tiny conditional decoder’s stage widths (512, 256, 128, 128).
int[] VaeDimMultipliers { get; set; } Gets or sets the VAE’s width multipliers (1, 2, 4, 4); four stages give its x8 and x4 compression.
string ModelPath { get; set; } Gets or sets the ONNX model path.