Skip to content
This repository was archived by the owner on Nov 27, 2024. It is now read-only.

Commit eac0b22

Browse files
committed
Fixed timestamp being set incorrectly in ExecuteStableDiffusion in the inference views.
1 parent cd06107 commit eac0b22

File tree

3 files changed

+6
-3
lines changed

3 files changed

+6
-3
lines changed

OnnxStack.UI/Views/ImageInpaint.xaml.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -347,10 +347,11 @@ private async IAsyncEnumerable<ImageResult> ExecuteStableDiffusion(IModelOptions
347347
}
348348
else
349349
{
350+
var timestamp = Stopwatch.GetTimestamp();
350351
await foreach (var batchResult in _stableDiffusionService.GenerateBatchAsync(modelOptions, promptOptions, schedulerOptions, batchOptions, ProgressBatchCallback(), _cancelationTokenSource.Token))
351352
{
352-
var timestamp = Stopwatch.GetTimestamp();
353353
yield return await GenerateResultAsync(batchResult.ImageResult.ToImageBytes(), promptOptions, batchResult.SchedulerOptions, timestamp);
354+
timestamp = Stopwatch.GetTimestamp();
354355
}
355356
}
356357
}

OnnxStack.UI/Views/ImageToImage.xaml.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -321,10 +321,11 @@ private async IAsyncEnumerable<ImageResult> ExecuteStableDiffusion(IModelOptions
321321
}
322322
else
323323
{
324+
var timestamp = Stopwatch.GetTimestamp();
324325
await foreach (var batchResult in _stableDiffusionService.GenerateBatchAsync(modelOptions, promptOptions, schedulerOptions, batchOptions, ProgressBatchCallback(), _cancelationTokenSource.Token))
325326
{
326-
var timestamp = Stopwatch.GetTimestamp();
327327
yield return await GenerateResultAsync(batchResult.ImageResult.ToImageBytes(), promptOptions, batchResult.SchedulerOptions, timestamp);
328+
timestamp = Stopwatch.GetTimestamp();
328329
}
329330
}
330331
}

OnnxStack.UI/Views/TextToImage.xaml.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -295,10 +295,11 @@ private async IAsyncEnumerable<ImageResult> ExecuteStableDiffusion(IModelOptions
295295
}
296296
else
297297
{
298+
var timestamp = Stopwatch.GetTimestamp();
298299
await foreach (var batchResult in _stableDiffusionService.GenerateBatchAsync(modelOptions, promptOptions, schedulerOptions, batchOptions, ProgressBatchCallback(), _cancelationTokenSource.Token))
299300
{
300-
var timestamp = Stopwatch.GetTimestamp();
301301
yield return await GenerateResultAsync(batchResult.ImageResult.ToImageBytes(), promptOptions, batchResult.SchedulerOptions, timestamp);
302+
timestamp = Stopwatch.GetTimestamp();
302303
}
303304
}
304305
}

0 commit comments

Comments
 (0)