Wan21Model<T>
Models & Types · AiDotNet.Diffusion.Video
Wan 2.1 video model with MoE denoising and full 3D attention.
Inheritance: DiffusionModelBase<T> → LatentDiffusionModelBase<T> → VideoDiffusionModelBase<T> → Wan21Model<T>
For Beginners
Wan 2.1 is an open-source AI that creates videos from text descriptions or still images. Think of it as a very advanced animation tool: you describe a scene in words, and it generates a realistic video clip. It uses a technique called “Mixture of Experts” where different parts of the model specialize in different aspects of video creation (lighting, motion, detail), then combine their outputs. With 14 billion parameters, it produces some of the highest quality open-source video generation results available.
How It Works
References:
- Paper: “Wan: Open and Advanced Large-Scale Video Generative Models” (Alibaba, 2025)
Wan 2.1 introduces Mixture-of-Experts (MoE) into the DiT denoising backbone, enabling specialized experts for different denoising phases. Combined with the Causal 3D VAE and flow matching training, it achieves state-of-the-art video quality among open-source models. The model supports both text-to-video and image-to-video generation with 14B parameters.
Technical specifications:
- Architecture: DiT + MoE + Causal3DVAE + FlowMatching
- 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 Wan21Model<float>(options: options))
.Build(trainX, trainY);
var video = result.Predict(noise);
Constructors
| Constructor | Summary |
|---|---|
Wan21Model(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 Wan21Model 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() |