SeedEdit3Model<T>
Models & Types · AiDotNet.Diffusion.ImageEditing
SeedEdit 3 model for high-fidelity instruction-based editing with structure preservation.
Inheritance: DiffusionModelBase<T> → LatentDiffusionModelBase<T> → SeedEdit3Model<T>
For Beginners
SeedEdit 3 is great at making changes while keeping the image layout the same. If you ask it to “change the dog to a cat,” the cat will be the same size and position as the dog was. This is important for consistent editing.
How It Works
SeedEdit 3 focuses on preserving the spatial structure and layout of the original image while applying requested edits. Uses a structure-aware loss during training to maintain object positions, sizes, and relationships even during significant content changes. Built on a DiT backbone with rectified flow training.
Technical specifications:
- Architecture: DiT-based with structure-aware conditioning
- Latent space: 16 channels with rectified flow
- Structure preservation: Layout-aware loss + spatial conditioning
- Guidance: 5.0 (balances edit strength vs structure fidelity)
Reference: ByteDance, “SEED-Edit”, 2024
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 SeedEdit3Model<float>(options: options))
.Build(trainX, trainY);
var edited = result.Predict(input);
Constructors
| Constructor | Summary |
|---|---|
SeedEdit3Model(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() |