Multi-Platform Package Manager for Stable Diffusion
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

111 lines
6.1 KiB

1 year ago
<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.Avalonia.Fluent;assembly=FluentIcons.Avalonia.Fluent"
1 year ago
x:DataType="vmInference:UpscalerCardViewModel">
<Design.PreviewWith>
<Grid MinWidth="300">
<StackPanel Spacing="16">
<controls:UpscalerCard DataContext="{x:Static mocks:DesignData.UpscalerCardViewModel}" />
1 year ago
<controls:UpscalerCard
DataContext="{x:Static mocks:DesignData.UpscalerCardViewModel}" />
</StackPanel>
</Grid>
</Design.PreviewWith>
1 year ago
<Style Selector="controls|UpscalerCard">
1 year ago
<!-- Set Defaults -->
<Setter Property="Template">
<ControlTemplate>
1 year ago
<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">
1 year ago
<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>
1 year ago
<Slider
Minimum="1"
Maximum="4"
Value="{Binding Scale}"
1 year ago
IsSnapToTickEnabled="True"
TickFrequency="0.5"
TickPlacement="BottomRight"/>
</StackPanel>
1 year ago
</StackPanel>
</controls:Card>
</ControlTemplate>
</Setter>
</Style>
</Styles>