|
|
|
<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>
|
|
|
|
<StackPanel MinWidth="350" Spacing="16">
|
|
|
|
<controls:SamplerCard DataContext="{x:Static mocks:DesignData.SamplerCardViewModel}"/>
|
|
|
|
<controls:SamplerCard DataContext="{x:Static mocks:DesignData.SamplerCardViewModelScaleMode}"/>
|
|
|
|
</StackPanel>
|
|
|
|
</Design.PreviewWith>
|
|
|
|
|
|
|
|
<Style Selector="controls|SamplerCard">
|
|
|
|
<Setter Property="HorizontalAlignment" Value="Stretch"/>
|
|
|
|
<Setter Property="Template">
|
|
|
|
<ControlTemplate>
|
|
|
|
<controls:Card
|
|
|
|
HorizontalAlignment="{TemplateBinding HorizontalAlignment}" >
|
|
|
|
<StackPanel
|
|
|
|
HorizontalAlignment="{TemplateBinding HorizontalAlignment}"
|
|
|
|
Spacing="8">
|
|
|
|
<Grid ColumnDefinitions="Auto,*" RowDefinitions="*,*,*">
|
|
|
|
<!-- Sampler -->
|
|
|
|
<TextBlock
|
|
|
|
Grid.Row="0"
|
|
|
|
Grid.Column="0"
|
|
|
|
IsVisible="{Binding IsSamplerSelectionEnabled}"
|
|
|
|
Margin="0,0,0,8"
|
|
|
|
VerticalAlignment="Center"
|
|
|
|
Text="Sampler" />
|
|
|
|
<ui:FAComboBox
|
|
|
|
Grid.Row="0"
|
|
|
|
Grid.Column="1"
|
|
|
|
IsVisible="{Binding IsSamplerSelectionEnabled}"
|
|
|
|
ItemsSource="{Binding ClientManager.Samplers}"
|
|
|
|
SelectedItem="{Binding SelectedSampler}"
|
|
|
|
DisplayMemberBinding="{Binding DisplayName}"
|
|
|
|
Margin="8,0,0,8"
|
|
|
|
HorizontalAlignment="Stretch"/>
|
|
|
|
<!-- Steps -->
|
|
|
|
<TextBlock
|
|
|
|
Grid.Row="1"
|
|
|
|
Grid.Column="0"
|
|
|
|
Margin="0,0,0,8"
|
|
|
|
VerticalAlignment="Center"
|
|
|
|
Text="Steps" />
|
|
|
|
<ui:NumberBox
|
|
|
|
Grid.Row="1"
|
|
|
|
Grid.Column="1"
|
|
|
|
SelectionHighlightColor="Transparent"
|
|
|
|
Value="{Binding Steps}"
|
|
|
|
Margin="8,0,0,8"
|
|
|
|
HorizontalAlignment="Stretch"
|
|
|
|
SpinButtonPlacementMode="Inline"/>
|
|
|
|
<!-- CFG Scale -->
|
|
|
|
<TextBlock
|
|
|
|
Grid.Row="2"
|
|
|
|
Grid.Column="0"
|
|
|
|
IsVisible="{Binding IsCfgScaleEnabled}"
|
|
|
|
VerticalAlignment="Center"
|
|
|
|
Text="CFG Scale" />
|
|
|
|
<ui:NumberBox
|
|
|
|
Grid.Row="2"
|
|
|
|
Grid.Column="1"
|
|
|
|
IsVisible="{Binding IsCfgScaleEnabled}"
|
|
|
|
SelectionHighlightColor="Transparent"
|
|
|
|
Value="{Binding CfgScale}"
|
|
|
|
Margin="8,0,0,0"
|
|
|
|
SimpleNumberFormat="F2"
|
|
|
|
SmallChange="0.25"
|
|
|
|
HorizontalAlignment="Stretch"
|
|
|
|
SpinButtonPlacementMode="Inline"/>
|
|
|
|
</Grid>
|
|
|
|
|
|
|
|
<StackPanel>
|
|
|
|
<!-- Denoise Strength -->
|
|
|
|
<StackPanel IsVisible="{Binding IsDenoiseStrengthEnabled}">
|
|
|
|
<Grid ColumnDefinitions="*,Auto">
|
|
|
|
<TextBlock
|
|
|
|
VerticalAlignment="Center"
|
|
|
|
Text="Denoising Strength"/>
|
|
|
|
<ui:NumberBox
|
|
|
|
Grid.Column="1"
|
|
|
|
Margin="4,0,0,0"
|
|
|
|
ValidationMode="InvalidInputOverwritten"
|
|
|
|
SmallChange="0.01"
|
|
|
|
SimpleNumberFormat="F2"
|
|
|
|
Value="{Binding DenoiseStrength}"
|
|
|
|
HorizontalAlignment="Stretch"
|
|
|
|
MinWidth="70"
|
|
|
|
SpinButtonPlacementMode="Compact"/>
|
|
|
|
</Grid>
|
|
|
|
<Slider
|
|
|
|
Minimum="0"
|
|
|
|
Maximum="1"
|
|
|
|
Value="{Binding DenoiseStrength}"
|
|
|
|
TickFrequency="1"
|
|
|
|
Margin="0,0,0,-4"
|
|
|
|
TickPlacement="BottomRight"/>
|
|
|
|
</StackPanel>
|
|
|
|
|
|
|
|
<!-- Dimensions (Absolute) -->
|
|
|
|
<Grid
|
|
|
|
IsVisible="{Binding IsDimensionsEnabled}"
|
|
|
|
Margin="0,4,0,0"
|
|
|
|
ColumnDefinitions="*,Auto,*"
|
|
|
|
RowDefinitions="Auto,*">
|
|
|
|
<TextBlock
|
|
|
|
Grid.Row="0"
|
|
|
|
Grid.Column="0"
|
|
|
|
Margin="0,0,4,4"
|
|
|
|
Text="Width"/>
|
|
|
|
<ui:NumberBox
|
|
|
|
Grid.Row="1"
|
|
|
|
Grid.Column="0"
|
|
|
|
Margin="0,0,4,0"
|
|
|
|
PlaceholderText="128"
|
|
|
|
SmallChange="128"
|
|
|
|
ValidationMode="InvalidInputOverwritten"
|
|
|
|
Value="{Binding Width}"
|
|
|
|
HorizontalAlignment="Stretch"
|
|
|
|
SpinButtonPlacementMode="Compact"/>
|
|
|
|
<TextBlock
|
|
|
|
Grid.Row="0"
|
|
|
|
Grid.Column="2"
|
|
|
|
Margin="4,0,0,4"
|
|
|
|
Text="Height"/>
|
|
|
|
<ui:NumberBox
|
|
|
|
Grid.Row="1"
|
|
|
|
Grid.Column="2"
|
|
|
|
Margin="4,0,0,0"
|
|
|
|
PlaceholderText="128"
|
|
|
|
SmallChange="128"
|
|
|
|
ValidationMode="InvalidInputOverwritten"
|
|
|
|
Value="{Binding Height}"
|
|
|
|
HorizontalAlignment="Stretch"
|
|
|
|
SpinButtonPlacementMode="Compact"/>
|
|
|
|
</Grid>
|
|
|
|
</StackPanel>
|
|
|
|
</StackPanel>
|
|
|
|
</controls:Card>
|
|
|
|
</ControlTemplate>
|
|
|
|
</Setter>
|
|
|
|
</Style>
|
|
|
|
</Styles>
|