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

Commit 3d50ce4

Browse files
committed
Enable/Disable history saving for Realtime
1 parent d479ac5 commit 3d50ce4

File tree

7 files changed

+19
-0
lines changed

7 files changed

+19
-0
lines changed

OnnxStack.UI/Models/OnnxStackUIConfig.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ public class OnnxStackUIConfig : IConfigSection
1515
public bool ImageAutoSaveBlueprint { get; set; }
1616
public string ImageAutoSaveDirectory { get; set; }
1717
public int RealtimeRefreshRate { get; set; } = 100;
18+
public bool RealtimeHistoryEnabled { get; set; }
1819
public int DefaultDeviceId { get; set; }
1920
public int DefaultInterOpNumThreads { get; set; }
2021
public int DefaultIntraOpNumThreads { get; set; }

OnnxStack.UI/Views/ImageInpaintView.xaml.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -234,6 +234,8 @@ private async Task Generate()
234234
HasResult = true;
235235
if (BatchOptions.IsAutomationEnabled && BatchOptions.DisableHistory)
236236
continue;
237+
if (BatchOptions.IsRealtimeEnabled && !UISettings.RealtimeHistoryEnabled)
238+
continue;
237239

238240
ImageResults.Add(resultImage);
239241
}

OnnxStack.UI/Views/ImageToImageView.xaml.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -216,6 +216,8 @@ private async Task Generate()
216216
HasResult = true;
217217
if (BatchOptions.IsAutomationEnabled && BatchOptions.DisableHistory)
218218
continue;
219+
if (BatchOptions.IsRealtimeEnabled && !UISettings.RealtimeHistoryEnabled)
220+
continue;
219221

220222
ImageResults.Add(resultImage);
221223
}

OnnxStack.UI/Views/PaintToImageView.xaml.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -226,6 +226,8 @@ private async Task Generate()
226226
HasResult = true;
227227
if (BatchOptions.IsAutomationEnabled && BatchOptions.DisableHistory)
228228
continue;
229+
if (BatchOptions.IsRealtimeEnabled && !UISettings.RealtimeHistoryEnabled)
230+
continue;
229231

230232
ImageResults.Add(resultImage);
231233
}

OnnxStack.UI/Views/SettingsView.xaml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,15 @@
4242
IsEnabled="{Binding IsChecked, ElementName=CheckBoxImageAutoSave}"
4343
IsRequired="{Binding IsChecked, ElementName=CheckBoxImageAutoSave}"/>
4444
</StackPanel>
45+
46+
<UniformGrid Columns="2">
47+
<StackPanel Margin="0,5,0,0">
48+
<TextBlock Text="Realtime Refresh Rate (ms)" />
49+
<TextBox Text="{Binding UISettings.RealtimeRefreshRate}"/>
50+
</StackPanel>
51+
<CheckBox Content="Enable Histrory" IsChecked="{Binding UISettings.RealtimeHistoryEnabled}" VerticalAlignment="Bottom" Margin="5,0,0,0" />
52+
</UniformGrid>
53+
4554
</StackPanel>
4655
</GroupBox>
4756

OnnxStack.UI/Views/TextToImageView.xaml.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -195,6 +195,8 @@ private async Task Generate()
195195
HasResult = true;
196196
if (BatchOptions.IsAutomationEnabled && BatchOptions.DisableHistory)
197197
continue;
198+
if (BatchOptions.IsRealtimeEnabled && !UISettings.RealtimeHistoryEnabled)
199+
continue;
198200

199201
ImageResults.Add(resultImage);
200202
}

OnnxStack.UI/appsettings.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
"ImageAutoSaveBlueprint": false,
1717
"ImageAutoSaveDirectory": "",
1818
"RealtimeRefreshRate": 100,
19+
"RealtimeHistoryEnabled": false,
1920
"DefaultDeviceId": 0,
2021
"DefaultInterOpNumThreads": 0,
2122
"DefaultIntraOpNumThreads": 0,

0 commit comments

Comments
 (0)