HyperSDModel<T>
Models & Types · AiDotNet.Diffusion.FastGeneration
Hyper-SD model for unified 1-8 step generation via trajectory-segmented distillation.
Inheritance: DiffusionModelBase<T> → LatentDiffusionModelBase<T> → HyperSDModel<T>
For Beginners
Most fast-generation models are optimized for a specific step count (1-step or 4-step). Hyper-SD works well across ALL step counts from 1 to 8, letting you smoothly trade speed for quality. It’s like having multiple specialized models in one — just change the step count.
How It Works
Hyper-SD uses a novel trajectory-segmented consistency distillation that divides the denoising trajectory into segments and distills each segment independently. Combined with human feedback learning, it achieves state-of-the-art quality across 1-8 step configurations for both SD 1.5 and SDXL architectures.
Reference: Ren et al., “Hyper-SD: Trajectory Segmented Consistency Model”, 2024
Example
var options = new DiffusionModelOptions<float> { LatentChannels = 4, DefaultInferenceSteps = 4 };
var noise = Tensor<float>.CreateRandom(new[] { 1, 4, 64, 64 });
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 HyperSDModel<float>(options: options))
.Build(trainX, trainY);
var generated = result.Predict(noise);
Constructors
| Constructor | Summary |
|---|---|
HyperSDModel(NeuralNetworkArchitecture<T> architecture, DiffusionModelOptions<T> options, INoiseScheduler<T> scheduler, UNetNoisePredictor<T> predictor, StandardVAE<T> vae, IConditioningModule<T> conditioner, bool isXLVariant, int? seed) |
Initializes a new Hyper-SD model. |
Properties
| Property | Summary |
|---|---|
IConditioningModule<T> Conditioner { get; } |
|
INoisePredictor<T> NoisePredictor { get; } |
|
IVAEModel<T> VAE { get; } |
|
bool IsXLVariant { get; } |
Gets whether this is the SDXL variant. |
int LatentChannels { get; } |
Methods
| Method | Summary |
|---|---|
ModelMetadata<T> GetModelMetadata() |