-
Notifications
You must be signed in to change notification settings - Fork 3.1k
/
ITextToImageService.cs
32 lines (29 loc) · 1.26 KB
/
ITextToImageService.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
// Copyright (c) Microsoft. All rights reserved.
using System.Diagnostics.CodeAnalysis;
using System.Threading;
using System.Threading.Tasks;
using Microsoft.SemanticKernel.Services;
namespace Microsoft.SemanticKernel.TextToImage;
/// <summary>
/// Interface for text to image services
/// </summary>
[Experimental("SKEXP0001")]
public interface ITextToImageService : IAIService
{
/// <summary>
/// Generate an image matching the given description
/// </summary>
/// <param name="description">Image generation prompt</param>
/// <param name="width">Image width in pixels</param>
/// <param name="height">Image height in pixels</param>
/// <param name="kernel">The <see cref="Kernel"/> containing services, plugins, and other state for use throughout the operation.</param>
/// <param name="cancellationToken">The <see cref="CancellationToken"/> to monitor for cancellation requests. The default is <see cref="CancellationToken.None"/>.</param>
/// <returns>Generated image in base64 format or image URL</returns>
[Experimental("SKEXP0001")]
public Task<string> GenerateImageAsync(
string description,
int width,
int height,
Kernel? kernel = null,
CancellationToken cancellationToken = default);
}