|
| 1 | +<Application x:Class="OnnxStack.UI.App" |
| 2 | + xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" |
| 3 | + xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
| 4 | + xmlns:system="clr-namespace:System;assembly=mscorlib" |
| 5 | + xmlns:local="clr-namespace:OnnxStack.UI" |
| 6 | + xmlns:SD_Enums="clr-namespace:OnnxStack.StableDiffusion.Enums;assembly=OnnxStack.StableDiffusion" |
| 7 | + xmlns:userControls="clr-namespace:OnnxStack.UI.UserControls" |
| 8 | + xmlns:behaviors="clr-namespace:OnnxStack.UI.Behaviors" |
| 9 | + xmlns:models="clr-namespace:OnnxStack.UI.Models" |
| 10 | + xmlns:converters="clr-namespace:OnnxStack.UI.Converters"> |
| 11 | + <Application.Resources> |
| 12 | + |
| 13 | + <BitmapImage x:Key="PlaceholderImage" UriSource="/Images/placeholder.png" /> |
| 14 | + |
| 15 | + <FontFamily x:Key="FontAwesomeBrands">pack://application:,,,/Fonts/fa-brands-400.ttf#Font Awesome 5 Brands Regular</FontFamily> |
| 16 | + <FontFamily x:Key="FontAwesomeDuotone">pack://application:,,,/Fonts/fa-duotone-900.ttf#Font Awesome 5 Duotone Solid</FontFamily> |
| 17 | + <FontFamily x:Key="FontAwesomeLight">pack://application:,,,/Fonts/fa-light-300.ttf#Font Awesome 5 Pro Light</FontFamily> |
| 18 | + <FontFamily x:Key="FontAwesomeRegular">pack://application:,,,/Fonts/fa-regular-400.ttf#Font Awesome 5 Pro Regular</FontFamily> |
| 19 | + <FontFamily x:Key="FontAwesomeSolid">pack://application:,,,/Fonts/fa-solid-900.ttf#Font Awesome 5 Pro Solid</FontFamily> |
| 20 | + |
| 21 | + |
| 22 | + <BooleanToVisibilityConverter x:Key="BooleanToVisibilityConverter" /> |
| 23 | + <converters:InverseBooleanToVisibilityConverter x:Key="InverseBooleanToVisibilityConverter" /> |
| 24 | + <converters:InverseBoolConverter x:Key="InverseBoolConverter" /> |
| 25 | + |
| 26 | + <ObjectDataProvider x:Key="SchedulerType" MethodName="GetValues" ObjectType="{x:Type system:Enum}"> |
| 27 | + <ObjectDataProvider.MethodParameters> |
| 28 | + <x:Type TypeName="SD_Enums:SchedulerType"/> |
| 29 | + </ObjectDataProvider.MethodParameters> |
| 30 | + </ObjectDataProvider> |
| 31 | + |
| 32 | + <ObjectDataProvider x:Key="AlphaTransformType" MethodName="GetValues" ObjectType="{x:Type system:Enum}"> |
| 33 | + <ObjectDataProvider.MethodParameters> |
| 34 | + <x:Type TypeName="SD_Enums:AlphaTransformType"/> |
| 35 | + </ObjectDataProvider.MethodParameters> |
| 36 | + </ObjectDataProvider> |
| 37 | + |
| 38 | + <ObjectDataProvider x:Key="BetaScheduleType" MethodName="GetValues" ObjectType="{x:Type system:Enum}"> |
| 39 | + <ObjectDataProvider.MethodParameters> |
| 40 | + <x:Type TypeName="SD_Enums:BetaScheduleType"/> |
| 41 | + </ObjectDataProvider.MethodParameters> |
| 42 | + </ObjectDataProvider> |
| 43 | + |
| 44 | + <ObjectDataProvider x:Key="PredictionType" MethodName="GetValues" ObjectType="{x:Type system:Enum}"> |
| 45 | + <ObjectDataProvider.MethodParameters> |
| 46 | + <x:Type TypeName="SD_Enums:PredictionType"/> |
| 47 | + </ObjectDataProvider.MethodParameters> |
| 48 | + </ObjectDataProvider> |
| 49 | + |
| 50 | + <ObjectDataProvider x:Key="TimestepSpacingType" MethodName="GetValues" ObjectType="{x:Type system:Enum}"> |
| 51 | + <ObjectDataProvider.MethodParameters> |
| 52 | + <x:Type TypeName="SD_Enums:TimestepSpacingType"/> |
| 53 | + </ObjectDataProvider.MethodParameters> |
| 54 | + </ObjectDataProvider> |
| 55 | + |
| 56 | + <ObjectDataProvider x:Key="VarianceType" MethodName="GetValues" ObjectType="{x:Type system:Enum}"> |
| 57 | + <ObjectDataProvider.MethodParameters> |
| 58 | + <x:Type TypeName="SD_Enums:VarianceType"/> |
| 59 | + </ObjectDataProvider.MethodParameters> |
| 60 | + </ObjectDataProvider> |
| 61 | + |
| 62 | + |
| 63 | + <!--TODO: Style dictionary for themeing--> |
| 64 | + <Style TargetType="{x:Type TextBox}"> |
| 65 | + <Setter Property="Height" Value="24" /> |
| 66 | + <Setter Property="Padding" Value="2,3,0,0" /> |
| 67 | + </Style> |
| 68 | + |
| 69 | + <Style TargetType="{x:Type ComboBox}"> |
| 70 | + <Setter Property="Height" Value="24" /> |
| 71 | + <Setter Property="Padding" Value="4,3,0,0" /> |
| 72 | + |
| 73 | + </Style> |
| 74 | + |
| 75 | + |
| 76 | + |
| 77 | + |
| 78 | + <Style x:Key="ImageResultListBoxItem" TargetType="ListBoxItem"> |
| 79 | + <Setter Property="Margin" Value="2"/> |
| 80 | + <Setter Property="BorderThickness" Value="1" /> |
| 81 | + <Setter Property="BorderBrush" Value="LightGray" /> |
| 82 | + <Setter Property="Background" Value="WhiteSmoke"/> |
| 83 | + <Setter Property="HorizontalContentAlignment" Value="Stretch"></Setter> |
| 84 | + <Setter Property="Template"> |
| 85 | + <Setter.Value> |
| 86 | + <ControlTemplate TargetType="{x:Type ListBoxItem}"> |
| 87 | + <Border Name="Border" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}"> |
| 88 | + <ContentPresenter Content="{TemplateBinding Content}" ContentTemplate="{TemplateBinding ContentTemplate}" Margin="{TemplateBinding Padding}" /> |
| 89 | + </Border> |
| 90 | + </ControlTemplate> |
| 91 | + </Setter.Value> |
| 92 | + </Setter> |
| 93 | + </Style> |
| 94 | + |
| 95 | + |
| 96 | + <DataTemplate DataType="{x:Type models:ImageResult}"> |
| 97 | + <DockPanel Width="200" Height="265" HorizontalAlignment="Center"> |
| 98 | + <StackPanel DockPanel.Dock="Bottom" > |
| 99 | + <UniformGrid Columns="2" Rows="2" HorizontalAlignment="Center"> |
| 100 | + <StackPanel Orientation="Horizontal" HorizontalAlignment="Center"> |
| 101 | + <TextBlock Text="{Binding SchedulerType}" Margin="2,0,0,0"/> |
| 102 | + </StackPanel> |
| 103 | + <StackPanel Orientation="Horizontal" HorizontalAlignment="Center" > |
| 104 | + <TextBlock Text="Steps:" Margin="2,0,0,0" FontSize="9" Opacity=".6" VerticalAlignment="Center" FontStyle="Italic"/> |
| 105 | + <TextBlock Text="{Binding SchedulerOptions.InferenceSteps}" Margin="2,0,0,0"/> |
| 106 | + </StackPanel> |
| 107 | + <StackPanel Orientation="Horizontal" HorizontalAlignment="Center"> |
| 108 | + <TextBlock Text="Guidance:" Margin="2,0,0,0" FontSize="9" Opacity=".6" VerticalAlignment="Center" FontStyle="Italic"/> |
| 109 | + <TextBlock Text="{Binding SchedulerOptions.GuidanceScale}" Margin="2,0,0,0"/> |
| 110 | + </StackPanel> |
| 111 | + <StackPanel Orientation="Horizontal" HorizontalAlignment="Center"> |
| 112 | + <TextBlock Text="Seed:" Margin="2,0,0,0" FontSize="9" Opacity=".6" VerticalAlignment="Center" FontStyle="Italic"/> |
| 113 | + <TextBlock Text="{Binding SchedulerOptions.Seed}" Margin="2,0,0,0" /> |
| 114 | + </StackPanel> |
| 115 | + </UniformGrid> |
| 116 | + <UniformGrid Columns="6" Margin="0,2,0,2"> |
| 117 | + <Button Command="{Binding RelativeSource={RelativeSource FindAncestor,AncestorType={x:Type Window}}, Path=SaveImageCommand}" CommandParameter="{Binding}"> |
| 118 | + <userControls:FontAwesome Icon="" IconStyle="Light" Size="13" ToolTip="Save Image File"/> |
| 119 | + </Button> |
| 120 | + <Button Command="{Binding RelativeSource={RelativeSource FindAncestor,AncestorType={x:Type Window}}, Path=SaveBlueprintCommand}" CommandParameter="{Binding}" BorderThickness="0, 1"> |
| 121 | + <userControls:FontAwesome Icon="" IconStyle="Light" Size="13" ToolTip="Save Blueprint File"/> |
| 122 | + </Button> |
| 123 | + <Button Command="{Binding RelativeSource={RelativeSource FindAncestor,AncestorType={x:Type Window}}, Path=NavigateTextToImageCommand}" CommandParameter="{Binding}"> |
| 124 | + <userControls:FontAwesome Icon="" IconStyle="Light" Size="13" ToolTip="Send To Text To Image"/> |
| 125 | + </Button> |
| 126 | + <Button Command="{Binding RelativeSource={RelativeSource FindAncestor,AncestorType={x:Type Window}}, Path=NavigateImageToImageCommand}" CommandParameter="{Binding}" BorderThickness="0, 1"> |
| 127 | + <userControls:FontAwesome Icon="" IconStyle="Light" Size="13" ToolTip="Send To Image To Image"/> |
| 128 | + </Button> |
| 129 | + <Button Command="{Binding RelativeSource={RelativeSource FindAncestor,AncestorType={x:Type Window}}, Path=NavigateImageInpaintCommand}" CommandParameter="{Binding}" > |
| 130 | + <userControls:FontAwesome Icon="" IconStyle="Light" Size="13" ToolTip="Send To Image Inpaint"/> |
| 131 | + </Button> |
| 132 | + <Button Command="{Binding RelativeSource={RelativeSource FindAncestor,AncestorType={x:Type Window}}, Path=NavigateImageUpscaleCommand}" CommandParameter="{Binding}" Padding="2,2" BorderThickness="0,1,1,1"> |
| 133 | + <userControls:FontAwesome Icon="" IconStyle="Light" Size="13" ToolTip="Send To Upscaler"/> |
| 134 | + </Button> |
| 135 | + </UniformGrid> |
| 136 | + </StackPanel> |
| 137 | + <Border Margin="0,2" BorderBrush="#c0c0c0" BorderThickness="1" Background="White" > |
| 138 | + <Image Source="{Binding Image}" DockPanel.Dock="Left" Stretch="Uniform" VerticalAlignment="Center" /> |
| 139 | + </Border> |
| 140 | + </DockPanel> |
| 141 | + </DataTemplate> |
| 142 | + |
| 143 | + |
| 144 | + |
| 145 | + |
| 146 | + |
| 147 | + </Application.Resources> |
| 148 | +</Application> |
0 commit comments