IDMVTONModel<T>
Models & Types · AiDotNet.Diffusion.VirtualTryOn
IDM-VTON model for image-based virtual try-on with high-fidelity garment transfer.
Inheritance: DiffusionModelBase<T> → LatentDiffusionModelBase<T> → IDMVTONModel<T>
For Beginners
IDM-VTON lets you see how clothes would look on a person. Give it a photo of a person and a photo of a garment, and it generates a realistic image of the person wearing that garment, preserving both the person’s pose and the garment’s details.
How It Works
IDM-VTON uses a dual U-Net architecture — one encodes the garment image and the other generates the person wearing the garment. It features IP-Adapter-based garment encoding and GarmentNet for preserving fine texture details during warping and blending.
Reference: Choi et al., “Improving Diffusion Models for Authentic Virtual Try-on in the Wild”, 2024
Example
var options = new DiffusionModelOptions<float> { LatentChannels = 4, DefaultInferenceSteps = 30 };
var input = Tensor<float>.CreateRandom(new[] { 1, 4, 128, 96 });
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 IDMVTONModel<float>(options: options))
.Build(trainX, trainY);
var tryOn = result.Predict(input);
Constructors
| Constructor | Summary |
|---|---|
IDMVTONModel(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() |