Flux2SchnellModel<T>

Models & Types · AiDotNet.Diffusion.FastGeneration

FLUX.2 Schnell for next-generation ultra-fast 1-4 step image generation.

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

For Beginners

Just as FLUX.1 Schnell was the fast version of FLUX.1, FLUX.2 Schnell is the fast version of FLUX.2. It benefits from all FLUX.2 improvements (better anatomy, text rendering, composition) while still generating images in just 1-4 steps.

How It Works

FLUX.2 Schnell is the speed-optimized variant of FLUX.2, featuring improved distillation from the enhanced FLUX.2 architecture. Produces higher quality images than FLUX.1 Schnell at the same 1-4 step count due to the improved teacher model and refined distillation process.

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 Flux2SchnellModel<float>(options: options))
    .Build(trainX, trainY);
var generated = result.Predict(noise);

Constructors

Constructor Summary
Flux2SchnellModel(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()