ControlNetPlusPlusFluxModel<T>

Models & Types · AiDotNet.Diffusion.Control

ControlNet++ adapted for FLUX architecture with reward-guided training.

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

For Beginners

This is the most advanced version of ControlNet that works with FLUX models. It combines the improved training (ControlNet++) with FLUX’s powerful architecture for the best possible control over generated images.

How It Works

Combines ControlNet++ reward-guided training with FLUX’s flow-matching architecture. Uses 16-channel latent space with double-stream transformer blocks for improved control signal adherence on FLUX-based models.

Example

// Create ControlNet++ for FLUX with reward-guided conditioning
var options = new DiffusionModelOptions<float>
{
    LatentChannels = 16,
    DefaultInferenceSteps = 28
};
            
// Generate with enhanced depth-guided control on FLUX
var depthMap = Tensor<float>.CreateRandom(new[] { 1, 1, 1024, 1024 });
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 ControlNetPlusPlusFluxModel<float>(options: options, controlType: ControlType.Depth))
    .Build(trainX, trainY);
var prediction = result.Predict(depthMap);

Constructors

Constructor Summary
ControlNetPlusPlusFluxModel(NeuralNetworkArchitecture<T> architecture, DiffusionModelOptions<T> options, INoiseScheduler<T> scheduler, FluxDoubleStreamPredictor<T> predictor, StandardVAE<T> vae, IConditioningModule<T> conditioner, ControlType controlType, double rewardWeight, 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()