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.
218 lines
10 KiB
218 lines
10 KiB
<controls:UserControlBase |
|
x:Class="StabilityMatrix.Avalonia.Views.InferencePage" |
|
xmlns="https://github.com/avaloniaui" |
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
|
xmlns:avaloniaEdit="clr-namespace:AvaloniaEdit;assembly=AvaloniaEdit" |
|
xmlns:controls="clr-namespace:StabilityMatrix.Avalonia.Controls" |
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" |
|
xmlns:icons="clr-namespace:Projektanker.Icons.Avalonia;assembly=Projektanker.Icons.Avalonia" |
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" |
|
xmlns:mocks="clr-namespace:StabilityMatrix.Avalonia.DesignData" |
|
xmlns:system="clr-namespace:System;assembly=System.Runtime" |
|
xmlns:ui="using:FluentAvalonia.UI.Controls" |
|
xmlns:vm="clr-namespace:StabilityMatrix.Avalonia.ViewModels" |
|
d:DataContext="{x:Static mocks:DesignData.InferenceViewModel}" |
|
d:DesignHeight="650" |
|
d:DesignWidth="1000" |
|
x:DataType="vm:InferenceViewModel" |
|
mc:Ignorable="d"> |
|
<Grid> |
|
<TextBlock |
|
Margin="0,8,16,0" |
|
HorizontalAlignment="Right" |
|
VerticalAlignment="Top" |
|
Text="Inference" |
|
Theme="{DynamicResource SubtitleTextBlockStyle}" /> |
|
|
|
<ui:TabView |
|
Grid.Row="0" |
|
VerticalAlignment="Stretch" |
|
CanReorderTabs="True" |
|
CloseButtonOverlayMode="Always" |
|
TabStripFooter="" |
|
TabStripHeader="" |
|
TabWidthMode="SizeToContent"> |
|
<ui:TabViewItem Header="Project 1" IconSource="Document"> |
|
<Grid |
|
Margin="16,8,16,32" |
|
ColumnDefinitions="*,Auto,*,Auto,*" |
|
RowDefinitions="*,Auto"> |
|
|
|
<!-- Controls --> |
|
<ScrollViewer |
|
Margin="8,8,8,16" |
|
HorizontalAlignment="Stretch" |
|
VerticalAlignment="Stretch"> |
|
<StackPanel Spacing="8"> |
|
<!-- Checkpoint --> |
|
<controls:Card Padding="8"> |
|
<Grid Margin="8" ColumnDefinitions="Auto,*,Auto"> |
|
<TextBlock |
|
Grid.Column="0" |
|
Margin="0,0,8,0" |
|
VerticalAlignment="Center" |
|
Text="Model" /> |
|
<ComboBox Grid.Column="1" HorizontalAlignment="Stretch" /> |
|
<!--<ComboBox |
|
DisplayMemberPath="FileName" |
|
Grid.Column="1" |
|
ItemsSource="{Binding DiffusionCheckpointFolder.CheckpointFiles}" |
|
Margin="8" |
|
MinWidth="200" |
|
SelectedValuePath="FileName" />--> |
|
<Button Grid.Column="2" Margin="8,0,0,0"> |
|
<ui:SymbolIcon FontSize="16" Symbol="Settings" /> |
|
</Button> |
|
</Grid> |
|
</controls:Card> |
|
<!-- Samplers and steps --> |
|
<controls:Card Padding="8"> |
|
<StackPanel Margin="8"> |
|
<Grid ColumnDefinitions="Auto,*,Auto,Auto"> |
|
<TextBlock |
|
Grid.Column="0" |
|
Margin="0,0,8,0" |
|
VerticalAlignment="Center" |
|
Text="Sampler" /> |
|
<ComboBox Grid.Column="1" HorizontalAlignment="Stretch" /> |
|
<TextBlock |
|
Grid.Column="2" |
|
Margin="16,0,8,0" |
|
VerticalAlignment="Center" |
|
Text="Steps" /> |
|
<TextBox Grid.Column="3" /> |
|
</Grid> |
|
|
|
<Slider |
|
IsSnapToTickEnabled="True" |
|
Maximum="150" |
|
Minimum="0" |
|
TickFrequency="10" |
|
TickPlacement="BottomRight" /> |
|
</StackPanel> |
|
</controls:Card> |
|
|
|
<controls:SeedCard DataContext="{Binding SeedCardViewModel}" /> |
|
|
|
</StackPanel> |
|
</ScrollViewer> |
|
|
|
<GridSplitter |
|
Grid.Row="0" |
|
Grid.Column="1" |
|
Background="{DynamicResource ScrollBarTrackStroke}"/> |
|
|
|
<!-- Prompt card --> |
|
<controls:Card |
|
Grid.Row="0" |
|
Grid.Column="2" |
|
Margin="8,8,8,16" |
|
VerticalAlignment="Stretch" |
|
VerticalContentAlignment="Stretch" |
|
Padding="8"> |
|
<Grid RowDefinitions="*,*,Auto" Margin="4,8"> |
|
<StackPanel Spacing="4"> |
|
<TextBlock |
|
Margin="2" |
|
FontSize="14" |
|
Text="Prompt" /> |
|
<avaloniaEdit:TextEditor |
|
x:Name="PromptEditor" |
|
Margin="8" |
|
FontFamily="Cascadia Code,Consolas,Menlo,Monospace" |
|
LineNumbersForeground="DarkSlateGray" |
|
ShowLineNumbers="True" |
|
VerticalScrollBarVisibility="Auto" |
|
WordWrap="True" /> |
|
</StackPanel> |
|
<StackPanel Grid.Row="1" Spacing="4"> |
|
<TextBlock |
|
Margin="2" |
|
FontSize="14" |
|
Text="Negative Prompt" /> |
|
<avaloniaEdit:TextEditor |
|
x:Name="NegativePromptEditor" |
|
Margin="8" |
|
FontFamily="Cascadia Code,Consolas,Menlo,Monospace" |
|
LineNumbersForeground="DarkSlateGray" |
|
ShowLineNumbers="True" |
|
VerticalScrollBarVisibility="Auto" |
|
WordWrap="True" /> |
|
</StackPanel> |
|
<Button |
|
Grid.Row="2" |
|
HorizontalAlignment="Center" |
|
Classes="accent" |
|
Content="Generate Image" /> |
|
</Grid> |
|
</controls:Card> |
|
|
|
<GridSplitter |
|
Grid.Row="0" |
|
Grid.Column="3" |
|
Background="{DynamicResource ScrollBarTrackStroke}"/> |
|
|
|
<!-- Image Viewer --> |
|
<controls:Card |
|
Grid.Row="0" |
|
Grid.Column="4" |
|
Margin="8,8,8,16" |
|
Padding="8" |
|
HorizontalAlignment="Stretch" |
|
VerticalAlignment="Top"> |
|
<Grid RowDefinitions="0.2*,0.7*"> |
|
<StackPanel |
|
Grid.Row="0" |
|
VerticalAlignment="Top" |
|
Orientation="Vertical"> |
|
<TextBlock |
|
Margin="2" |
|
FontSize="14" |
|
Text="Image" /> |
|
<!--<ProgressBar |
|
Maximum="100" |
|
Value="{Binding ProgressValue, FallbackValue=10}" |
|
Visibility="{Binding ProgressBarVisibility, FallbackValue=Visible}" |
|
Width="500" />--> |
|
</StackPanel> |
|
<Grid |
|
Grid.Row="1" |
|
MinHeight="512" |
|
VerticalAlignment="Stretch" |
|
Background="{DynamicResource ApplicationBackgroundBrush}"> |
|
<!--<controls:ProgressRing |
|
Background="DarkRed" |
|
Grid.Row="0" |
|
Height="72" |
|
HorizontalAlignment="Center" |
|
IsIndeterminate="True" |
|
Margin="8" |
|
VerticalAlignment="Center" |
|
Visibility="{Binding ProgressRingVisibility, FallbackValue=Collapsed}" |
|
Width="72" |
|
x:Name="ImageProgressRing" />--> |
|
<!--<Image |
|
HorizontalAlignment="Stretch" |
|
Margin="8" |
|
Source="{Binding ImagePreview}" |
|
Stretch="Uniform" |
|
VerticalAlignment="Stretch" |
|
Visibility="{Binding ImagePreviewVisibility, FallbackValue=Visible}" />--> |
|
</Grid> |
|
</Grid> |
|
</controls:Card> |
|
|
|
<!--<Button |
|
Classes="accent" |
|
Command="{Binding TextToImageGenerateCommand}" |
|
Content="Generate Image" |
|
Grid.Row="1" |
|
HorizontalAlignment="Center" |
|
Name="TextToImageButton" />--> |
|
|
|
</Grid> |
|
</ui:TabViewItem> |
|
<ui:TabViewItem Header="Project 2" IconSource="Document" /> |
|
</ui:TabView> |
|
</Grid> |
|
</controls:UserControlBase>
|
|
|