Browse Source

Add width and height to SamplerCard

pull/165/head
Ionite 1 year ago
parent
commit
e4602387a6
No known key found for this signature in database
  1. 53
      StabilityMatrix.Avalonia/Controls/SamplerCard.axaml
  2. 2
      StabilityMatrix.Avalonia/ViewModels/Inference/SamplerCardViewModel.cs

53
StabilityMatrix.Avalonia/Controls/SamplerCard.axaml

@ -60,21 +60,44 @@
SpinButtonPlacementMode="Inline"/> SpinButtonPlacementMode="Inline"/>
</Grid> </Grid>
<!--<Grid ColumnDefinitions="Auto,*,Auto,*"> <StackPanel>
<TextBlock <Grid ColumnDefinitions="*,*,*" RowDefinitions="Auto,*">
VerticalAlignment="Center" <TextBlock
Text="Steps" /> Text="Width" />
<ui:NumberBox <Slider
Grid.Column="1" Grid.Row="1"
SpinButtonPlacementMode="Compact"/> Grid.Column="0"
<TextBlock Grid.ColumnSpan="2"
Grid.Column="2" Minimum="0"
VerticalAlignment="Center" Maximum="2048"
Text="CFG Scale" /> Value="{Binding Width}"/>
<ui:NumberBox <ui:NumberBox
Grid.Column="3" Grid.Row="1"
SpinButtonPlacementMode="Compact"/> Grid.Column="2"
</Grid>--> 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> </StackPanel>
</controls:Card> </controls:Card>
</ControlTemplate> </ControlTemplate>

2
StabilityMatrix.Avalonia/ViewModels/Inference/SamplerCardViewModel.cs

@ -10,6 +10,8 @@ public partial class SamplerCardViewModel : ViewModelBase
{ {
[ObservableProperty] private int steps; [ObservableProperty] private int steps;
[ObservableProperty] private double cfgScale; [ObservableProperty] private double cfgScale;
[ObservableProperty] private int width;
[ObservableProperty] private int height;
[ObservableProperty] private string? selectedSampler; [ObservableProperty] private string? selectedSampler;
[ObservableProperty] private IReadOnlyList<string> samplers = new List<string>(); [ObservableProperty] private IReadOnlyList<string> samplers = new List<string>();

Loading…
Cancel
Save