|
2 | 2 | xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
3 | 3 | xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
4 | 4 | xmlns:system="clr-namespace:System;assembly=mscorlib"
|
| 5 | + xmlns:componentModel="clr-namespace:System.ComponentModel;assembly=System.ComponentModel.TypeConverter" |
5 | 6 | xmlns:theme="clr-namespace:Microsoft.Windows.Themes;assembly=PresentationFramework.Aero2"
|
6 |
| - xmlns:local="clr-namespace:OnnxStack.UI" |
| 7 | + xmlns:local="clr-namespace:OnnxStack.UI" |
7 | 8 | xmlns:SD_Enums="clr-namespace:OnnxStack.StableDiffusion.Enums;assembly=OnnxStack.StableDiffusion"
|
8 | 9 | xmlns:userControls="clr-namespace:OnnxStack.UI.UserControls"
|
9 | 10 | xmlns:behaviors="clr-namespace:OnnxStack.UI.Behaviors"
|
|
25 | 26 | <FontFamily x:Key="FontAwesomeRegular">pack://application:,,,/Fonts/fa-regular-400.ttf#Font Awesome 5 Pro Regular</FontFamily>
|
26 | 27 | <FontFamily x:Key="FontAwesomeSolid">pack://application:,,,/Fonts/fa-solid-900.ttf#Font Awesome 5 Pro Solid</FontFamily>
|
27 | 28 |
|
28 |
| - |
| 29 | + <system:Boolean x:Key="True">True</system:Boolean> |
| 30 | + <system:Boolean x:Key="False">False</system:Boolean> |
29 | 31 | <BooleanToVisibilityConverter x:Key="BooleanToVisibilityConverter" />
|
30 | 32 | <converters:InverseBooleanToVisibilityConverter x:Key="InverseBooleanToVisibilityConverter" />
|
31 | 33 | <converters:InverseBoolConverter x:Key="InverseBoolConverter" />
|
|
35 | 37 | <converters:InverseNullVisibilityConverter x:Key="InverseNullVisibilityConverter" />
|
36 | 38 | <converters:DiffuserVisibilityConverter x:Key="DiffuserVisibilityConverter" />
|
37 | 39 | <converters:PipelineVisibilityConverter x:Key="PipelineVisibilityConverter" />
|
| 40 | + <converters:ComboBoxAllItemConverter x:Key="ComboBoxAllItemConverter" /> |
| 41 | + <converters:EnumDescriptionConverter x:Key="EnumDescriptionConverter" /> |
| 42 | + |
| 43 | + <ObjectDataProvider x:Key="ListSortDirection" MethodName="GetValues" ObjectType="{x:Type system:Enum}"> |
| 44 | + <ObjectDataProvider.MethodParameters> |
| 45 | + <x:Type TypeName="componentModel:ListSortDirection"/> |
| 46 | + </ObjectDataProvider.MethodParameters> |
| 47 | + </ObjectDataProvider> |
38 | 48 |
|
39 | 49 | <ObjectDataProvider x:Key="SchedulerType" MethodName="GetValues" ObjectType="{x:Type system:Enum}">
|
40 | 50 | <ObjectDataProvider.MethodParameters>
|
41 | 51 | <x:Type TypeName="SD_Enums:SchedulerType"/>
|
42 | 52 | </ObjectDataProvider.MethodParameters>
|
43 | 53 | </ObjectDataProvider>
|
44 | 54 |
|
| 55 | + <ObjectDataProvider x:Key="ModelType" MethodName="GetValues" ObjectType="{x:Type system:Enum}"> |
| 56 | + <ObjectDataProvider.MethodParameters> |
| 57 | + <x:Type TypeName="SD_Enums:ModelType"/> |
| 58 | + </ObjectDataProvider.MethodParameters> |
| 59 | + </ObjectDataProvider> |
| 60 | + |
| 61 | + <ObjectDataProvider x:Key="TokenizerType" MethodName="GetValues" ObjectType="{x:Type system:Enum}"> |
| 62 | + <ObjectDataProvider.MethodParameters> |
| 63 | + <x:Type TypeName="SD_Enums:TokenizerType"/> |
| 64 | + </ObjectDataProvider.MethodParameters> |
| 65 | + </ObjectDataProvider> |
| 66 | + |
45 | 67 | <ObjectDataProvider x:Key="AlphaTransformType" MethodName="GetValues" ObjectType="{x:Type system:Enum}">
|
46 | 68 | <ObjectDataProvider.MethodParameters>
|
47 | 69 | <x:Type TypeName="SD_Enums:AlphaTransformType"/>
|
|
106 | 128 |
|
107 | 129 |
|
108 | 130 |
|
109 |
| - |
| 131 | + |
110 | 132 |
|
111 | 133 |
|
112 | 134 |
|
|
233 | 255 | <TextBlock Text="{Binding SchedulerOptions.Seed}" Margin="2,0,0,0" />
|
234 | 256 | </StackPanel>
|
235 | 257 | </UniformGrid>
|
236 |
| - <UniformGrid Columns="6" Margin="0,2,0,2"> |
237 |
| - <Button Command="{Binding RelativeSource={RelativeSource FindAncestor,AncestorType={x:Type Window}}, Path=SaveImageCommand}" CommandParameter="{Binding}"> |
| 258 | + <UniformGrid Columns="7" Margin="0,2,0,2"> |
| 259 | + <Button Command="{Binding RelativeSource={RelativeSource FindAncestor,AncestorType={x:Type Window}}, Path=SaveImageResultCommand}" CommandParameter="{Binding}"> |
238 | 260 | <userControls:FontAwesome Icon="" IconStyle="Light" Size="13" ToolTip="Save Image File"/>
|
239 | 261 | </Button>
|
240 | 262 | <Button Command="{Binding RelativeSource={RelativeSource FindAncestor,AncestorType={x:Type Window}}, Path=SaveBlueprintCommand}" CommandParameter="{Binding}" BorderThickness="0, 1">
|
|
252 | 274 | <Button Command="{Binding RelativeSource={RelativeSource FindAncestor,AncestorType={x:Type Window}}, Path=NavigateImagePaintToImageCommand}" CommandParameter="{Binding}" Padding="2,2" BorderThickness="0,1,1,1">
|
253 | 275 | <userControls:FontAwesome Icon="" IconStyle="Light" Size="13" ToolTip="Send To Upscaler"/>
|
254 | 276 | </Button>
|
| 277 | + <Button Command="{Binding RelativeSource={RelativeSource FindAncestor,AncestorType={x:Type Window}}, Path=NavigateUpscalerCommand}" CommandParameter="{Binding}" Padding="2,2" BorderThickness="0,1,1,1"> |
| 278 | + <userControls:FontAwesome Icon="" IconStyle="Light" Size="13" ToolTip="Send To Upscaler"/> |
| 279 | + </Button> |
255 | 280 | </UniformGrid>
|
256 | 281 | </StackPanel>
|
257 | 282 | <Border Margin="0,2" BorderBrush="{StaticResource ContainerBorder}" BorderThickness="1" Background="{StaticResource ContainerBackground}" >
|
|
260 | 285 | </DockPanel>
|
261 | 286 | </DataTemplate>
|
262 | 287 |
|
| 288 | + <DataTemplate DataType="{x:Type models:UpscaleResult}"> |
| 289 | + <DockPanel Width="220" Height="285" HorizontalAlignment="Center"> |
| 290 | + <StackPanel DockPanel.Dock="Bottom" > |
| 291 | + |
| 292 | + <UniformGrid Columns="2" Margin="0,3"> |
263 | 293 |
|
| 294 | + <StackPanel Orientation="Horizontal" HorizontalAlignment="Center"> |
| 295 | + <TextBlock Text="Scale Factor:" Margin="0,0,5,0" FontStyle="Italic" FontSize="10" Opacity=".6" VerticalAlignment="Center"/> |
| 296 | + <TextBlock Text="{Binding Info.ScaleFactor}" /> |
| 297 | + </StackPanel> |
| 298 | + <StackPanel Orientation="Horizontal" HorizontalAlignment="Center"> |
| 299 | + <TextBlock Text="Elapsed:" Margin="5,0,0,0" FontSize="10" Opacity=".6" VerticalAlignment="Center" FontStyle="Italic"/> |
| 300 | + <TextBlock Text="{Binding Elapsed, StringFormat={}{0:F1}s}" Margin="5,0,0,0"/> |
| 301 | + </StackPanel> |
| 302 | + |
| 303 | + <StackPanel Orientation="Horizontal" HorizontalAlignment="Center"> |
| 304 | + <TextBlock Text="Input:" Margin="0,0,5,0" FontStyle="Italic" FontSize="10" Opacity=".6" VerticalAlignment="Center"/> |
| 305 | + <TextBlock Text="{Binding Info.InputWidth}" /> |
| 306 | + <TextBlock Text="x" Margin="2,0,2,0"/> |
| 307 | + <TextBlock Text="{Binding Info.InputHeight}" /> |
| 308 | + </StackPanel> |
| 309 | + |
| 310 | + <StackPanel Orientation="Horizontal" HorizontalAlignment="Center"> |
| 311 | + <TextBlock Text="Output:" Margin="0,0,5,0" FontStyle="Italic" FontSize="10" Opacity=".6" VerticalAlignment="Center"/> |
| 312 | + <TextBlock Text="{Binding Info.OutputWidth}" /> |
| 313 | + <TextBlock Text="x" Margin="2,0,2,0"/> |
| 314 | + <TextBlock Text="{Binding Info.OutputHeight}" /> |
| 315 | + </StackPanel> |
| 316 | + |
| 317 | + </UniformGrid> |
| 318 | + |
| 319 | + |
| 320 | + |
| 321 | + <UniformGrid Columns="1" Height="30" IsEnabled="{Binding HasResult}"> |
| 322 | + <Button Command="{Binding RelativeSource={RelativeSource FindAncestor,AncestorType={x:Type Window}}, Path=SaveImageCommand}" CommandParameter="{Binding}" ToolTip="Save Image File"> |
| 323 | + <StackPanel Orientation="Horizontal"> |
| 324 | + <userControls:FontAwesome Icon="" IconStyle="Light" Size="13" /> |
| 325 | + <TextBlock Text="Save Image" Margin="5,0,0,0"/> |
| 326 | + </StackPanel> |
| 327 | + </Button> |
| 328 | + </UniformGrid> |
| 329 | + |
| 330 | + |
| 331 | + </StackPanel> |
| 332 | + <Border Margin="0,2" BorderBrush="{StaticResource ContainerBorder}" BorderThickness="1" Background="{StaticResource ContainerBackground}" > |
| 333 | + <Image Source="{Binding Image}" DockPanel.Dock="Left" Stretch="Uniform" VerticalAlignment="Center" /> |
| 334 | + </Border> |
| 335 | + </DockPanel> |
| 336 | + </DataTemplate> |
264 | 337 |
|
265 | 338 | <!--RadioButton-->
|
266 | 339 | <SolidColorBrush x:Key="RadioButtonBackground" Color="#FF2D2D2D"/>
|
|
722 | 795 |
|
723 | 796 |
|
724 | 797 |
|
725 |
| - |
726 |
| - |
727 |
| - |
728 |
| - |
729 |
| - |
730 |
| - |
731 |
| - |
732 |
| - |
| 798 | + <Style x:Key="EnumComboBox" TargetType="{x:Type ComboBox}" BasedOn="{StaticResource {x:Type ComboBox}}"> |
| 799 | + <Setter Property="ItemTemplate"> |
| 800 | + <Setter.Value> |
| 801 | + <DataTemplate> |
| 802 | + <TextBlock Text="{Binding Converter={StaticResource EnumDescriptionConverter}}"/> |
| 803 | + </DataTemplate> |
| 804 | + </Setter.Value> |
| 805 | + </Setter> |
| 806 | + </Style> |
733 | 807 |
|
734 | 808 |
|
735 | 809 |
|
|
0 commit comments