SiDDiTModel<T>

Models & Types · AiDotNet.Diffusion.FastGeneration

SiD-DiT: Score Identity Distillation applied to Diffusion Transformer (DiT) architectures.

Inheritance: DiffusionModelBase<T> → LatentDiffusionModelBase<T> → SiDDiTModel<T>

For Beginners

SiD-DiT is the transformer version of SiD. While SiD works with U-Net models (like Stable Diffusion), SiD-DiT works with Diffusion Transformers (DiT) — the architecture used by newer models. It enables single-step generation from these powerful transformer-based generators.

How It Works

Extends SiD to work with DiT-based architectures, enabling single-step generation from transformer-based diffusion models. Uses the same score identity principle but adapted for the DiT’s class-conditional generation with adaptive layer norm (adaLN) conditioning.

Reference: Extended from “Score Identity Distillation” (Zhou et al., 2024) to DiT architectures

Example

var options = new DiffusionModelOptions<float> { LatentChannels = 4, DefaultInferenceSteps = 1 };
var noise = Tensor<float>.CreateRandom(new[] { 1, 4, 32, 32 });
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 SiDDiTModel<float>(options: options))
    .Build(trainX, trainY);
var generated = result.Predict(noise);

Constructors

Constructor Summary
SiDDiTModel(NeuralNetworkArchitecture<T> architecture, DiffusionModelOptions<T> options, INoiseScheduler<T> scheduler, SiTPredictor<T> predictor, StandardVAE<T> vae, IConditioningModule<T> conditioner, int? seed) Initializes a new SiD-DiT model.

Properties

Property Summary
IConditioningModule<T> Conditioner { get; }
INoisePredictor<T> NoisePredictor { get; }
IVAEModel<T> VAE { get; }
int LatentChannels { get; }

Methods

Method Summary
ModelMetadata<T> GetModelMetadata()