|
|
|
<Styles
|
|
|
|
xmlns="https://github.com/avaloniaui"
|
|
|
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
|
|
|
xmlns:comfy="clr-namespace:StabilityMatrix.Core.Models.Api.Comfy;assembly=StabilityMatrix.Core"
|
|
|
|
xmlns:controls="using:StabilityMatrix.Avalonia.Controls"
|
|
|
|
xmlns:data="clr-namespace:FluentAvalonia.UI.Data;assembly=FluentAvalonia"
|
|
|
|
xmlns:mocks="clr-namespace:StabilityMatrix.Avalonia.DesignData"
|
|
|
|
xmlns:ui="clr-namespace:FluentAvalonia.UI.Controls;assembly=FluentAvalonia"
|
|
|
|
xmlns:vmInference="using:StabilityMatrix.Avalonia.ViewModels.Inference"
|
|
|
|
xmlns:input="clr-namespace:FluentAvalonia.UI.Input;assembly=FluentAvalonia"
|
|
|
|
xmlns:fluentIcons="clr-namespace:FluentIcons.FluentAvalonia;assembly=FluentIcons.FluentAvalonia"
|
|
|
|
x:DataType="vmInference:UpscalerCardViewModel">
|
|
|
|
<Design.PreviewWith>
|
|
|
|
<Grid MinWidth="300">
|
|
|
|
<StackPanel Spacing="16">
|
|
|
|
<controls:UpscalerCard DataContext="{x:Static mocks:DesignData.UpscalerCardViewModel}" />
|
|
|
|
<controls:UpscalerCard
|
|
|
|
DataContext="{x:Static mocks:DesignData.UpscalerCardViewModel}" />
|
|
|
|
</StackPanel>
|
|
|
|
</Grid>
|
|
|
|
</Design.PreviewWith>
|
|
|
|
|
|
|
|
<Style Selector="controls|UpscalerCard">
|
|
|
|
<!-- Set Defaults -->
|
|
|
|
<Setter Property="Template">
|
|
|
|
<ControlTemplate>
|
|
|
|
<controls:Card x:Name="PART_Card">
|
|
|
|
<StackPanel Spacing="8">
|
|
|
|
<Grid ColumnDefinitions="Auto,*" RowDefinitions="*,*,*">
|
|
|
|
<!-- Upscaler -->
|
|
|
|
<TextBlock
|
|
|
|
Grid.Row="0"
|
|
|
|
Grid.Column="0"
|
|
|
|
Margin="0,0,4,8"
|
|
|
|
VerticalAlignment="Center"
|
|
|
|
Text="Upscaler" />
|
|
|
|
<ui:FAComboBox
|
|
|
|
Name="UpscalerComboBox"
|
|
|
|
Grid.Row="0"
|
|
|
|
Grid.Column="1"
|
|
|
|
ItemsSource="{Binding ClientManager.Upscalers}"
|
|
|
|
SelectedItem="{Binding SelectedUpscaler}"
|
|
|
|
Margin="8,0,0,8"
|
|
|
|
HorizontalAlignment="Stretch">
|
|
|
|
|
|
|
|
<ui:FAComboBox.Resources>
|
|
|
|
<input:StandardUICommand
|
|
|
|
x:Key="RemoteDownloadCommand"
|
|
|
|
Command="{Binding RemoteDownloadCommand}"/>
|
|
|
|
</ui:FAComboBox.Resources>
|
|
|
|
|
|
|
|
<ui:FAComboBox.DataTemplates>
|
|
|
|
<controls:ComfyUpscalerTemplateSelector>
|
|
|
|
<DataTemplate DataType="comfy:ComfyUpscaler" x:Key="{x:Static comfy:ComfyUpscalerType.DownloadableModel}">
|
|
|
|
<Grid ColumnDefinitions="*,Auto">
|
|
|
|
<TextBlock
|
|
|
|
Text="{Binding DisplayName}"
|
|
|
|
Foreground="{DynamicResource ThemeGreyColor}"/>
|
|
|
|
<Button
|
|
|
|
Grid.Column="1"
|
|
|
|
Classes="transparent-full"
|
|
|
|
Margin="8,0,0,0"
|
|
|
|
Padding="0">
|
|
|
|
<fluentIcons:SymbolIcon
|
|
|
|
VerticalAlignment="Center"
|
|
|
|
FontSize="18"
|
|
|
|
Foreground="{DynamicResource ThemeGreyColor}"
|
|
|
|
IsFilled="True"
|
|
|
|
Symbol="CloudArrowDown" />
|
|
|
|
</Button>
|
|
|
|
</Grid>
|
|
|
|
</DataTemplate>
|
|
|
|
<DataTemplate DataType="comfy:ComfyUpscaler" x:Key="{x:Static comfy:ComfyUpscalerType.None}">
|
|
|
|
<TextBlock Text="{Binding DisplayName}"/>
|
|
|
|
</DataTemplate>
|
|
|
|
</controls:ComfyUpscalerTemplateSelector>
|
|
|
|
</ui:FAComboBox.DataTemplates>
|
|
|
|
</ui:FAComboBox>
|
|
|
|
</Grid>
|
|
|
|
<!-- Dimensions (Scale) -->
|
|
|
|
<StackPanel>
|
|
|
|
<Grid ColumnDefinitions="*,Auto">
|
|
|
|
<TextBlock
|
|
|
|
VerticalAlignment="Center"
|
|
|
|
Text="Upscale by"/>
|
|
|
|
<ui:NumberBox
|
|
|
|
Grid.Column="1"
|
|
|
|
Margin="4,0,0,0"
|
|
|
|
ValidationMode="InvalidInputOverwritten"
|
|
|
|
SmallChange="0.5"
|
|
|
|
SimpleNumberFormat="F2"
|
|
|
|
Value="{Binding Scale}"
|
|
|
|
HorizontalAlignment="Stretch"
|
|
|
|
SpinButtonPlacementMode="Compact"/>
|
|
|
|
</Grid>
|
|
|
|
<Slider
|
|
|
|
Minimum="1"
|
|
|
|
Maximum="4"
|
|
|
|
Value="{Binding Scale}"
|
|
|
|
IsSnapToTickEnabled="True"
|
|
|
|
TickFrequency="0.5"
|
|
|
|
TickPlacement="BottomRight"/>
|
|
|
|
</StackPanel>
|
|
|
|
|
|
|
|
</StackPanel>
|
|
|
|
</controls:Card>
|
|
|
|
</ControlTemplate>
|
|
|
|
</Setter>
|
|
|
|
</Style>
|
|
|
|
</Styles>
|