Note

Access to this page requires authorization. You can try signing in or .

Access to this page requires authorization. You can try .

IImageGenerator Interface

Definition

Namespace:
Microsoft.Extensions.AI
Assembly:
Microsoft.Extensions.AI.Abstractions.dll
Package:
Microsoft.Extensions.AI.Abstractions v10.7.0
Source:
IImageGenerator.cs

Important

Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.

Represents a generator of images.

public interface class IImageGenerator : IDisposable
[System.Diagnostics.CodeAnalysis.Experimental("MEAI001", UrlFormat="https://aka.ms/dotnet-extensions-warnings/{0}")]
public interface IImageGenerator : IDisposable
public interface IImageGenerator : IDisposable
[<System.Diagnostics.CodeAnalysis.Experimental("MEAI001", UrlFormat="https://aka.ms/dotnet-extensions-warnings/{0}")>]
type IImageGenerator = interface
 interface IDisposable
type IImageGenerator = interface
 interface IDisposable
Public Interface IImageGenerator
Implements IDisposable
Derived
Attributes
Implements

Methods

Name Description
Dispose()

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

(Inherited from IDisposable)
GenerateAsync(ImageGenerationRequest, ImageGenerationOptions, CancellationToken)

Sends an image generation request and returns the generated image as a ImageGenerationResponse.

GetService(Type, Object)

Asks the IImageGenerator for an object of the specified type serviceType.

Extension Methods

Name Description
AsBuilder(IImageGenerator)

Creates a new ImageGeneratorBuilder using innerGenerator as its inner generator.

EditImageAsync(IImageGenerator, DataContent, String, ImageGenerationOptions, CancellationToken)

Edits a single image based on the original image and the specified prompt.

EditImageAsync(IImageGenerator, ReadOnlyMemory<Byte>, String, String, ImageGenerationOptions, CancellationToken)

Edits a single image based on a byte array and the specified prompt.

EditImagesAsync(IImageGenerator, IEnumerable<AIContent>, String, ImageGenerationOptions, CancellationToken)

Edits images based on original images and a text prompt.

GenerateImagesAsync(IImageGenerator, String, ImageGenerationOptions, CancellationToken)

Generates images based on a text prompt.

GetRequiredService(IImageGenerator, Type, Object)

Asks the IImageGenerator for an object of the specified type serviceType and throws an exception if one isn't available.

GetRequiredService<TService>(IImageGenerator, Object)

Asks the IImageGenerator for an object of type TService and throws an exception if one isn't available.

GetService<TService>(IImageGenerator, Object)

Asks the IImageGenerator for an object of type TService.

Applies to


Feedback

Was this page helpful?