Share via


DelegatingImageGenerator Class

Definition

Provides an optional base class for an IImageGenerator that passes through calls to another instance.

public ref class DelegatingImageGenerator : IDisposable, Microsoft::Extensions::AI::IImageGenerator
[System.Diagnostics.CodeAnalysis.Experimental("MEAI001")]
public class DelegatingImageGenerator : IDisposable, Microsoft.Extensions.AI.IImageGenerator
public class DelegatingImageGenerator : IDisposable, Microsoft.Extensions.AI.IImageGenerator
[<System.Diagnostics.CodeAnalysis.Experimental("MEAI001")>]
type DelegatingImageGenerator = class
    interface IImageGenerator
    interface IDisposable
type DelegatingImageGenerator = class
    interface IImageGenerator
    interface IDisposable
Public Class DelegatingImageGenerator
Implements IDisposable, IImageGenerator
Inheritance
DelegatingImageGenerator
Derived
Attributes
Implements

Remarks

This is recommended as a base type when building generators that can be chained in any order around an underlying IImageGenerator. The default implementation simply passes each call to the inner generator instance.

Constructors

DelegatingImageGenerator(IImageGenerator)

Initializes a new instance of the DelegatingImageGenerator class.

Properties

InnerGenerator

Gets the inner IImageGenerator.

Methods

Dispose()

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

Dispose(Boolean)

Provides a mechanism for releasing unmanaged resources.

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

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