|
|
|
<controls:UserControlBase
|
|
|
|
x:Class="StabilityMatrix.Avalonia.Views.InferenceTextToImageView"
|
|
|
|
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: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"
|
|
|
|
xmlns:vmInference="using:StabilityMatrix.Avalonia.ViewModels.Inference"
|
|
|
|
d:DataContext="{x:Static mocks:DesignData.InferenceTextToImageViewModel}"
|
|
|
|
d:DesignHeight="600"
|
|
|
|
d:DesignWidth="1000"
|
|
|
|
x:DataType="vmInference:InferenceTextToImageViewModel"
|
|
|
|
mc:Ignorable="d">
|
|
|
|
<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" />
|
|
|
|
<ui:FAComboBox
|
|
|
|
SelectedItem="{Binding SelectedModelName, Mode=TwoWay}"
|
|
|
|
IsEditable="True"
|
|
|
|
Grid.Column="1"
|
|
|
|
HorizontalAlignment="Stretch" />
|
|
|
|
<Button Grid.Column="2" Margin="8,0,0,0">
|
|
|
|
<ui:SymbolIcon FontSize="16" Symbol="Settings" />
|
|
|
|
</Button>
|
|
|
|
</Grid>
|
|
|
|
</controls:Card>
|
|
|
|
<!-- Samplers and steps -->
|
|
|
|
<controls:SamplerCard DataContext="{Binding SamplerCardViewModel}" />
|
|
|
|
<!-- Seed -->
|
|
|
|
<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"
|
|
|
|
Padding="8"
|
|
|
|
VerticalAlignment="Stretch"
|
|
|
|
VerticalContentAlignment="Stretch">
|
|
|
|
<Grid Margin="4,8" RowDefinitions="*,*,Auto">
|
|
|
|
<StackPanel Spacing="4">
|
|
|
|
<TextBlock
|
|
|
|
Margin="2"
|
|
|
|
FontSize="14"
|
|
|
|
Text="Prompt" />
|
|
|
|
<avaloniaEdit:TextEditor
|
|
|
|
x:Name="PromptEditor"
|
|
|
|
Document="{Binding PromptDocument}"
|
|
|
|
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"
|
|
|
|
Document="{Binding NegativePromptDocument}"
|
|
|
|
Margin="8"
|
|
|
|
FontFamily="Cascadia Code,Consolas,Menlo,Monospace"
|
|
|
|
LineNumbersForeground="DarkSlateGray"
|
|
|
|
ShowLineNumbers="True"
|
|
|
|
VerticalScrollBarVisibility="Auto"
|
|
|
|
WordWrap="True" />
|
|
|
|
</StackPanel>
|
|
|
|
<Grid
|
|
|
|
Grid.Row="2"
|
|
|
|
HorizontalAlignment="Center"
|
|
|
|
RowDefinitions="Auto,*">
|
|
|
|
<ProgressBar
|
|
|
|
Grid.Row="0"
|
|
|
|
VerticalAlignment="Bottom"
|
|
|
|
IsVisible="False" />
|
|
|
|
<Button
|
|
|
|
Grid.Row="1"
|
|
|
|
Command="{Binding GenerateImageCommand}"
|
|
|
|
HorizontalAlignment="Stretch"
|
|
|
|
Classes="accent"
|
|
|
|
Content="Generate Image" />
|
|
|
|
</Grid>
|
|
|
|
</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"
|
|
|
|
RowDefinitions="Auto,*"
|
|
|
|
Background="{DynamicResource ApplicationBackgroundBrush}">
|
|
|
|
<ProgressBar
|
|
|
|
Value="{Binding ProgressCurrent}"
|
|
|
|
Maximum="{Binding ProgressMax}"/>
|
|
|
|
<controls:BetterAdvancedImage
|
|
|
|
Grid.Row="1"
|
|
|
|
HorizontalAlignment="Stretch"
|
|
|
|
CornerRadius="8"
|
|
|
|
Margin="8"
|
|
|
|
Source="{Binding OutputImageSource}"
|
|
|
|
Stretch="Uniform"
|
|
|
|
VerticalAlignment="Stretch"/>
|
|
|
|
</Grid>
|
|
|
|
</Grid>
|
|
|
|
</controls:Card>
|
|
|
|
|
|
|
|
<!--<Button
|
|
|
|
Classes="accent"
|
|
|
|
Command="{Binding TextToImageGenerateCommand}"
|
|
|
|
Content="Generate Image"
|
|
|
|
Grid.Row="1"
|
|
|
|
HorizontalAlignment="Center"
|
|
|
|
Name="TextToImageButton" />-->
|
|
|
|
|
|
|
|
</Grid>
|
|
|
|
</controls:UserControlBase>
|