ImageGeneratorExtensions.EditImageAsync Method
Definition
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.
Overloads
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. |
EditImageAsync(IImageGenerator, DataContent, String, ImageGenerationOptions, CancellationToken)
- Source:
- ImageGeneratorExtensions.cs
Edits a single image based on the original image and the specified prompt.
public static System.Threading.Tasks.Task<Microsoft.Extensions.AI.ImageGenerationResponse> EditImageAsync(this Microsoft.Extensions.AI.IImageGenerator generator, Microsoft.Extensions.AI.DataContent originalImage, string prompt, Microsoft.Extensions.AI.ImageGenerationOptions? options = default, System.Threading.CancellationToken cancellationToken = default);
static member EditImageAsync : Microsoft.Extensions.AI.IImageGenerator * Microsoft.Extensions.AI.DataContent * string * Microsoft.Extensions.AI.ImageGenerationOptions * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Microsoft.Extensions.AI.ImageGenerationResponse>
<Extension()>
Public Function EditImageAsync (generator As IImageGenerator, originalImage As DataContent, prompt As String, Optional options As ImageGenerationOptions = Nothing, Optional cancellationToken As CancellationToken = Nothing) As Task(Of ImageGenerationResponse)
Parameters
- generator
- IImageGenerator
The image generator.
- originalImage
- DataContent
The single image to base edits on.
- prompt
- String
The prompt to guide the image generation.
- options
- ImageGenerationOptions
The image generation options to configure the request.
- cancellationToken
- CancellationToken
The CancellationToken to monitor for cancellation requests. The default is None.
Returns
The images generated by the generator.
Exceptions
generator
, originalImage
, or prompt
is null
.
Applies to
EditImageAsync(IImageGenerator, ReadOnlyMemory<Byte>, String, String, ImageGenerationOptions, CancellationToken)
- Source:
- ImageGeneratorExtensions.cs
Edits a single image based on a byte array and the specified prompt.
public static System.Threading.Tasks.Task<Microsoft.Extensions.AI.ImageGenerationResponse> EditImageAsync(this Microsoft.Extensions.AI.IImageGenerator generator, ReadOnlyMemory<byte> originalImageData, string fileName, string prompt, Microsoft.Extensions.AI.ImageGenerationOptions? options = default, System.Threading.CancellationToken cancellationToken = default);
static member EditImageAsync : Microsoft.Extensions.AI.IImageGenerator * ReadOnlyMemory<byte> * string * string * Microsoft.Extensions.AI.ImageGenerationOptions * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Microsoft.Extensions.AI.ImageGenerationResponse>
<Extension()>
Public Function EditImageAsync (generator As IImageGenerator, originalImageData As ReadOnlyMemory(Of Byte), fileName As String, prompt As String, Optional options As ImageGenerationOptions = Nothing, Optional cancellationToken As CancellationToken = Nothing) As Task(Of ImageGenerationResponse)
Parameters
- generator
- IImageGenerator
The image generator.
- originalImageData
- ReadOnlyMemory<Byte>
The byte array containing the image data to base edits on.
- fileName
- String
The filename for the image data.
- prompt
- String
The prompt to guide the image generation.
- options
- ImageGenerationOptions
The image generation options to configure the request.
- cancellationToken
- CancellationToken
The CancellationToken to monitor for cancellation requests. The default is None.
Returns
The images generated by the generator.
Exceptions
generator
, fileName
, or prompt
is null
.