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.
 
 
 

107 lines
5.3 KiB

<Styles xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:vmInference="using:StabilityMatrix.Avalonia.ViewModels.Inference"
xmlns:controls="using:StabilityMatrix.Avalonia.Controls"
xmlns:ui="clr-namespace:FluentAvalonia.UI.Controls;assembly=FluentAvalonia"
x:DataType="vmInference:SamplerCardViewModel"
xmlns:mocks="clr-namespace:StabilityMatrix.Avalonia.DesignData">
<Design.PreviewWith>
<Grid MinWidth="300">
<controls:SamplerCard DataContext="{x:Static mocks:DesignData.SamplerCardViewModel}"/>
</Grid>
</Design.PreviewWith>
<Style Selector="controls|SamplerCard">
<Setter Property="HorizontalAlignment" Value="Stretch"/>
<Setter Property="Template">
<ControlTemplate>
<controls:Card Padding="8" HorizontalAlignment="{TemplateBinding HorizontalAlignment}">
<StackPanel Margin="8" Spacing="8">
<Grid ColumnDefinitions="Auto,*" RowDefinitions="*,*,*">
<TextBlock
Grid.Row="0"
Grid.Column="0"
Margin="0,0,0,8"
VerticalAlignment="Center"
Text="Sampler" />
<ui:FAComboBox
Grid.Row="0"
Grid.Column="1"
IsEditable="True"
ItemsSource="{Binding ClientManager.Samplers}"
SelectedItem="{Binding SelectedSampler, Mode=TwoWay}"
Margin="8,0,0,8"
HorizontalAlignment="Stretch"/>
<TextBlock
Grid.Row="1"
Grid.Column="0"
Margin="0,0,0,8"
VerticalAlignment="Center"
Text="Steps" />
<ui:NumberBox
Grid.Row="1"
Grid.Column="1"
Value="{Binding Steps}"
Margin="8,0,0,8"
HorizontalAlignment="Stretch"
SpinButtonPlacementMode="Inline"/>
<TextBlock
Grid.Row="2"
Grid.Column="0"
VerticalAlignment="Center"
Text="CFG Scale" />
<ui:NumberBox
Grid.Row="2"
Grid.Column="1"
Value="{Binding CfgScale}"
Margin="8,0,0,0"
SimpleNumberFormat="F2"
SmallChange="0.25"
HorizontalAlignment="Stretch"
SpinButtonPlacementMode="Inline"/>
</Grid>
<StackPanel>
<Grid ColumnDefinitions="*,*,*" RowDefinitions="Auto,*">
<TextBlock
Text="Width" />
<Slider
Grid.Row="1"
Grid.Column="0"
Grid.ColumnSpan="2"
Minimum="0"
Maximum="2048"
Value="{Binding Width}"/>
<ui:NumberBox
Grid.Row="1"
Grid.Column="2"
Value="{Binding Width}"
HorizontalAlignment="Right"
VerticalAlignment="Center"
SpinButtonPlacementMode="Compact"/>
</Grid>
<Grid ColumnDefinitions="*,*,*" RowDefinitions="Auto,*">
<TextBlock
Text="Height" />
<Slider
Grid.Row="1"
Grid.Column="0"
Grid.ColumnSpan="2"
Minimum="0"
Maximum="2048"
Value="{Binding Height}"/>
<ui:NumberBox
Grid.Row="1"
Grid.Column="2"
Value="{Binding Height}"
HorizontalAlignment="Right"
VerticalAlignment="Center"
SpinButtonPlacementMode="Compact"/>
</Grid>
</StackPanel>
</StackPanel>
</controls:Card>
</ControlTemplate>
</Setter>
</Style>
</Styles>