Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
mohnjiles committed Apr 20, 2024
2 parents 805d3f6 + 5eaceaa commit e1a9202
Show file tree
Hide file tree
Showing 19 changed files with 209 additions and 51 deletions.
2 changes: 1 addition & 1 deletion Avalonia.Gif/Avalonia.Gif.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<EnableWindowsTargeting>true</EnableWindowsTargeting>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Avalonia" Version="11.0.10" />
<PackageReference Include="Avalonia" Version="$(AvaloniaVersion)" />
<PackageReference Include="SkiaSharp" Version="2.88.7" />
<PackageReference Include="DotNet.Bundle" Version="0.9.13" />
</ItemGroup>
Expand Down
11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,17 @@ All notable changes to Stability Matrix will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
and this project adheres to [Semantic Versioning 2.0](https://semver.org/spec/v2.0.0.html).

## v2.10.2
### Changed
- Updated translations for Spanish and Turkish
### Fixed
- Fixed more crashes when loading invalid connected model info files
- Fixed pip installs not parsing comments properly
- Fixed crash when sending input to a process that isn't running
- Fixed [#576](https://github.com/LykosAI/StabilityMatrix/issues/576) - drag & drop crashes on macOS & Linux
- Fixed [#594](https://github.com/LykosAI/StabilityMatrix/issues/594) - missing thumbnails in Inference model selector
- Downgraded Avalonia back to 11.0.9 to fix [#589](https://github.com/LykosAI/StabilityMatrix/issues/589) and possibly other rendering issues

## v2.10.1
### Added
- Added SVD Shared Model & Output Folders for Forge (fixes [#580](https://github.com/LykosAI/StabilityMatrix/issues/580))
Expand Down
5 changes: 5 additions & 0 deletions Directory.Build.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<Project>
<PropertyGroup>
<AvaloniaVersion>11.0.9</AvaloniaVersion>
</PropertyGroup>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Avalonia" Version="11.0.10" />
<PackageReference Include="Avalonia.Controls.DataGrid" Version="11.0.10" />
<PackageReference Include="Avalonia" Version="$(AvaloniaVersion)" />
<PackageReference Include="Avalonia.Controls.DataGrid" Version="$(AvaloniaVersion)" />
<PackageReference Include="DotNet.Bundle" Version="0.9.13" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="8.0.0" />
<PackageReference Include="Microsoft.Extensions.Hosting" Version="8.0.0" />
Expand Down
14 changes: 11 additions & 3 deletions StabilityMatrix.Avalonia/Extensions/DataObjectExtensions.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using Avalonia.Input;
using System.Runtime.InteropServices;
using Avalonia.Input;

namespace StabilityMatrix.Avalonia.Extensions;

Expand All @@ -9,9 +10,16 @@ public static class DataObjectExtensions
/// </summary>
public static T? GetContext<T>(this IDataObject dataObject)
{
if (dataObject.Get("Context") is T context)
try
{
return context;
if (dataObject.Get("Context") is T context)
{
return context;
}
}
catch (COMException)
{
return default;
}

return default;
Expand Down
54 changes: 54 additions & 0 deletions StabilityMatrix.Avalonia/Languages/Resources.es.resx
Original file line number Diff line number Diff line change
Expand Up @@ -1025,4 +1025,58 @@
<data name="Label_ModelBrowser" xml:space="preserve">
<value>Navegador de Modelos</value>
</data>
<data name="Label_Workflows" xml:space="preserve">
<value>Workflows</value>
</data>
<data name="Label_InfiniteScrolling" xml:space="preserve">
<value>Scroll Infinito</value>
</data>
<data name="Label_WorkflowBrowser" xml:space="preserve">
<value>Navegador de Workflows</value>
</data>
<data name="Action_OpenOnOpenArt" xml:space="preserve">
<value>Abrir en OpenArt</value>
</data>
<data name="Label_NodeDetails" xml:space="preserve">
<value>Detalles del Nodo</value>
</data>
<data name="Label_WorkflowDescription" xml:space="preserve">
<value>Descripción del Workflow</value>
</data>
<data name="Label_OpenArtBrowser" xml:space="preserve">
<value>Navegador OpenArt</value>
</data>
<data name="Action_PreviewPreprocessor" xml:space="preserve">
<value>Vista previa del Preprocesador</value>
</data>
<data name="TeachingTip_WebUiButtonMoved" xml:space="preserve">
<value>El botón &apos;Abrir interfaz de usuario web&apos; se ha movido a la barra de comandos</value>
</data>
<data name="Label_AnotherInstanceAlreadyRunning" xml:space="preserve">
<value>Ya se está ejecutando otra instancia de Stability Matrix. Ciérrelo antes de comenzar uno nuevo.</value>
</data>
<data name="Label_StabilityMatrixAlreadyRunning" xml:space="preserve">
<value>Stability Matrix ya se está ejecutando</value>
</data>
<data name="Label_WorkflowDeletedSuccessfully" xml:space="preserve">
<value>{0} eliminados correctamente</value>
</data>
<data name="Label_WorkflowDeleted" xml:space="preserve">
<value>Workflow Eliminado</value>
</data>
<data name="Label_ErrorRetrievingWorkflows" xml:space="preserve">
<value>Error al recuperar workflows</value>
</data>
<data name="TabLabel_InstalledWorkflows" xml:space="preserve">
<value>Workflows Instalados</value>
</data>
<data name="Label_WorkflowImported" xml:space="preserve">
<value>Workflow Importado</value>
</data>
<data name="Label_FinishedImportingWorkflow" xml:space="preserve">
<value>Terminada la importación del workflow y los nodos personalizados</value>
</data>
<data name="Label_WorkflowImportComplete" xml:space="preserve">
<value>Se han importado el workflow y los nodos personalizados.</value>
</data>
</root>
54 changes: 54 additions & 0 deletions StabilityMatrix.Avalonia/Languages/Resources.tr-TR.resx
Original file line number Diff line number Diff line change
Expand Up @@ -1021,4 +1021,58 @@
<data name="Label_ModelBrowser" xml:space="preserve">
<value>Model Tarayıcı</value>
</data>
<data name="Label_Workflows" xml:space="preserve">
<value>İş akışları</value>
</data>
<data name="Label_InfiniteScrolling" xml:space="preserve">
<value>Sonsuz Kaydırma</value>
</data>
<data name="Label_WorkflowBrowser" xml:space="preserve">
<value>İş Akışı Tarayıcısı</value>
</data>
<data name="Action_OpenOnOpenArt" xml:space="preserve">
<value>OpenArt&apos;ta aç</value>
</data>
<data name="Label_NodeDetails" xml:space="preserve">
<value>Düğüm Ayrıntıları</value>
</data>
<data name="Label_WorkflowDescription" xml:space="preserve">
<value>İş Akışı Açıklaması</value>
</data>
<data name="Label_OpenArtBrowser" xml:space="preserve">
<value>OpenArt Tarayıcı</value>
</data>
<data name="Action_PreviewPreprocessor" xml:space="preserve">
<value>Ön İşlemciyi Önizle</value>
</data>
<data name="TeachingTip_WebUiButtonMoved" xml:space="preserve">
<value>&apos;Web Kullanıcı Arayüzünü Aç&apos; düğmesi komut çubuğuna taşındı</value>
</data>
<data name="Label_AnotherInstanceAlreadyRunning" xml:space="preserve">
<value>Stability Matrixin başka bir örneği zaten çalışıyor. Yenisini başlatmadan önce lütfen kapatın.</value>
</data>
<data name="Label_StabilityMatrixAlreadyRunning" xml:space="preserve">
<value>Stability Matrix zaten çalışıyor</value>
</data>
<data name="Label_WorkflowDeletedSuccessfully" xml:space="preserve">
<value>{0} başarıyla silindi</value>
</data>
<data name="Label_WorkflowDeleted" xml:space="preserve">
<value>İş Akışı Silindi</value>
</data>
<data name="Label_ErrorRetrievingWorkflows" xml:space="preserve">
<value>İş akışları alınırken hata oluştu</value>
</data>
<data name="TabLabel_InstalledWorkflows" xml:space="preserve">
<value>Yüklü İş Akışları</value>
</data>
<data name="Label_WorkflowImported" xml:space="preserve">
<value>İş Akışı İçeri Aktarıldı</value>
</data>
<data name="Label_FinishedImportingWorkflow" xml:space="preserve">
<value>İş akışının ve özel düğümlerin içe aktarılması tamamlandı</value>
</data>
<data name="Label_WorkflowImportComplete" xml:space="preserve">
<value>İş akışı ve özel düğümler içe aktarıldı.</value>
</data>
</root>
38 changes: 19 additions & 19 deletions StabilityMatrix.Avalonia/StabilityMatrix.Avalonia.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -39,17 +39,17 @@
<PackageReference Include="AsyncImageLoader.Avalonia" Version="3.2.1" />
<PackageReference Include="AutoComplete.Net" Version="1.2211.2014.42"/>
<PackageReference Include="Avalonia.AvaloniaEdit" Version="11.0.6" />
<PackageReference Include="Avalonia.Controls.DataGrid" Version="11.0.10" />
<PackageReference Include="Avalonia.Controls.ItemsRepeater" Version="11.0.10" />
<PackageReference Include="Avalonia.Controls.PanAndZoom" Version="11.0.0.3" />
<PackageReference Include="Avalonia" Version="11.0.10" />
<PackageReference Include="Avalonia.Desktop" Version="11.0.10" />
<PackageReference Include="Avalonia.Fonts.Inter" Version="11.0.10" />
<PackageReference Include="Avalonia.Controls.DataGrid" Version="$(AvaloniaVersion)" />
<PackageReference Include="Avalonia.Controls.ItemsRepeater" Version="$(AvaloniaVersion)" />
<PackageReference Include="Avalonia.Controls.PanAndZoom" Version="11.0.0.2" />
<PackageReference Include="Avalonia" Version="$(AvaloniaVersion)" />
<PackageReference Include="Avalonia.Desktop" Version="$(AvaloniaVersion)" />
<PackageReference Include="Avalonia.Fonts.Inter" Version="$(AvaloniaVersion)" />
<!--Condition below is needed to remove Avalonia.Diagnostics package from build output in Release configuration.-->
<PackageReference Condition="'$(Configuration)' == 'Debug'" Include="Avalonia.Diagnostics" Version="11.0.10" />
<PackageReference Condition="'$(Configuration)' == 'Debug'" Include="Avalonia.Diagnostics" Version="$(AvaloniaVersion)" />
<PackageReference Include="Avalonia.HtmlRenderer" Version="11.0.0" />
<PackageReference Include="Avalonia.Labs.Controls" Version="11.0.10.1" />
<PackageReference Include="Avalonia.Xaml.Behaviors" Version="11.0.10.1" />
<PackageReference Include="Avalonia.Labs.Controls" Version="11.0.3" />
<PackageReference Include="Avalonia.Xaml.Behaviors" Version="11.0.6" />
<PackageReference Include="AvaloniaEdit.TextMate" Version="11.0.6" />
<PackageReference Include="bodong.Avalonia.PropertyGrid" Version="11.0.6.3" />
<PackageReference Include="bodong.PropertyModels" Version="11.0.6.2" />
Expand All @@ -58,10 +58,10 @@
<PackageReference Include="DesktopNotifications" Version="1.3.1" />
<PackageReference Include="DesktopNotifications.Avalonia" Version="1.3.1" />
<PackageReference Include="DiscordRichPresence" Version="1.2.1.24" />
<PackageReference Include="Dock.Avalonia" Version="11.0.0.7" />
<PackageReference Include="Dock.Model.Avalonia" Version="11.0.0.7" />
<PackageReference Include="Dock.Serializer" Version="11.0.0.7" />
<PackageReference Include="DynamicData" Version="8.4.1" />
<PackageReference Include="Dock.Avalonia" Version="11.0.0.5" />
<PackageReference Include="Dock.Model.Avalonia" Version="11.0.0.5" />
<PackageReference Include="Dock.Serializer" Version="11.0.0.5" />
<PackageReference Include="DynamicData" Version="8.3.27" />
<PackageReference Include="DotNet.Bundle" Version="0.9.13" />
<PackageReference Include="Exceptionless.DateTimeExtensions" Version="3.4.3" />
<PackageReference Include="FluentAvalonia.BreadcrumbBar" Version="2.0.2" />
Expand All @@ -78,25 +78,25 @@
<PackageReference Include="Microsoft.Extensions.Configuration.FileExtensions" Version="8.0.0" />
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="8.0.0" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="8.0.0" />
<PackageReference Include="Microsoft.Extensions.Http.Polly" Version="8.0.3" />
<PackageReference Include="Microsoft.Extensions.Http.Polly" Version="8.0.2" />
<PackageReference Include="Microsoft.Extensions.Options.ConfigurationExtensions" Version="8.0.0" />
<PackageReference Include="Nito.AsyncEx" Version="5.1.2" />
<PackageReference Include="NLog" Version="5.2.8" />
<PackageReference Include="NLog.Extensions.Logging" Version="5.3.8" />
<PackageReference Include="NSubstitute" Version="5.1.0" />
<PackageReference Include="OneOf" Version="3.0.263" />
<PackageReference Include="Polly" Version="8.3.1" />
<PackageReference Include="Polly" Version="8.3.0" />
<PackageReference Include="Polly.Contrib.WaitAndRetry" Version="1.1.1" />
<PackageReference Include="Polly.Extensions.Http" Version="3.0.0" />
<PackageReference Include="Projektanker.Icons.Avalonia.FontAwesome" Version="9.1.2" />
<PackageReference Include="Projektanker.Icons.Avalonia.FontAwesome" Version="9.1.1" />
<PackageReference Include="RockLib.Reflection.Optimized" Version="3.0.0" />
<PackageReference Include="Sentry" Version="4.2.1" />
<PackageReference Include="Sentry.NLog" Version="4.2.1" />
<PackageReference Include="Sentry" Version="4.1.2" />
<PackageReference Include="Sentry.NLog" Version="4.1.2" />
<PackageReference Include="SpacedGrid-Avalonia" Version="11.0.0" />
<PackageReference Include="Sylvan.Common" Version="0.4.3" />
<PackageReference Include="Sylvan.Data" Version="0.2.13" />
<PackageReference Include="Sylvan.Data.Csv" Version="1.3.7" />
<PackageReference Include="System.Drawing.Common" Version="8.0.3" />
<PackageReference Include="System.Drawing.Common" Version="8.0.2" />
<PackageReference Include="System.IO.Hashing" Version="8.0.0" />
<PackageReference Include="TextMateSharp.Grammars" Version="1.0.56" />
<PackageReference Include="URISchemeTools" Version="1.0.2" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@
xmlns:sg="clr-namespace:SpacedGridControl.Avalonia;assembly=SpacedGridControl.Avalonia"
xmlns:ui="clr-namespace:FluentAvalonia.UI.Controls;assembly=FluentAvalonia"
xmlns:labs="clr-namespace:Avalonia.Labs.Controls;assembly=Avalonia.Labs.Controls"
xmlns:vendorLabs="clr-namespace:StabilityMatrix.Avalonia.Controls.VendorLabs">
xmlns:vendorLabs="clr-namespace:StabilityMatrix.Avalonia.Controls.VendorLabs"
xmlns:converters="clr-namespace:StabilityMatrix.Avalonia.Converters">

<Design.PreviewWith>
<Panel Width="450" Height="600">
Expand All @@ -29,7 +30,9 @@
</StackPanel>
</Panel>
</Design.PreviewWith>


<converters:FileUriConverter x:Key="FileUriConverter" />

<!-- ReSharper disable once Xaml.StaticResourceNotResolved -->
<ControlTheme
x:Key="BetterComboBoxItemHybridModelTheme"
Expand All @@ -50,7 +53,7 @@
CornerRadius="6"
IsVisible="{Binding Local.PreviewImageFullPathGlobal, Converter={x:Static StringConverters.IsNotNullOrEmpty}, FallbackValue=''}"
RenderOptions.BitmapInterpolationMode="HighQuality"
Source="{Binding Local.PreviewImageFullPathGlobal, FallbackValue=''}"
Source="{Binding Local.PreviewImageFullPathGlobal, FallbackValue='', Converter={StaticResource FileUriConverter}}"
Stretch="UniformToFill"/>
<StackPanel
Grid.Column="1"
Expand Down Expand Up @@ -132,7 +135,7 @@
Height="42"
RenderOptions.BitmapInterpolationMode="HighQuality"
CornerRadius="40"
Source="{Binding Local.PreviewImageFullPathGlobal}"
Source="{Binding Local.PreviewImageFullPathGlobal, Converter={StaticResource FileUriConverter}}"
Stretch="UniformToFill"/>

<!-- Text -->
Expand Down Expand Up @@ -220,7 +223,7 @@
Height="36"
CornerRadius="60"
RenderOptions.BitmapInterpolationMode="HighQuality"
Source="{Binding Local.PreviewImageFullPathGlobal}"
Source="{Binding Local.PreviewImageFullPathGlobal, Converter={StaticResource FileUriConverter}}"
Stretch="UniformToFill">
</vendorLabs:BetterAsyncImage>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
using Microsoft.Extensions.DependencyInjection;
using NLog;
using StabilityMatrix.Avalonia.Animations;
using StabilityMatrix.Avalonia.Extensions;
using StabilityMatrix.Avalonia.Models;
using StabilityMatrix.Avalonia.Models.Inference;
using StabilityMatrix.Avalonia.Services;
Expand Down Expand Up @@ -249,7 +250,7 @@ public void DragOver(object? sender, DragEventArgs e)
// 1. Context drop for LocalImageFile
if (e.Data.GetDataFormats().Contains("Context"))
{
if (e.Data.Get("Context") is LocalImageFile imageFile)
if (e.Data.GetContext<LocalImageFile>() is { } imageFile)
{
e.Handled = true;
return;
Expand All @@ -274,7 +275,7 @@ public void Drop(object? sender, DragEventArgs e)
// 1. Context drop for LocalImageFile
if (e.Data.GetDataFormats().Contains("Context"))
{
if (e.Data.Get("Context") is LocalImageFile imageFile)
if (e.Data.GetContext<LocalImageFile>() is { } imageFile)
{
e.Handled = true;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
using DynamicData;
using DynamicData.Binding;
using FluentAvalonia.UI.Controls;
using StabilityMatrix.Avalonia.Extensions;
using StabilityMatrix.Avalonia.Services;
using StabilityMatrix.Avalonia.ViewModels.Base;
using StabilityMatrix.Core.Attributes;
Expand Down Expand Up @@ -279,7 +280,7 @@ public async Task OnDrop(DragEventArgs e)
var paths = files.Select(f => f.Path.LocalPath).ToArray();
await ImportFilesAsync(paths, settingsManager.Settings.IsImportAsConnected);
}
else if (e.Data.Get("Context") is CheckpointFile file)
else if (e.Data.GetContext<CheckpointFile>() is { } file)
{
await MoveBetweenFolders(file);
}
Expand Down
9 changes: 5 additions & 4 deletions StabilityMatrix.Avalonia/Views/CheckpointsPage.axaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
using Avalonia.VisualTree;
using DynamicData.Binding;
using StabilityMatrix.Avalonia.Controls;
using StabilityMatrix.Avalonia.Extensions;
using StabilityMatrix.Avalonia.ViewModels;
using StabilityMatrix.Avalonia.ViewModels.CheckpointManager;
using StabilityMatrix.Core.Attributes;
Expand Down Expand Up @@ -68,7 +69,7 @@ private async void OnDrop(object? sender, DragEventArgs e)
{
case CheckpointFolder folder:
{
if (e.Data.Get("Context") is not CheckpointFile file)
if (e.Data.GetContext<CheckpointFile>() is not { } file)
{
await folder.OnDrop(e);
break;
Expand All @@ -83,7 +84,7 @@ private async void OnDrop(object? sender, DragEventArgs e)
}
case CheckpointFile file:
{
if (e.Data.Get("Context") is not CheckpointFile dragFile)
if (e.Data.GetContext<CheckpointFile>() is not { } dragFile)
{
await file.ParentFolder.OnDrop(e);
break;
Expand Down Expand Up @@ -132,7 +133,7 @@ private void OnDragEnter(object? sender, DragEventArgs e)
case CheckpointFolder folder:
{
folder.IsExpanded = true;
if (e.Data.Get("Context") is not CheckpointFile file)
if (e.Data.GetContext<CheckpointFile>() is not { } file)
{
folder.IsCurrentDragTarget = true;
break;
Expand All @@ -144,7 +145,7 @@ private void OnDragEnter(object? sender, DragEventArgs e)
}
case CheckpointFile file:
{
if (e.Data.Get("Context") is not CheckpointFile dragFile)
if (e.Data.GetContext<CheckpointFile>() is not { } dragFile)
{
file.ParentFolder.IsCurrentDragTarget = true;
break;
Expand Down
Loading

0 comments on commit e1a9202

Please sign in to comment.