ControlNetTileModel<T>

Models & Types · AiDotNet.Diffusion.Control

ControlNet Tile model for upscaling and detail enhancement.

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

For Beginners

Give this model a blurry or low-resolution image, and it will generate a sharp, detailed version while keeping the same colors and layout. It’s great for making images look clearer and more detailed.

How It Works

ControlNet Tile preserves overall color and composition from a blurred/downsampled input while regenerating fine details. Commonly used for image upscaling, detail enhancement, and texture regeneration.

Example

// Create a ControlNet Tile model for upscaling and detail enhancement
var options = new DiffusionModelOptions<float>
{
    LatentChannels = 4,
    DefaultInferenceSteps = 20
};
            
// Enhance a low-resolution image with regenerated details
var blurryImage = Tensor<float>.CreateRandom(new[] { 1, 3, 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 ControlNetTileModel<float>(options: options))
    .Build(trainX, trainY);
var sharpResult = result.Predict(blurryImage);

Constructors

Constructor Summary
ControlNetTileModel(NeuralNetworkArchitecture<T> architecture, DiffusionModelOptions<T> options, INoiseScheduler<T> scheduler, UNetNoisePredictor<T> baseUNet, 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()