DallE3Model<T>
Models & Types · AiDotNet.Diffusion.TextToImage
DALL-E 3 style text-to-image generation model with advanced prompt understanding and high-fidelity image generation capabilities.
Inheritance: DiffusionModelBase<T> → LatentDiffusionModelBase<T> → DallE3Model<T>
Implements: IDallE3Model<T>
For Beginners
DALL-E 3 generates high-quality images from text descriptions. Unlike earlier versions, it deeply understands complex prompts with spatial relationships, text rendering, and artistic styles. It uses a diffusion process (gradually refining random noise into an image) combined with advanced prompt understanding to produce images that closely match what you describe in words.
How It Works
This implementation provides DALL-E 3 style capabilities including prompt expansion, text rendering, style control, and high-quality image generation at multiple sizes.
Example
var options = new DiffusionModelOptions<float> { LatentChannels = 4, DefaultInferenceSteps = 30 };
var noise = Tensor<float>.CreateRandom(new[] { 1, 4, 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 DallE3Model<float>(options: options))
.Build(trainX, trainY);
var generated = result.Predict(noise);
Constructors
| Constructor | Summary |
|---|---|
DallE3Model(NeuralNetworkArchitecture<T> architecture, DiffusionModelOptions<T> options, INoiseScheduler<T> scheduler, UNetNoisePredictor<T> unet, StandardVAE<T> vae, IConditioningModule<T> conditioner, int? seed) |
Initializes a new instance of the DallE3Model class. |
Properties
| Property | Summary |
|---|---|
IConditioningModule<T> Conditioner { get; } |
|
INoisePredictor<T> NoisePredictor { get; } |
|
IReadOnlyList<DallE3ImageSize> SupportedSizes { get; } |
|
IVAEModel<T> VAE { get; } |
|
bool SupportsEditing { get; } |
|
bool SupportsVariations { get; } |
|
int LatentChannels { get; } |
|
int MaxPromptLength { get; } |
Methods
| Method | Summary |
|---|---|
IEnumerable<Tensor<T>> CreateVariations(Tensor<T> image, int count, double variationStrength, DallE3ImageSize size) |
|
IEnumerable<Tensor<T>> GenerateConsistentSet(string basePrompt, IEnumerable<string> variations, int consistencySeed, DallE3ImageSize size) |
|
IEnumerable<Tensor<T>> GenerateMultiple(string prompt, int count, DallE3ImageSize size, DallE3Quality quality, DallE3Style style) |
|
ModelMetadata<T> GetModelMetadata() |
|
Tensor<T> Edit(Tensor<T> image, Tensor<T> mask, string prompt, DallE3ImageSize size) |
|
Tensor<T> Generate(string prompt, DallE3ImageSize size, DallE3Quality quality, DallE3Style style, int? seed) |
|
Tensor<T> GenerateForUseCase(string prompt, string useCase, DallE3ImageSize size) |
|
Tensor<T> GenerateTileable(string prompt, DallE3ImageSize size) |
|
Tensor<T> GenerateWithComposition(string prompt, IEnumerable<ValueTuple<string, string, double>> compositionGuide, DallE3ImageSize size) |
|
Tensor<T> GenerateWithStyle(string prompt, string artisticStyle, DallE3ImageSize size, DallE3Quality quality) |
|
Tensor<T> GenerateWithText(string prompt, string textToRender, string textPlacement, DallE3ImageSize size) |
|
Tensor<T> Outpaint(Tensor<T> image, string direction, int extensionPixels, string prompt) |
|
Tensor<T> Upscale(Tensor<T> image, int scaleFactor, bool enhanceDetails) |
|
ValueTuple<T, IEnumerable<string>> EstimateQuality(string prompt) |
|
ValueTuple<Tensor<T>, string> GenerateWithPrompt(string prompt, DallE3ImageSize size, DallE3Quality quality, DallE3Style style) |
|
ValueTuple<bool, IEnumerable<string>> CheckPromptSafety(string prompt) |
|
string ExpandPrompt(string simplePrompt, DallE3Style style) |