2
2
using OnnxStack . Core . Config ;
3
3
using OnnxStack . Core . Model ;
4
4
using OnnxStack . StableDiffusion . Config ;
5
+ using OnnxStack . StableDiffusion . Models ;
5
6
using SixLabors . ImageSharp ;
6
7
using SixLabors . ImageSharp . PixelFormats ;
7
8
using System ;
@@ -83,5 +84,53 @@ public interface IStableDiffusionService
83
84
/// <param name="cancellationToken">The cancellation token.</param>
84
85
/// <returns>The diffusion result as <see cref="System.IO.Stream"/></returns>
85
86
Task < Stream > GenerateAsStreamAsync ( IModelOptions model , PromptOptions prompt , SchedulerOptions options , Action < int , int > progressCallback = null , CancellationToken cancellationToken = default ) ;
87
+
88
+ /// <summary>
89
+ /// Generates a batch of StableDiffusion image using the prompt and options provided.
90
+ /// </summary>
91
+ /// <param name="modelOptions">The model options.</param>
92
+ /// <param name="promptOptions">The prompt options.</param>
93
+ /// <param name="schedulerOptions">The scheduler options.</param>
94
+ /// <param name="batchOptions">The batch options.</param>
95
+ /// <param name="progressCallback">The progress callback.</param>
96
+ /// <param name="cancellationToken">The cancellation token.</param>
97
+ /// <returns></returns>
98
+ IAsyncEnumerable < BatchResult > GenerateBatchAsync ( IModelOptions modelOptions , PromptOptions promptOptions , SchedulerOptions schedulerOptions , BatchOptions batchOptions , Action < int , int , int , int > progressCallback = null , CancellationToken cancellationToken = default ) ;
99
+
100
+ /// <summary>
101
+ /// Generates a batch of StableDiffusion image using the prompt and options provided.
102
+ /// </summary>
103
+ /// <param name="modelOptions">The model options.</param>
104
+ /// <param name="promptOptions">The prompt options.</param>
105
+ /// <param name="schedulerOptions">The scheduler options.</param>
106
+ /// <param name="batchOptions">The batch options.</param>
107
+ /// <param name="progressCallback">The progress callback.</param>
108
+ /// <param name="cancellationToken">The cancellation token.</param>
109
+ /// <returns></returns>
110
+ IAsyncEnumerable < Image < Rgba32 > > GenerateBatchAsImageAsync ( IModelOptions modelOptions , PromptOptions promptOptions , SchedulerOptions schedulerOptions , BatchOptions batchOptions , Action < int , int , int , int > progressCallback = null , CancellationToken cancellationToken = default ) ;
111
+
112
+ /// <summary>
113
+ /// Generates a batch of StableDiffusion image using the prompt and options provided.
114
+ /// </summary>
115
+ /// <param name="modelOptions">The model options.</param>
116
+ /// <param name="promptOptions">The prompt options.</param>
117
+ /// <param name="schedulerOptions">The scheduler options.</param>
118
+ /// <param name="batchOptions">The batch options.</param>
119
+ /// <param name="progressCallback">The progress callback.</param>
120
+ /// <param name="cancellationToken">The cancellation token.</param>
121
+ /// <returns></returns>
122
+ IAsyncEnumerable < byte [ ] > GenerateBatchAsBytesAsync ( IModelOptions modelOptions , PromptOptions promptOptions , SchedulerOptions schedulerOptions , BatchOptions batchOptions , Action < int , int , int , int > progressCallback = null , CancellationToken cancellationToken = default ) ;
123
+
124
+ /// <summary>
125
+ /// Generates a batch of StableDiffusion image using the prompt and options provided.
126
+ /// </summary>
127
+ /// <param name="modelOptions">The model options.</param>
128
+ /// <param name="promptOptions">The prompt options.</param>
129
+ /// <param name="schedulerOptions">The scheduler options.</param>
130
+ /// <param name="batchOptions">The batch options.</param>
131
+ /// <param name="progressCallback">The progress callback.</param>
132
+ /// <param name="cancellationToken">The cancellation token.</param>
133
+ /// <returns></returns>
134
+ IAsyncEnumerable < Stream > GenerateBatchAsStreamAsync ( IModelOptions modelOptions , PromptOptions promptOptions , SchedulerOptions schedulerOptions , BatchOptions batchOptions , Action < int , int , int , int > progressCallback = null , CancellationToken cancellationToken = default ) ;
86
135
}
87
136
}
0 commit comments