|
|
|
@ -2,91 +2,89 @@
|
|
|
|
|
xmlns="https://github.com/avaloniaui" |
|
|
|
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
|
|
|
|
xmlns:controls="using:StabilityMatrix.Avalonia.Controls" |
|
|
|
|
xmlns:extensions="clr-namespace:StabilityMatrix.Avalonia.Controls.Extensions" |
|
|
|
|
xmlns:fluentIcons="clr-namespace:FluentIcons.FluentAvalonia;assembly=FluentIcons.FluentAvalonia" |
|
|
|
|
xmlns:input="clr-namespace:FluentAvalonia.UI.Input;assembly=FluentAvalonia" |
|
|
|
|
xmlns:lang="clr-namespace:StabilityMatrix.Avalonia.Languages" |
|
|
|
|
xmlns:mocks="clr-namespace:StabilityMatrix.Avalonia.DesignData" |
|
|
|
|
xmlns:models="clr-namespace:StabilityMatrix.Core.Models;assembly=StabilityMatrix.Core" |
|
|
|
|
xmlns:sg="clr-namespace:SpacedGridControl.Avalonia;assembly=SpacedGridControl.Avalonia" |
|
|
|
|
xmlns:ui="clr-namespace:FluentAvalonia.UI.Controls;assembly=FluentAvalonia" |
|
|
|
|
xmlns:vmInference="clr-namespace:StabilityMatrix.Avalonia.ViewModels.Inference" |
|
|
|
|
xmlns:input="clr-namespace:FluentAvalonia.UI.Input;assembly=FluentAvalonia" |
|
|
|
|
xmlns:fluentIcons="clr-namespace:FluentIcons.FluentAvalonia;assembly=FluentIcons.FluentAvalonia" |
|
|
|
|
x:DataType="vmInference:ControlNetCardViewModel"> |
|
|
|
|
<Design.PreviewWith> |
|
|
|
|
<StackPanel Width="350" Height="400"> |
|
|
|
|
<StackPanel Width="400" Height="500"> |
|
|
|
|
<controls:ControlNetCard DataContext="{x:Static mocks:DesignData.ControlNetCardViewModel}" /> |
|
|
|
|
</StackPanel> |
|
|
|
|
</Design.PreviewWith> |
|
|
|
|
|
|
|
|
|
<Styles.Resources> |
|
|
|
|
<ToolTip x:Key="WipFeatureToolTip"> |
|
|
|
|
<StackPanel> |
|
|
|
|
<TextBlock Text="{x:Static lang:Resources.Label_WipFeature}" Theme="{DynamicResource BodyStrongTextBlockStyle}" /> |
|
|
|
|
<TextBlock Foreground="{DynamicResource TextFillColorTertiaryBrush}" Text="{x:Static lang:Resources.Label_WipFeatureDescription}" /> |
|
|
|
|
</StackPanel> |
|
|
|
|
</ToolTip> |
|
|
|
|
</Styles.Resources> |
|
|
|
|
|
|
|
|
|
<Style Selector="controls|ControlNetCard"> |
|
|
|
|
<!-- Set Defaults --> |
|
|
|
|
<Setter Property="Template"> |
|
|
|
|
<ControlTemplate> |
|
|
|
|
<controls:Card Padding="12"> |
|
|
|
|
<sg:SpacedGrid |
|
|
|
|
ColumnDefinitions="0.8*,*" |
|
|
|
|
ColumnSpacing="8" |
|
|
|
|
RowDefinitions="Auto,Auto,Auto,Auto,5,Auto" |
|
|
|
|
RowSpacing="6"> |
|
|
|
|
<StackPanel Spacing="6"> |
|
|
|
|
<sg:SpacedGrid |
|
|
|
|
ColumnDefinitions="0.34*,0.65*" |
|
|
|
|
ColumnSpacing="8" |
|
|
|
|
RowDefinitions="Auto,Auto,Auto" |
|
|
|
|
RowSpacing="4"> |
|
|
|
|
|
|
|
|
|
<!-- Image Select --> |
|
|
|
|
<controls:SelectImageCard |
|
|
|
|
Grid.RowSpan="4" |
|
|
|
|
Padding="6" |
|
|
|
|
DataContext="{Binding SelectImageCardViewModel}" |
|
|
|
|
FontSize="13" /> |
|
|
|
|
<!-- Image Select --> |
|
|
|
|
<controls:SelectImageCard |
|
|
|
|
Grid.RowSpan="2" |
|
|
|
|
Padding="6" |
|
|
|
|
VerticalAlignment="Stretch" |
|
|
|
|
DataContext="{Binding SelectImageCardViewModel}" |
|
|
|
|
FontSize="13" /> |
|
|
|
|
|
|
|
|
|
<!-- TODO: Preprocessor Model --> |
|
|
|
|
<TextBlock |
|
|
|
|
Grid.Row="0" |
|
|
|
|
Grid.Column="1" |
|
|
|
|
MinWidth="60" |
|
|
|
|
Foreground="{StaticResource ThemeGreyColor}" |
|
|
|
|
VerticalAlignment="Bottom" |
|
|
|
|
Text="{x:Static lang:Resources.Label_Preprocessor}" |
|
|
|
|
TextAlignment="Left" /> |
|
|
|
|
<ui:FAComboBox |
|
|
|
|
Grid.Row="1" |
|
|
|
|
Grid.Column="1" |
|
|
|
|
IsEnabled="False" |
|
|
|
|
Margin="0,0,0,4" |
|
|
|
|
HorizontalAlignment="Stretch" |
|
|
|
|
Theme="{StaticResource FAComboBoxHybridModelTheme}" /> |
|
|
|
|
<!-- TODO: Preprocessor Model --> |
|
|
|
|
<ui:FAComboBox |
|
|
|
|
Grid.Row="0" |
|
|
|
|
Grid.Column="1" |
|
|
|
|
Margin="0,0,0,4" |
|
|
|
|
HorizontalAlignment="Stretch" |
|
|
|
|
extensions:ShowDisabledTooltipExtension.ShowOnDisabled="True" |
|
|
|
|
Header="{x:Static lang:Resources.Label_Preprocessor}" |
|
|
|
|
IsEnabled="False" |
|
|
|
|
Theme="{StaticResource FAComboBoxHybridModelTheme}" |
|
|
|
|
ToolTip.ShowDelay="1200" |
|
|
|
|
ToolTip.Tip="{StaticResource WipFeatureToolTip}" /> |
|
|
|
|
|
|
|
|
|
<!-- ControlNet Model --> |
|
|
|
|
<TextBlock |
|
|
|
|
Grid.Row="2" |
|
|
|
|
Grid.Column="1" |
|
|
|
|
MinWidth="60" |
|
|
|
|
VerticalAlignment="Bottom" |
|
|
|
|
Text="{x:Static lang:Resources.Label_Model}" |
|
|
|
|
TextAlignment="Left" /> |
|
|
|
|
<ui:FAComboBox |
|
|
|
|
x:Name="PART_ModelComboBox" |
|
|
|
|
Grid.Row="3" |
|
|
|
|
Grid.Column="1" |
|
|
|
|
HorizontalAlignment="Stretch" |
|
|
|
|
ItemsSource="{Binding ClientManager.ControlNetModels}" |
|
|
|
|
SelectedItem="{Binding SelectedModel}" |
|
|
|
|
ItemContainerTheme="{StaticResource FAComboBoxItemHybridModelTheme}"> |
|
|
|
|
|
|
|
|
|
<ui:FAComboBox.Resources> |
|
|
|
|
<input:StandardUICommand |
|
|
|
|
x:Key="RemoteDownloadCommand" |
|
|
|
|
Command="{Binding RemoteDownloadCommand}"/> |
|
|
|
|
<!-- ControlNet Model --> |
|
|
|
|
<ui:FAComboBox |
|
|
|
|
x:Name="PART_ModelComboBox" |
|
|
|
|
Grid.Row="1" |
|
|
|
|
Grid.Column="1" |
|
|
|
|
HorizontalAlignment="Stretch" |
|
|
|
|
Header="{x:Static lang:Resources.Label_Model}" |
|
|
|
|
ItemContainerTheme="{StaticResource FAComboBoxItemHybridModelTheme}" |
|
|
|
|
ItemsSource="{Binding ClientManager.ControlNetModels}" |
|
|
|
|
SelectedItem="{Binding SelectedModel}"> |
|
|
|
|
|
|
|
|
|
<ui:FAComboBox.Resources> |
|
|
|
|
<input:StandardUICommand x:Key="RemoteDownloadCommand" Command="{Binding RemoteDownloadCommand}" /> |
|
|
|
|
</ui:FAComboBox.Resources> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<ui:FAComboBox.DataTemplates> |
|
|
|
|
<controls:HybridModelTemplateSelector> |
|
|
|
|
<DataTemplate DataType="models:HybridModelFile" x:Key="{x:Static models:HybridModelType.Downloadable}"> |
|
|
|
|
<DataTemplate x:Key="{x:Static models:HybridModelType.Downloadable}" DataType="models:HybridModelFile"> |
|
|
|
|
<Grid ColumnDefinitions="*,Auto"> |
|
|
|
|
<TextBlock |
|
|
|
|
Text="{Binding ShortDisplayName}" |
|
|
|
|
Foreground="{DynamicResource ThemeGreyColor}"/> |
|
|
|
|
<Button |
|
|
|
|
Grid.Column="1" |
|
|
|
|
Classes="transparent-full" |
|
|
|
|
<TextBlock Foreground="{DynamicResource ThemeGreyColor}" Text="{Binding ShortDisplayName}" /> |
|
|
|
|
<Button |
|
|
|
|
Grid.Column="1" |
|
|
|
|
Margin="8,0,0,0" |
|
|
|
|
Padding="0"> |
|
|
|
|
Padding="0" |
|
|
|
|
Classes="transparent-full"> |
|
|
|
|
<fluentIcons:SymbolIcon |
|
|
|
|
VerticalAlignment="Center" |
|
|
|
|
FontSize="18" |
|
|
|
@ -96,117 +94,88 @@
|
|
|
|
|
</Button> |
|
|
|
|
</Grid> |
|
|
|
|
</DataTemplate> |
|
|
|
|
<DataTemplate DataType="models:HybridModelFile" x:Key="{x:Static models:HybridModelType.None}"> |
|
|
|
|
<TextBlock Text="{Binding ShortDisplayName}"/> |
|
|
|
|
<DataTemplate x:Key="{x:Static models:HybridModelType.None}" DataType="models:HybridModelFile"> |
|
|
|
|
<TextBlock Text="{Binding ShortDisplayName}" /> |
|
|
|
|
</DataTemplate> |
|
|
|
|
</controls:HybridModelTemplateSelector> |
|
|
|
|
</ui:FAComboBox.DataTemplates> |
|
|
|
|
|
|
|
|
|
</ui:FAComboBox> |
|
|
|
|
|
|
|
|
|
</ui:FAComboBox> |
|
|
|
|
|
|
|
|
|
</sg:SpacedGrid> |
|
|
|
|
<sg:SpacedGrid |
|
|
|
|
RowDefinitions="Auto,Auto,Auto,Auto" |
|
|
|
|
ColumnDefinitions="*,Auto,Auto" |
|
|
|
|
Grid.Row="5" |
|
|
|
|
Grid.Column="0" |
|
|
|
|
Grid.ColumnSpan="2"> |
|
|
|
|
RowDefinitions="Auto,Auto,Auto,Auto" |
|
|
|
|
RowSpacing="0"> |
|
|
|
|
<!-- Strength --> |
|
|
|
|
<TextBlock |
|
|
|
|
Text="{x:Static lang:Resources.Label_ControlWeight}" |
|
|
|
|
<TextBlock |
|
|
|
|
VerticalAlignment="Center" |
|
|
|
|
Text="{x:Static lang:Resources.Label_ControlWeight}" |
|
|
|
|
TextAlignment="Left" /> |
|
|
|
|
<ui:NumberBox |
|
|
|
|
Grid.Row="0" |
|
|
|
|
Grid.Column="1" |
|
|
|
|
Grid.ColumnSpan="2" |
|
|
|
|
HorizontalAlignment="Stretch" |
|
|
|
|
SpinButtonPlacementMode="Inline" |
|
|
|
|
Maximum="10" |
|
|
|
|
Minimum="0" |
|
|
|
|
SmallChange="0.01" |
|
|
|
|
SimpleNumberFormat="F2" |
|
|
|
|
SmallChange="0.01" |
|
|
|
|
SpinButtonPlacementMode="Inline" |
|
|
|
|
Value="{Binding Strength}" /> |
|
|
|
|
<Slider |
|
|
|
|
Grid.Row="1" |
|
|
|
|
Grid.Column="0" |
|
|
|
|
Grid.ColumnSpan="3" |
|
|
|
|
Margin="0,-8,0,0" |
|
|
|
|
IsSnapToTickEnabled="True" |
|
|
|
|
Maximum="1" |
|
|
|
|
Minimum="0" |
|
|
|
|
TickFrequency="0.01" |
|
|
|
|
IsSnapToTickEnabled="True" |
|
|
|
|
SmallChange="0.01" |
|
|
|
|
TickFrequency="0.01" |
|
|
|
|
Value="{Binding Strength}" /> |
|
|
|
|
|
|
|
|
|
<!-- Start end percent --> |
|
|
|
|
<TextBlock |
|
|
|
|
<TextBlock |
|
|
|
|
Grid.Row="2" |
|
|
|
|
Grid.Column="0" |
|
|
|
|
VerticalAlignment="Center" |
|
|
|
|
Text="{x:Static lang:Resources.Label_ControlSteps}" |
|
|
|
|
Text="{x:Static lang:Resources.Label_ControlSteps}" |
|
|
|
|
TextAlignment="Left" /> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<ui:NumberBox |
|
|
|
|
Grid.Row="2" |
|
|
|
|
Grid.Column="1" |
|
|
|
|
HorizontalAlignment="Stretch" |
|
|
|
|
SimpleNumberFormat="P0" |
|
|
|
|
Maximum="10" |
|
|
|
|
Minimum="0" |
|
|
|
|
SimpleNumberFormat="P0" |
|
|
|
|
SmallChange="0.01" |
|
|
|
|
Value="{Binding StartPercent}" /> |
|
|
|
|
<ui:NumberBox |
|
|
|
|
Grid.Row="2" |
|
|
|
|
Grid.Column="2" |
|
|
|
|
HorizontalAlignment="Stretch" |
|
|
|
|
SimpleNumberFormat="P0" |
|
|
|
|
Maximum="10" |
|
|
|
|
Minimum="0" |
|
|
|
|
SimpleNumberFormat="P0" |
|
|
|
|
SmallChange="0.01" |
|
|
|
|
Value="{Binding EndPercent}" /> |
|
|
|
|
|
|
|
|
|
<!--<sg:SpacedGrid Grid.Row="2" |
|
|
|
|
Grid.Column="1" |
|
|
|
|
HorizontalAlignment="Right" |
|
|
|
|
ColumnDefinitions="*,*"> |
|
|
|
|
<ui:NumberBox |
|
|
|
|
HorizontalAlignment="Stretch" |
|
|
|
|
Maximum="10" |
|
|
|
|
Minimum="0" |
|
|
|
|
SmallChange="0.01" |
|
|
|
|
Value="{Binding StartPercent}" /> |
|
|
|
|
<ui:NumberBox |
|
|
|
|
Grid.Column="1" |
|
|
|
|
HorizontalAlignment="Stretch" |
|
|
|
|
Maximum="10" |
|
|
|
|
Minimum="0" |
|
|
|
|
SmallChange="0.01" |
|
|
|
|
Value="{Binding EndPercent}" /> |
|
|
|
|
</sg:SpacedGrid>--> |
|
|
|
|
|
|
|
|
|
<ui:RangeSlider |
|
|
|
|
Grid.Row="3" |
|
|
|
|
Grid.Column="0" |
|
|
|
|
Grid.ColumnSpan="3" |
|
|
|
|
Margin="0,4,0,0" |
|
|
|
|
ShowValueToolTip="False" |
|
|
|
|
Maximum="1" |
|
|
|
|
Minimum="0" |
|
|
|
|
RangeEnd="{Binding EndPercent}" |
|
|
|
|
RangeStart="{Binding StartPercent}" |
|
|
|
|
ShowValueToolTip="False" |
|
|
|
|
StepFrequency="0.01" |
|
|
|
|
ToolTipStringFormat="P" /> |
|
|
|
|
</sg:SpacedGrid> |
|
|
|
|
|
|
|
|
|
<StackPanel |
|
|
|
|
Grid.Row="4" |
|
|
|
|
Grid.Column="0" |
|
|
|
|
Grid.ColumnSpan="2"> |
|
|
|
|
|
|
|
|
|
</StackPanel> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</sg:SpacedGrid> |
|
|
|
|
</StackPanel> |
|
|
|
|
</controls:Card> |
|
|
|
|
</ControlTemplate> |
|
|
|
|
</Setter> |
|
|
|
|