FluxSchnellModel<T>
Models & Types · AiDotNet.Diffusion.FastGeneration
FLUX.1 Schnell for ultra-fast 1-4 step generation from the FLUX architecture.
Inheritance: DiffusionModelBase<T> → LatentDiffusionModelBase<T> → FluxSchnellModel<T>
For Beginners
FLUX.1 is one of the best open-source image generators. FLUX.1 Schnell (German for “fast”) is its speed-optimized version that generates images in just 1-4 steps. It’s free for commercial use and produces remarkably good images for a distilled model.
How It Works
FLUX.1 Schnell is the distilled variant of FLUX.1 optimized for 1-4 step generation. Uses the same double-stream transformer architecture as FLUX.1 Dev but distilled for speed. Requires no classifier-free guidance, producing high-quality images instantly.
Reference: Black Forest Labs, “FLUX.1 Schnell”, 2024
Example
var options = new DiffusionModelOptions<float> { LatentChannels = 16, DefaultInferenceSteps = 4 };
var noise = Tensor<float>.CreateRandom(new[] { 1, 16, 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 FluxSchnellModel<float>(options: options))
.Build(trainX, trainY);
var generated = result.Predict(noise);
Constructors
| Constructor | Summary |
|---|---|
FluxSchnellModel(NeuralNetworkArchitecture<T> architecture, DiffusionModelOptions<T> options, INoiseScheduler<T> scheduler, FluxDoubleStreamPredictor<T> predictor, StandardVAE<T> vae, IConditioningModule<T> conditioner, int? seed) |
Properties
| Property | Summary |
|---|---|
IConditioningModule<T> Conditioner { get; } |
|
INoisePredictor<T> NoisePredictor { get; } |
|
IVAEModel<T> VAE { get; } |
|
int LatentChannels { get; } |
Methods
| Method | Summary |
|---|---|
ModelMetadata<T> GetModelMetadata() |