@@ -291,7 +291,7 @@ public override async Task<OnnxImage> GenerateImageAsync(PromptOptions promptOpt
291
291
/// <param name="progressCallback">The progress callback.</param>
292
292
/// <param name="cancellationToken">The cancellation token.</param>
293
293
/// <returns></returns>
294
- public override async IAsyncEnumerable < OnnxImage > GenerateImageBatchAsync ( BatchOptions batchOptions , PromptOptions promptOptions , SchedulerOptions schedulerOptions = default , ControlNetModel controlNet = default , Action < DiffusionProgress > progressCallback = null , [ EnumeratorCancellation ] CancellationToken cancellationToken = default )
294
+ public override async IAsyncEnumerable < BatchImageResult > GenerateImageBatchAsync ( BatchOptions batchOptions , PromptOptions promptOptions , SchedulerOptions schedulerOptions = default , ControlNetModel controlNet = default , Action < DiffusionProgress > progressCallback = null , [ EnumeratorCancellation ] CancellationToken cancellationToken = default )
295
295
{
296
296
var diffuseBatchTime = _logger ? . LogBegin ( "Batch Diffuser starting..." ) ;
297
297
var options = GetSchedulerOptionsOrDefault ( schedulerOptions ) ;
@@ -316,7 +316,7 @@ public override async IAsyncEnumerable<OnnxImage> GenerateImageBatchAsync(BatchO
316
316
foreach ( var batchSchedulerOption in batchSchedulerOptions )
317
317
{
318
318
var tensorResult = await DiffuseImageAsync ( diffuser , promptOptions , batchSchedulerOption , promptEmbeddings , performGuidance , progressCallback , cancellationToken ) ;
319
- yield return new OnnxImage ( tensorResult ) ;
319
+ yield return new BatchImageResult ( batchSchedulerOption , new OnnxImage ( tensorResult ) ) ;
320
320
batchIndex ++ ;
321
321
}
322
322
@@ -367,7 +367,7 @@ public override async Task<OnnxVideo> GenerateVideoAsync(PromptOptions promptOpt
367
367
/// <param name="progressCallback">The progress callback.</param>
368
368
/// <param name="cancellationToken">The cancellation token.</param>
369
369
/// <returns></returns>
370
- public override async IAsyncEnumerable < OnnxVideo > GenerateVideoBatchAsync ( BatchOptions batchOptions , PromptOptions promptOptions , SchedulerOptions schedulerOptions = default , ControlNetModel controlNet = default , Action < DiffusionProgress > progressCallback = null , [ EnumeratorCancellation ] CancellationToken cancellationToken = default )
370
+ public override async IAsyncEnumerable < BatchVideoResult > GenerateVideoBatchAsync ( BatchOptions batchOptions , PromptOptions promptOptions , SchedulerOptions schedulerOptions = default , ControlNetModel controlNet = default , Action < DiffusionProgress > progressCallback = null , [ EnumeratorCancellation ] CancellationToken cancellationToken = default )
371
371
{
372
372
var diffuseBatchTime = _logger ? . LogBegin ( "Batch Diffuser starting..." ) ;
373
373
var options = GetSchedulerOptionsOrDefault ( schedulerOptions ) ;
@@ -392,11 +392,11 @@ public override async IAsyncEnumerable<OnnxVideo> GenerateVideoBatchAsync(BatchO
392
392
foreach ( var batchSchedulerOption in batchSchedulerOptions )
393
393
{
394
394
var frames = new List < OnnxImage > ( ) ;
395
- await foreach ( var frameTensor in DiffuseVideoAsync ( diffuser , promptOptions , options , promptEmbeddings , performGuidance , progressCallback , cancellationToken ) )
395
+ await foreach ( var frameTensor in DiffuseVideoAsync ( diffuser , promptOptions , batchSchedulerOption , promptEmbeddings , performGuidance , progressCallback , cancellationToken ) )
396
396
{
397
397
frames . Add ( new OnnxImage ( frameTensor ) ) ;
398
398
}
399
- yield return new OnnxVideo ( promptOptions . InputVideo . Info , frames ) ;
399
+ yield return new BatchVideoResult ( batchSchedulerOption , new OnnxVideo ( promptOptions . InputVideo . Info , frames ) ) ;
400
400
batchIndex ++ ;
401
401
}
402
402
0 commit comments