Wan22Model<T>

Models & Types · AiDotNet.Diffusion.Video

Wan 2.2 video model with timestep-specialized MoE experts.

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

For Beginners

Wan 2.2 improves on Wan 2.1 by assigning different expert sub-networks to different stages of the video creation process. Early stages focus on overall structure while later stages refine fine details. This timestep specialization produces sharper, more temporally consistent videos.

How It Works

References:

  • Paper: “Wan 2.2: Timestep-Specialized Mixture-of-Experts for Video Generation” (Alibaba, 2025)

Wan 2.2 upgrades the MoE architecture with timestep-specialized experts, where different expert subnetworks activate at different denoising stages. Early timesteps use structure experts while later timesteps use detail experts. This specialization significantly improves both fidelity and temporal coherence.

Technical specifications:

  • Architecture: DiT + Timestep-Specialized MoE + Causal3DVAE
  • Latent channels: 16
  • Default: 81 frames at 16 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, 81, 60, 104 });
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 Wan22Model<float>(options: options))
    .Build(trainX, trainY);
var video = result.Predict(noise);

Constructors

Constructor Summary
Wan22Model(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 Wan22Model 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()