Skip to content

Commit 14743db

Browse files
authored
Merge pull request #91 from LykosAI/main
2 parents 617627a + d32bb5e commit 14743db

20 files changed

+190
-56
lines changed

CHANGELOG.md

+9
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,15 @@ All notable changes to Stability Matrix will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
66
and this project adheres to [Semantic Versioning 2.0](https://semver.org/spec/v2.0.0.html).
77

8+
## v2.3.3
9+
### Fixed
10+
- Fixed GPU recognition for Nvidia Tesla GPUs
11+
- Fixed checkpoint file index extension identification with some path names
12+
- Fixed issue where config file may be overwritten during Automatic1111 package updates
13+
- Fixed "Directory Not Found" error on startup when previously selected Data directory does not exist
14+
- Fixed [#83](https://github.com/LykosAI/StabilityMatrix/issues/83) - Display of packages with long names in the Package Manager
15+
- Fixed [#64](https://github.com/LykosAI/StabilityMatrix/issues/64) - Package install error if venv already exists
16+
817
## v2.3.2
918
### Added
1019
- Added warning for exFAT / FAT32 drives when selecting a data directory

StabilityMatrix.Avalonia/Assets.cs

+7-2
Original file line numberDiff line numberDiff line change
@@ -27,17 +27,22 @@ internal static class Assets
2727

2828
[SupportedOSPlatform("windows")]
2929
[SupportedOSPlatform("linux")]
30+
[SupportedOSPlatform("macos")]
3031
public static AvaloniaResource SevenZipExecutable => Compat.Switch(
3132
(PlatformKind.Windows,
3233
new AvaloniaResource("avares://StabilityMatrix.Avalonia/Assets/win-x64/7za.exe")),
3334
(PlatformKind.Linux | PlatformKind.X64,
34-
new AvaloniaResource("avares://StabilityMatrix.Avalonia/Assets/linux-x64/7zzs", (UnixFileMode) 0x777)));
35+
new AvaloniaResource("avares://StabilityMatrix.Avalonia/Assets/linux-x64/7zzs", (UnixFileMode) 0777)),
36+
(PlatformKind.MacOS | PlatformKind.Arm,
37+
new AvaloniaResource("avares://StabilityMatrix.Avalonia/Assets/macos-arm64/7zz", (UnixFileMode) 0x777)));
3538

3639
[SupportedOSPlatform("windows")]
3740
[SupportedOSPlatform("linux")]
41+
[SupportedOSPlatform("macos")]
3842
public static AvaloniaResource SevenZipLicense => Compat.Switch(
3943
(PlatformKind.Windows, new AvaloniaResource("avares://StabilityMatrix.Avalonia/Assets/win-x64/7za - LICENSE.txt")),
40-
(PlatformKind.Linux | PlatformKind.X64, new AvaloniaResource("avares://StabilityMatrix.Avalonia/Assets/linux-x64/7zzs - LICENSE.txt")));
44+
(PlatformKind.Linux | PlatformKind.X64, new AvaloniaResource("avares://StabilityMatrix.Avalonia/Assets/linux-x64/7zzs - LICENSE.txt")),
45+
(PlatformKind.MacOS | PlatformKind.Arm, new AvaloniaResource("avares://StabilityMatrix.Avalonia/Assets/macos-arm64/7zz - LICENSE.txt")));
4146

4247
public static AvaloniaResource PyScriptSiteCustomize => new(
4348
"avares://StabilityMatrix.Avalonia/Assets/sitecustomize.py");
5.39 MB
Binary file not shown.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
7-Zip
2+
~~~~~
3+
License for use and distribution
4+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
5+
6+
7-Zip Copyright (C) 1999-2023 Igor Pavlov.
7+
8+
The licenses for 7zz and 7zzs files are:
9+
10+
- The "GNU LGPL" as main license for most of the code
11+
- The "GNU LGPL" with "unRAR license restriction" for some code
12+
- The "BSD 3-clause License" for some code
13+
14+
Redistributions in binary form must reproduce related license information from this file.
15+
16+
Note:
17+
You can use 7-Zip on any computer, including a computer in a commercial
18+
organization. You don't need to register or pay for 7-Zip.
19+
20+
21+
GNU LGPL information
22+
--------------------
23+
24+
This library is free software; you can redistribute it and/or
25+
modify it under the terms of the GNU Lesser General Public
26+
License as published by the Free Software Foundation; either
27+
version 2.1 of the License, or (at your option) any later version.
28+
29+
This library is distributed in the hope that it will be useful,
30+
but WITHOUT ANY WARRANTY; without even the implied warranty of
31+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
32+
Lesser General Public License for more details.
33+
34+
You can receive a copy of the GNU Lesser General Public License from
35+
http://www.gnu.org/
36+
37+
38+
39+
40+
BSD 3-clause License
41+
--------------------
42+
43+
The "BSD 3-clause License" is used for the code in 7z.dll that implements LZFSE data decompression.
44+
That code was derived from the code in the "LZFSE compression library" developed by Apple Inc,
45+
that also uses the "BSD 3-clause License":
46+
47+
----
48+
Copyright (c) 2015-2016, Apple Inc. All rights reserved.
49+
50+
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
51+
52+
1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
53+
54+
2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer
55+
in the documentation and/or other materials provided with the distribution.
56+
57+
3. Neither the name of the copyright holder(s) nor the names of any contributors may be used to endorse or promote products derived
58+
from this software without specific prior written permission.
59+
60+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
61+
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
62+
COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
63+
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
64+
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
65+
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
66+
----
67+
68+
69+
70+
71+
unRAR license restriction
72+
-------------------------
73+
74+
The decompression engine for RAR archives was developed using source
75+
code of unRAR program.
76+
All copyrights to original unRAR code are owned by Alexander Roshal.
77+
78+
The license for original unRAR code has the following restriction:
79+
80+
The unRAR sources cannot be used to re-create the RAR compression algorithm,
81+
which is proprietary. Distribution of modified unRAR sources in separate form
82+
or as a part of other software is permitted, provided that it is clearly
83+
stated in the documentation and source comments that the code may
84+
not be used to develop a RAR (WinRAR) compatible archiver.
85+
86+
87+
--
88+
Igor Pavlov

StabilityMatrix.Avalonia/DesignData/DesignData.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ public static void Initialize()
6363
new()
6464
{
6565
Id = Guid.NewGuid(),
66-
DisplayName = "Dank Diffusion",
66+
DisplayName = "Comfy Diffusion WebUI Dev Branch Long Name",
6767
PackageName = "ComfyUI",
6868
DisplayVersion = "main@ab73d4a",
6969
LibraryPath = $"Packages{Path.DirectorySeparatorChar}example-webui",
@@ -297,7 +297,7 @@ public static PackageManagerViewModel PackageManagerViewModel
297297
vm.SetPackages(settings.Settings.InstalledPackages);
298298
vm.SetUnknownPackages(new InstalledPackage[]
299299
{
300-
UnknownInstalledPackage.FromDirectoryName("sd-unknown"),
300+
UnknownInstalledPackage.FromDirectoryName("sd-unknown-with-long-name"),
301301
});
302302

303303
vm.PackageCards[0].IsUpdateAvailable = true;

StabilityMatrix.Avalonia/Helpers/UnixPrerequisiteHelper.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -173,8 +173,8 @@ public async Task InstallPythonIfNecessary(IProgress<ProgressReport>? progress =
173173
progress?.Report(new ProgressReport(0, "Installing Python", isIndeterminate: true));
174174
await ArchiveHelper.Extract7ZAuto(downloadPath, PythonDir);
175175

176-
// For Linux, move the inner 'python' folder up to the root PythonDir
177-
if (Compat.IsLinux)
176+
// For Unix, move the inner 'python' folder up to the root PythonDir
177+
if (Compat.IsUnix)
178178
{
179179
var innerPythonDir = PythonDir.JoinDir("python");
180180
if (!innerPythonDir.Exists)

StabilityMatrix.Avalonia/StabilityMatrix.Avalonia.csproj

+3-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
<ApplicationManifest>app.manifest</ApplicationManifest>
99
<AvaloniaUseCompiledBindingsByDefault>true</AvaloniaUseCompiledBindingsByDefault>
1010
<ApplicationIcon>./Assets/Icon.ico</ApplicationIcon>
11-
<Version>2.3.2-dev.1</Version>
11+
<Version>2.3.3-dev.1</Version>
1212
<InformationalVersion>$(Version)</InformationalVersion>
1313
<EnableWindowsTargeting>true</EnableWindowsTargeting>
1414
</PropertyGroup>
@@ -77,6 +77,8 @@
7777
<AvaloniaResource Include="Assets\win-x64\**" Condition="'$(RuntimeIdentifier)' == 'win-x64'" />
7878
<!-- Only for linux-64 -->
7979
<AvaloniaResource Include="Assets\linux-x64\**" Condition="'$(RuntimeIdentifier)' == 'linux-x64'" />
80+
<!-- Only for osx-arm64 -->
81+
<AvaloniaResource Include="Assets\macos-arm64\**" Condition="'$(RuntimeIdentifier)' == 'osx-arm64'" />
8082
</ItemGroup>
8183

8284
<ItemGroup>

StabilityMatrix.Avalonia/ViewModels/CheckpointManager/CheckpointFile.cs

+8-7
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
using System;
22
using System.Collections.Generic;
33
using System.Collections.ObjectModel;
4-
using System.Diagnostics;
54
using System.IO;
65
using System.Linq;
76
using System.Threading.Tasks;
@@ -49,11 +48,11 @@ public partial class CheckpointFile : ViewModelBase
4948
[ObservableProperty] private bool isLoading;
5049
[ObservableProperty] private CivitModelType modelType;
5150

52-
public string FileName => Path.GetFileName((string?) FilePath);
51+
public string FileName => Path.GetFileName(FilePath);
5352

5453
public ObservableCollection<string> Badges { get; set; } = new();
5554

56-
private static readonly string[] SupportedCheckpointExtensions = { ".safetensors", ".pt", ".ckpt", ".pth", "bin" };
55+
private static readonly string[] SupportedCheckpointExtensions = { ".safetensors", ".pt", ".ckpt", ".pth", ".bin" };
5756
private static readonly string[] SupportedImageExtensions = { ".png", ".jpg", ".jpeg" };
5857
private static readonly string[] SupportedMetadataExtensions = { ".json" };
5958

@@ -200,7 +199,8 @@ public static IEnumerable<CheckpointFile> FromDirectoryIndex(string directory, S
200199
{
201200
foreach (var file in Directory.EnumerateFiles(directory, "*.*", searchOption))
202201
{
203-
if (!SupportedCheckpointExtensions.Any(ext => file.Contains(ext)))
202+
if (!SupportedCheckpointExtensions.Any(ext =>
203+
Path.GetExtension(file).Equals(ext, StringComparison.InvariantCultureIgnoreCase)))
204204
continue;
205205

206206
var checkpointFile = new CheckpointFile
@@ -230,7 +230,8 @@ public static IEnumerable<CheckpointFile> GetAllCheckpointFiles(string modelsDir
230230
{
231231
foreach (var file in Directory.EnumerateFiles(modelsDirectory, "*.*", SearchOption.AllDirectories))
232232
{
233-
if (!SupportedCheckpointExtensions.Any(ext => file.Contains(ext)))
233+
if (!SupportedCheckpointExtensions.Any(ext =>
234+
Path.GetExtension(file).Equals(ext, StringComparison.InvariantCultureIgnoreCase)))
234235
continue;
235236

236237
var checkpointFile = new CheckpointFile
@@ -239,7 +240,7 @@ public static IEnumerable<CheckpointFile> GetAllCheckpointFiles(string modelsDir
239240
FilePath = file,
240241
};
241242

242-
var jsonPath = Path.Combine(Path.GetDirectoryName(file),
243+
var jsonPath = Path.Combine(Path.GetDirectoryName(file) ?? "",
243244
Path.GetFileNameWithoutExtension(file) + ".cm-info.json");
244245

245246
if (File.Exists(jsonPath))
@@ -251,7 +252,7 @@ public static IEnumerable<CheckpointFile> GetAllCheckpointFiles(string modelsDir
251252
}
252253

253254
checkpointFile.PreviewImagePath = SupportedImageExtensions
254-
.Select(ext => Path.Combine(Path.GetDirectoryName(file),
255+
.Select(ext => Path.Combine(Path.GetDirectoryName(file) ?? "",
255256
$"{Path.GetFileNameWithoutExtension(file)}.preview{ext}")).Where(File.Exists)
256257
.FirstOrDefault();
257258

StabilityMatrix.Avalonia/Views/PackageManagerPage.axaml

+27-10
Original file line numberDiff line numberDiff line change
@@ -32,18 +32,23 @@
3232
<DataTemplate DataType="{x:Type packageManager:PackageCardViewModel}">
3333
<controls:Card Padding="8">
3434
<Grid RowDefinitions="Auto, Auto, Auto, Auto"
35-
ColumnDefinitions="Auto">
35+
ColumnDefinitions="*,Auto">
3636

3737
<TextBlock Grid.Row="0"
3838
Grid.Column="0"
39+
ToolTip.Tip="{Binding Package.DisplayName, FallbackValue=''}"
3940
Text="{Binding Package.DisplayName, FallbackValue=''}"
41+
TextTrimming="WordEllipsis"
4042
TextAlignment="Left" />
4143
<Button
4244
Grid.Row="0"
43-
Grid.RowSpan="2"
45+
Grid.Column="1"
4446
HorizontalContentAlignment="Right"
4547
HorizontalAlignment="Right"
46-
Margin="8,-8,0,4"
48+
VerticalContentAlignment="Top"
49+
VerticalAlignment="Top"
50+
Padding="4,1"
51+
Margin="4,0,0,0"
4752
Classes="transparent"
4853
Width="24"
4954
BorderThickness="0">
@@ -76,6 +81,7 @@
7681

7782
<TextBlock Grid.Row="1"
7883
Grid.Column="0"
84+
Grid.ColumnSpan="2"
7985
Margin="2,0,0,0"
8086
VerticalAlignment="Center"
8187
Text="{Binding InstalledVersion}" />
@@ -84,6 +90,7 @@
8490
<controls:BetterAdvancedImage
8591
Grid.Row="2"
8692
Grid.Column="0"
93+
Grid.ColumnSpan="2"
8794
Margin="0,8,0,8"
8895
Height="160"
8996
Width="200"
@@ -99,6 +106,7 @@
99106
<Border
100107
Grid.Row="2"
101108
Grid.Column="0"
109+
Grid.ColumnSpan="2"
102110
Margin="0,8,0,8"
103111
Height="160"
104112
Width="200"
@@ -115,9 +123,12 @@
115123
</Border>
116124

117125

118-
<Grid Grid.Row="3" Grid.Column="0"
119-
IsVisible="{Binding IsUpdateAvailable}"
120-
ColumnDefinitions="*, *">
126+
<Grid
127+
Grid.Row="3"
128+
Grid.Column="0"
129+
Grid.ColumnSpan="2"
130+
IsVisible="{Binding IsUpdateAvailable}"
131+
ColumnDefinitions="*, *">
121132
<!-- Launch and update buttons -->
122133
<Button Grid.Column="0" Classes="accent"
123134
VerticalAlignment="Bottom"
@@ -144,10 +155,14 @@
144155
</Grid>
145156

146157
<!-- Big launch button -->
147-
<Button Grid.Row="3" Grid.Column="0" Classes="accent"
148-
VerticalAlignment="Bottom"
149-
Command="{Binding Launch}"
150-
HorizontalAlignment="Stretch">
158+
<Button
159+
Grid.Row="3"
160+
Grid.Column="0"
161+
Grid.ColumnSpan="2"
162+
Classes="accent"
163+
VerticalAlignment="Bottom"
164+
Command="{Binding Launch}"
165+
HorizontalAlignment="Stretch">
151166
<Button.IsVisible>
152167
<MultiBinding Converter="{x:Static BoolConverters.And}">
153168
<Binding Path="!IsUpdateAvailable" />
@@ -164,6 +179,7 @@
164179

165180
<!-- Import button (for unknown) -->
166181
<Button Grid.Row="3" Grid.Column="0" Classes="transparent-info"
182+
Grid.ColumnSpan="2"
167183
VerticalAlignment="Bottom"
168184
HorizontalAlignment="Stretch"
169185
Command="{Binding Import}"
@@ -180,6 +196,7 @@
180196
<Border
181197
Grid.Row="0" Grid.RowSpan="4"
182198
Grid.Column="0"
199+
Grid.ColumnSpan="2"
183200
Background="#DD000000"
184201
CornerRadius="4"
185202
HorizontalAlignment="Stretch"

StabilityMatrix.Core/Helper/ArchiveHelper.cs

+5-1
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,14 @@ public static string SevenZipFileName
3131
{
3232
return "7za.exe";
3333
}
34-
if (Compat.Platform.HasFlag(PlatformKind.Linux))
34+
if (Compat.IsLinux)
3535
{
3636
return "7zzs";
3737
}
38+
if (Compat.IsMacOS)
39+
{
40+
return "7zz";
41+
}
3842
throw new PlatformNotSupportedException("7z is not supported on this platform.");
3943
}
4044
}

StabilityMatrix.Core/Helper/Compat.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ static Compat()
114114
throw new PlatformNotSupportedException();
115115
}
116116

117-
if (RuntimeInformation.ProcessArchitecture == Architecture.Arm)
117+
if (RuntimeInformation.ProcessArchitecture == Architecture.Arm64)
118118
{
119119
Platform |= PlatformKind.Arm;
120120
}

StabilityMatrix.Core/Helper/HardwareHelper.cs

+13-1
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,18 @@ public record GpuInfo
155155
_ => Level.High
156156
};
157157

158-
public bool IsNvidia => Name?.ToLowerInvariant().Contains("nvidia") ?? false;
158+
public bool IsNvidia
159+
{
160+
get
161+
{
162+
var name = Name?.ToLowerInvariant();
163+
164+
if (string.IsNullOrEmpty(name)) return false;
165+
166+
return name.Contains("nvidia")
167+
|| name.Contains("tesla");
168+
}
169+
}
170+
159171
public bool IsAmd => Name?.ToLowerInvariant().Contains("amd") ?? false;
160172
}

0 commit comments

Comments
 (0)