SeeSRModel<T>

Models & Types · AiDotNet.Diffusion.SuperResolution

SeeSR: Semantics-aware super-resolution using diffusion-based image upscaling.

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

For Beginners

Standard super-resolution can add wrong details (like putting grass texture on a building). SeeSR first understands what’s in each part of the image (semantics), then generates appropriate details for each region. A face gets skin texture, a building gets brick patterns, etc.

How It Works

SeeSR extracts semantic tags from the low-resolution input and uses them to condition the diffusion process, ensuring that generated high-frequency details are semantically consistent. For example, it won’t add brick texture to a face region.

Technical specifications:

  • Architecture: SD2.1 U-Net with semantic tag extraction module
  • Text encoder: OpenCLIP ViT-H/14 (1024-dim) for tag conditioning
  • Input: 8 channels (4 latent + 4 LR image latent)
  • Semantic tags: DAPE (Degradation-Aware Prompt Extractor)
  • Training: SD2.1 backbone + semantic consistency loss
  • Scale factor: 4x upscaling

Reference: Wu et al., “SeeSR: Towards Semantics-Aware Real-World Image Super-Resolution”, CVPR 2024

Example

var options = new DiffusionModelOptions<float> { LatentChannels = 4, DefaultInferenceSteps = 20 };
var lowRes = Tensor<float>.CreateRandom(new[] { 1, 4, 32, 32 });
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 SeeSRModel<float>(options: options))
    .Build(trainX, trainY);
var highRes = result.Predict(lowRes);

Constructors

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