Język

ImageGeneratorExtensions.GenerateImagesAsync Metoda

Definicja

Generuje obrazy na podstawie monitu tekstowego.

public static System.Threading.Tasks.Task<Microsoft.Extensions.AI.ImageGenerationResponse> GenerateImagesAsync(this Microsoft.Extensions.AI.IImageGenerator generator, string prompt, Microsoft.Extensions.AI.ImageGenerationOptions? options = default, System.Threading.CancellationToken cancellationToken = default);
static member GenerateImagesAsync : Microsoft.Extensions.AI.IImageGenerator * string * Microsoft.Extensions.AI.ImageGenerationOptions * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Microsoft.Extensions.AI.ImageGenerationResponse>
<Extension()>
Public Function GenerateImagesAsync (generator As IImageGenerator, prompt As String, Optional options As ImageGenerationOptions = Nothing, Optional cancellationToken As CancellationToken = Nothing) As Task(Of ImageGenerationResponse)

Parametry

generator
IImageGenerator

Generator obrazów.

prompt
String

Monit o przeprowadzenie generowania obrazu.

options
ImageGenerationOptions

Opcje generowania obrazu do skonfigurowania żądania.

cancellationToken
CancellationToken

Element CancellationToken do monitorowania żądań anulowania. Wartość domyślna to None.

Zwraca

Obrazy generowane przez generator.

Wyjątki

generator lub prompt ma wartość null.

Dotyczy