|
|
|
<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"
|
|
|
|
xmlns:lang="clr-namespace:StabilityMatrix.Avalonia.Languages">
|
|
|
|
<Design.PreviewWith>
|
|
|
|
<StackPanel MinWidth="350" Spacing="16">
|
|
|
|
<controls:SamplerCard DataContext="{x:Static mocks:DesignData.SamplerCardViewModel}"/>
|
|
|
|
<controls:SamplerCard DataContext="{x:Static mocks:DesignData.SamplerCardViewModelScaleMode}"/>
|
|
|
|
<controls:SamplerCard DataContext="{x:Static mocks:DesignData.SamplerCardViewModelRefinerMode}"/>
|
|
|
|
</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,5,*" 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="2"
|
|
|
|
IsVisible="{Binding IsSamplerSelectionEnabled}"
|
|
|
|
ItemsSource="{Binding ClientManager.Samplers}"
|
|
|
|
SelectedItem="{Binding SelectedSampler}"
|
|
|
|
DisplayMemberBinding="{Binding DisplayName}"
|
|
|
|
Margin="8,0,0,8"
|
|
|
|
HorizontalAlignment="Stretch"/>
|
|
|
|
<!-- Scheduler -->
|
|
|
|
<TextBlock
|
|
|
|
Grid.Row="1"
|
|
|
|
Grid.Column="0"
|
|
|
|
IsVisible="{Binding IsSchedulerSelectionEnabled}"
|
|
|
|
Margin="0,0,0,8"
|
|
|
|
VerticalAlignment="Center"
|
|
|
|
Text="Scheduler" />
|
|
|
|
<ui:FAComboBox
|
|
|
|
Grid.Row="1"
|
|
|
|
Grid.Column="2"
|
|
|
|
IsVisible="{Binding IsSchedulerSelectionEnabled}"
|
|
|
|
ItemsSource="{Binding ClientManager.Schedulers}"
|
|
|
|
SelectedItem="{Binding SelectedScheduler}"
|
|
|
|
DisplayMemberBinding="{Binding DisplayName}"
|
|
|
|
Margin="8,0,0,8"
|
|
|
|
HorizontalAlignment="Stretch"/>
|
|
|
|
|
|
|
|
<!-- Steps (Normal) -->
|
|
|
|
<TextBlock
|
|
|
|
Grid.Row="2"
|
|
|
|
Grid.Column="0"
|
|
|
|
IsVisible="{Binding !IsRefinerStepsEnabled}"
|
|
|
|
Margin="0,0,0,8"
|
|
|
|
VerticalAlignment="Center"
|
|
|
|
Text="{x:Static lang:Resources.Label_Steps}" />
|
|
|
|
<TextBlock
|
|
|
|
Grid.Row="2"
|
|
|
|
Grid.Column="0"
|
|
|
|
IsVisible="{Binding IsRefinerStepsEnabled}"
|
|
|
|
Margin="0,0,0,8"
|
|
|
|
VerticalAlignment="Center"
|
|
|
|
Text="{x:Static lang:Resources.Label_StepsBase}" />
|
|
|
|
<ui:NumberBox
|
|
|
|
Grid.Row="2"
|
|
|
|
Grid.Column="2"
|
|
|
|
SelectionHighlightColor="Transparent"
|
|
|
|
Value="{Binding Steps}"
|
|
|
|
Margin="8,0,0,8"
|
|
|
|
HorizontalAlignment="Stretch"
|
|
|
|
SpinButtonPlacementMode="Inline"/>
|
|
|
|
|
|
|
|
<!-- Steps (Refiner) -->
|
|
|
|
<TextBlock
|
|
|
|
Grid.Row="3"
|
|
|
|
Grid.Column="0"
|
|
|
|
Margin="0,0,0,8"
|
|
|
|
VerticalAlignment="Center"
|
|
|
|
IsVisible="{Binding IsRefinerStepsEnabled}"
|
|
|
|
Text="{x:Static lang:Resources.Label_StepsRefiner}" />
|
|
|
|
<ui:NumberBox
|
|
|
|
Grid.Row="3"
|
|
|
|
Grid.Column="2"
|
|
|
|
SelectionHighlightColor="Transparent"
|
|
|
|
Value="{Binding RefinerSteps}"
|
|
|
|
Margin="8,0,0,8"
|
|
|
|
HorizontalAlignment="Stretch"
|
|
|
|
IsVisible="{Binding IsRefinerStepsEnabled}"
|
|
|
|
SpinButtonPlacementMode="Inline"/>
|
|
|
|
|
|
|
|
<!-- CFG Scale -->
|
|
|
|
<TextBlock
|
|
|
|
Grid.Row="4"
|
|
|
|
Grid.Column="0"
|
|
|
|
IsVisible="{Binding IsCfgScaleEnabled}"
|
|
|
|
VerticalAlignment="Center"
|
|
|
|
Text="{x:Static lang:Resources.Label_CFGScale}" />
|
|
|
|
<ui:NumberBox
|
|
|
|
Grid.Row="4"
|
|
|
|
Grid.Column="2"
|
|
|
|
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="{x:Static lang:Resources.Label_DenoisingStrength}"/>
|
|
|
|
<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="{x:Static lang:Resources.Label_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="{x:Static lang:Resources.Label_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>
|