PixArtDeltaModel<T>
Models & Types · AiDotNet.Diffusion.TextToImage
PixArt-Delta model — LCM-distilled PixArt for fast 2-8 step generation.
Inheritance: DiffusionModelBase<T> → LatentDiffusionModelBase<T> → PixArtDeltaModel<T>
For Beginners
PixArt-Delta is PixArt-Alpha made faster:
Key characteristics:
- Same DiT architecture as PixArt-Alpha
- LCM distillation: trained to produce good results in 2-8 steps
- No classifier-free guidance needed (saves 50% compute)
- Maintains T5-XXL text encoder for good prompt understanding
How it compares:
- PixArt-Alpha: ~20 steps, needs CFG → slower
- PixArt-Delta: ~4 steps, no CFG needed → 10x faster
- SD Turbo: 1-4 steps but lower quality
- PixArt-Delta: 2-8 steps with higher quality
Use PixArt-Delta when you need:
- Fast generation (2-8 steps)
- Good quality without guidance overhead
- Resource-efficient deployment
How It Works
PixArt-Delta applies Latent Consistency Model (LCM) distillation to PixArt-Alpha, enabling high-quality image generation in just 2-8 denoising steps while preserving the efficient DiT architecture.
Technical specifications:
- Architecture: DiT-XL/2 (same as PixArt-Alpha)
- Distillation: Latent Consistency Model (LCM)
- Steps: 2-8 (optimal: 4)
- Guidance scale: 1.0 (no CFG)
- Text encoder: T5-XXL (4096-dim)
- Resolution: 512x512 to 1024x1024
Reference: Chen et al., “PixArt-delta: Fast and Controllable Image Generation with Latent Consistency Models”, 2024
Example
var options = new DiffusionModelOptions<float> { LatentChannels = 4, DefaultInferenceSteps = 20 };
var noise = Tensor<float>.CreateRandom(new[] { 1, 4, 128, 128 });
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 PixArtDeltaModel<float>(options: options))
.Build(trainX, trainY);
var generated = result.Predict(noise);
Constructors
| Constructor | Summary |
|---|---|
PixArtDeltaModel(NeuralNetworkArchitecture<T> architecture, DiffusionModelOptions<T> options, INoiseScheduler<T> scheduler, DiTNoisePredictor<T> dit, StandardVAE<T> vae, IConditioningModule<T> conditioner, int? seed) |
Initializes a new instance of PixArtDeltaModel with full customization support. |
Properties
| Property | Summary |
|---|---|
IConditioningModule<T> Conditioner { get; } |
|
INoisePredictor<T> NoisePredictor { get; } |
|
IVAEModel<T> VAE { get; } |
|
int LatentChannels { get; } |
Methods
| Method | Summary |
|---|---|
ModelMetadata<T> GetModelMetadata() |
|
Tensor<T> GenerateFromText(string prompt, string negativePrompt, int width, int height, int numInferenceSteps, double? guidanceScale, int? seed) |
Fields
| Field | Summary |
|---|---|
int DefaultHeight |
|
int DefaultWidth |