ICEditModel<T>
Models & Types · AiDotNet.Diffusion.ImageEditing
ICEdit model for in-context learning based image editing without per-task fine-tuning.
Inheritance: DiffusionModelBase<T> → LatentDiffusionModelBase<T> → ICEditModel<T>
For Beginners
ICEdit learns editing by example. You show it a “before” and “after” pair (e.g., a photo and its black-and-white version), and it applies the same transformation to new images. No special training needed for each edit type.
How It Works
ICEdit leverages in-context learning to understand editing instructions from examples. Given an instruction and optional before/after examples, it learns the edit pattern and applies it to new images without requiring task-specific training. Built on the FLUX architecture for high-quality generation.
Technical specifications:
- Base model: FLUX-based architecture (rectified flow transformer)
- Editing approach: In-context learning with example pairs
- No per-task fine-tuning required — learns from demonstrations
- Hidden size: 3072, 16 latent channels
- Text encoders: CLIP ViT-L/14 + T5-XXL (FLUX dual encoder)
Reference: Zhang et al., “ICEdit: In-Context Image Editing”, 2025
Example
var options = new DiffusionModelOptions<float> { LatentChannels = 16, DefaultInferenceSteps = 28 };
var input = 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 ICEditModel<float>(options: options))
.Build(trainX, trainY);
var edited = result.Predict(input);
Constructors
| Constructor | Summary |
|---|---|
ICEditModel(NeuralNetworkArchitecture<T> architecture, DiffusionModelOptions<T> options, INoiseScheduler<T> scheduler, SiTPredictor<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() |