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

Commit ab3da9b

Browse files
committed
Merge branch 'master' into RTSD
# Conflicts: # OnnxStack.UI/UserControls/SchedulerControl.xaml
2 parents 16bc942 + 5d7cedb commit ab3da9b

File tree

2 files changed

+66
-18
lines changed

2 files changed

+66
-18
lines changed

OnnxStack.StableDiffusion/Config/SchedulerOptions.cs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,5 +86,16 @@ public record SchedulerOptions
8686
public float MaximumBeta { get; set; } = 0.999f;
8787

8888
public int OriginalInferenceSteps { get; set; } = 50;
89+
90+
public bool IsKarrasScheduler
91+
{
92+
get
93+
{
94+
return SchedulerType == SchedulerType.LMS
95+
|| SchedulerType == SchedulerType.KDPM2
96+
|| SchedulerType == SchedulerType.Euler
97+
|| SchedulerType == SchedulerType.EulerAncestral;
98+
}
99+
}
89100
}
90101
}

OnnxStack.UI/UserControls/SchedulerControl.xaml

Lines changed: 55 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@
7575
</StackPanel>
7676
</UniformGrid>
7777

78-
<UniformGrid Columns="2" Margin="0,10,0,10">
78+
<UniformGrid Columns="2" Margin="0,10,0,0">
7979

8080

8181
<StackPanel Margin="0,0,5,0">
@@ -124,8 +124,48 @@
124124
</StackPanel>
125125
</UniformGrid>
126126

127-
<UniformGrid Columns="2">
128-
<Button Command="{Binding ResetParametersCommand}" Margin="0,5,0,0" HorizontalAlignment="Left">
127+
<UniformGrid Columns="2" Rows="1" Margin="0,1,0,10">
128+
129+
<StackPanel Margin="0,0,5,0">
130+
<Label>Beta Schedule</Label>
131+
<ComboBox ItemsSource="{Binding Source={StaticResource BetaScheduleType}}" SelectedItem="{Binding SchedulerOptions.BetaSchedule}">
132+
<ComboBox.ItemContainerStyle>
133+
<Style TargetType="{x:Type ComboBoxItem}" BasedOn="{StaticResource {x:Type ComboBoxItem}}">
134+
<Setter Property="Visibility" Value="Visible" />
135+
<Style.Triggers>
136+
<DataTrigger Binding="{Binding}" Value="SquaredCosCapV2">
137+
<Setter Property="Visibility" Value="Collapsed" />
138+
</DataTrigger>
139+
</Style.Triggers>
140+
</Style>
141+
</ComboBox.ItemContainerStyle>
142+
</ComboBox>
143+
</StackPanel>
144+
145+
<StackPanel VerticalAlignment="Bottom" >
146+
<CheckBox Content="Use Karras Sigmas" IsChecked="{Binding SchedulerOptions.UseKarrasSigmas}" Margin="5,0,0,5" />
147+
<StackPanel.Style>
148+
<Style TargetType="{x:Type StackPanel}">
149+
<Setter Property="IsEnabled" Value="True" />
150+
<Style.Triggers>
151+
<DataTrigger Binding="{Binding SchedulerOptions.SchedulerType, ElementName=UI}" Value="LCM" >
152+
<Setter Property="IsEnabled" Value="False" />
153+
</DataTrigger>
154+
<DataTrigger Binding="{Binding SchedulerOptions.SchedulerType, ElementName=UI}" Value="DDIM" >
155+
<Setter Property="IsEnabled" Value="False" />
156+
</DataTrigger>
157+
<DataTrigger Binding="{Binding SchedulerOptions.SchedulerType, ElementName=UI}" Value="DDPM" >
158+
<Setter Property="IsEnabled" Value="False" />
159+
</DataTrigger>
160+
</Style.Triggers>
161+
</Style>
162+
</StackPanel.Style>
163+
</StackPanel>
164+
165+
</UniformGrid>
166+
167+
<UniformGrid>
168+
<Button>
129169
<userControls:FontAwesome Icon="&#xf2ea;" IconStyle="Light" Size="14" Margin="2"/>
130170
</Button>
131171
<CheckBox IsChecked="{Binding BatchOptions.IsRealtimeEnabled}" IsEnabled="{Binding BatchOptions.IsAutomationEnabled, Converter={StaticResource InverseBoolConverter}}" Content="Enable Live Update" HorizontalAlignment="Right" VerticalAlignment="Bottom" />
@@ -144,12 +184,8 @@
144184
<StackPanel Margin="2">
145185

146186
<UniformGrid Columns="2" Margin="0,10, 0, 0">
147-
<StackPanel HorizontalAlignment="Center">
148-
<CheckBox Content="Use Karras Sigmas" IsChecked="{Binding SchedulerOptions.UseKarrasSigmas}" Margin="0,0,0,5"/>
149-
</StackPanel>
150-
<StackPanel HorizontalAlignment="Center">
151-
<CheckBox Content="Thresholding" IsChecked="{Binding SchedulerOptions.Thresholding}" Margin="0,0,0,5"/>
152-
</StackPanel>
187+
188+
153189
</UniformGrid>
154190

155191
<UniformGrid Columns="3">
@@ -183,37 +219,38 @@
183219
</UniformGrid>
184220

185221
<UniformGrid Columns="3">
222+
186223
<StackPanel>
187-
<Label>BetaSchedule</Label>
188-
<ComboBox ItemsSource="{Binding Source={StaticResource BetaScheduleType}}" SelectedItem="{Binding SchedulerOptions.BetaSchedule}" />
189-
</StackPanel>
190-
<StackPanel Margin="1,0,1,0">
191224
<Label>BetaStart</Label>
192225
<TextBox Text="{Binding SchedulerOptions.BetaStart}"/>
193226
</StackPanel>
194-
<StackPanel>
227+
<StackPanel Margin="1,0,1,0">
195228
<Label>BetaEnd</Label>
196229
<TextBox Text="{Binding SchedulerOptions.BetaEnd}"/>
197230
</StackPanel>
198-
</UniformGrid>
199-
200-
<UniformGrid Columns="3">
201231
<StackPanel>
202232
<Label>MaximumBeta</Label>
203233
<TextBox Text="{Binding SchedulerOptions.MaximumBeta}"/>
204234
</StackPanel>
235+
</UniformGrid>
236+
237+
<UniformGrid Columns="3">
238+
205239
<StackPanel Margin="1,0,1,0">
206240
<Label>ClipSampleRange</Label>
207241
<TextBox Text="{Binding SchedulerOptions.ClipSampleRange}"/>
208242
</StackPanel>
209243
<StackPanel VerticalAlignment="Bottom">
210244
<CheckBox Content="ClipSample" IsChecked="{Binding SchedulerOptions.ClipSample}" Margin="5,0,0,5"/>
211245
</StackPanel>
246+
<StackPanel VerticalAlignment="Bottom">
247+
<CheckBox Content="Thresholding" IsChecked="{Binding SchedulerOptions.Thresholding}" Margin="5,0,0,5"/>
248+
</StackPanel>
212249
</UniformGrid>
213250

214251
<UniformGrid Columns="3">
215252
<StackPanel Visibility="{Binding SelectedModel.ModelOptions.PipelineType, Converter={StaticResource PipelineVisibilityConverter}, ConverterParameter=LatentConsistency}">
216-
<Label>LCM Original Steps</Label>
253+
<Label>Original Timesteps</Label>
217254
<TextBox Text="{Binding SchedulerOptions.OriginalInferenceSteps}"/>
218255
</StackPanel>
219256
<StackPanel Margin="1,0,1,0">

0 commit comments

Comments
 (0)