Skip to content

Commit 909a290

Browse files
authored
Merge pull request #438 from LykosAI/main
v2.8.1 Update
2 parents be5ca65 + ea27537 commit 909a290

18 files changed

+306
-98
lines changed

.github/workflows/backport.yml

+37
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: Automatic Backport
2+
3+
on:
4+
pull_request_target:
5+
types: ["labeled", "closed"]
6+
7+
jobs:
8+
backport:
9+
if: startsWith(github.event.pull_request.labels.*.name, 'backport-to-')
10+
name: Backport PR
11+
runs-on: ubuntu-latest
12+
steps:
13+
- name: Write json
14+
id: create-json
15+
uses: jsdaniell/[email protected]
16+
with:
17+
name: ".backportrc.json"
18+
json: |
19+
{
20+
"targetPRLabels": "backport",
21+
"prTitle": "[{{sourceBranch}} to {{targetBranch}}] backport: {{sourcePullRequest.title}} ({{sourcePullRequest.number}})"
22+
}
23+
24+
- name: Backport Action
25+
uses: sorenlouv/[email protected]
26+
with:
27+
github_token: ${{ secrets.GITHUB_TOKEN }}
28+
auto_backport_label_prefix: backport-to-
29+
30+
- name: Info log
31+
if: ${{ success() }}
32+
run: cat ~/.backport/backport.info.log
33+
34+
- name: Debug log
35+
if: ${{ failure() }}
36+
run: cat ~/.backport/backport.debug.log
37+

CHANGELOG.md

+11
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,17 @@ 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.8.1
9+
### Fixed
10+
- Fixed model links not working in RuinedFooocus for new installations
11+
- Fixed incorrect nodejs download link on Linux (thanks to slogonomo for the fix)
12+
- Fixed failing InvokeAI install on macOS due to missing nodejs
13+
- Increased timeout on Recommended Models call to prevent potential timeout errors on slow connections
14+
- Fixed SynchronizationLockException when saving settings
15+
- Improved error messages with process output for 7z extraction errors
16+
- Fixed missing tkinter dependency for OneTrainer on Windows
17+
- Fixed auto-update on macOS not starting new version from an issue in starting .app bundles with arguments
18+
819
## v2.8.0
920
### Added
1021
- Added Image to Video project type

README.md

+19-3
Original file line numberDiff line numberDiff line change
@@ -9,21 +9,37 @@
99
[download-macos-arm64]: https://github.com/LykosAI/StabilityMatrix/releases/latest/download/StabilityMatrix-macos-arm64.dmg
1010

1111
[auto1111]: https://github.com/AUTOMATIC1111/stable-diffusion-webui
12+
[auto1111-directml]: https://github.com/lshqqytiger/stable-diffusion-webui-directml
13+
[webui-ux]: https://github.com/anapnoe/stable-diffusion-webui-ux
1214
[comfy]: https://github.com/comfyanonymous/ComfyUI
1315
[sdnext]: https://github.com/vladmandic/automatic
1416
[voltaml]: https://github.com/VoltaML/voltaML-fast-stable-diffusion
1517
[invokeai]: https://github.com/invoke-ai/InvokeAI
1618
[fooocus]: https://github.com/lllyasviel/Fooocus
1719
[fooocus-mre]: https://github.com/MoonRide303/Fooocus-MRE
20+
[ruined-fooocus]: https://github.com/runew0lf/RuinedFooocus
21+
[fooocus-controlnet]: https://github.com/fenneishi/Fooocus-ControlNet-SDXL
22+
[kohya-ss]: https://github.com/bmaltais/kohya_ss
23+
[onetrainer]: https://github.com/Nerogar/OneTrainer
1824

1925
[civitai]: https://civitai.com/
26+
[huggingface]: https://huggingface.co/
2027

2128
Multi-Platform Package Manager and Inference UI for Stable Diffusion
2229

2330
### ✨ New in 2.5 - [Inference](#inference-A-reimagined-built-in-Stable-Diffusion-experience), a built-in interface for Stable Diffusion powered by ComfyUI
2431

2532
### 🖱️ One click install and update for Stable Diffusion Web UI Packages
26-
- Supports [Automatic 1111][auto1111], [Comfy UI][comfy], [SD.Next (Vladmandic)][sdnext], [VoltaML][voltaml], [InvokeAI][invokeai], [Fooocus][fooocus], and [Fooocus MRE][fooocus-mre]
33+
- Supports:
34+
- [Automatic 1111][auto1111], [Automatic 1111 DirectML][auto1111-directml], [SD Web UI-UX][webui-ux], [SD.Next][sdnext]
35+
- [Fooocus][fooocus], [Fooocus MRE][fooocus-mre], [Fooocus ControlNet SDXL][fooocus-controlnet], [Ruined Fooocus][ruined-fooocus]
36+
- [ComfyUI][comfy]
37+
- [VoltaML][voltaml]
38+
- [InvokeAI][invokeai]
39+
- [Kohya's GUI][kohya-ss]
40+
- [OneTrainer][onetrainer]
41+
- Manage plugins / extensions for supported packages ([Automatic 1111][auto1111], [Comfy UI][comfy])
42+
- Easily install or update Python dependencies for each package
2743
- Embedded Git and Python dependencies, with no need for either to be globally installed
2844
- Fully portable - move Stability Matrix's Data Directory to a new drive or computer at any time
2945

@@ -34,15 +50,15 @@ Multi-Platform Package Manager and Inference UI for Stable Diffusion
3450
### 🗃️ Checkpoint Manager, configured to be shared by all Package installs
3551
- Option to find CivitAI metadata and preview thumbnails for new local imports
3652

37-
### ☁️ Model Browser to import from [CivitAI][civitai]
53+
### ☁️ Model Browser to import from [CivitAI][civitai] and [HuggingFace][huggingface]
3854
- Automatically imports to the associated model folder depending on the model type
3955
- Downloads relevant metadata files and preview image
4056

4157
![header](https://cdn.lykos.ai/static/sm-banner-rounded.webp)
4258

4359
[![Release](https://img.shields.io/github/v/release/LykosAI/StabilityMatrix?label=Latest%20Release&link=https%3A%2F%2Fgithub.com%2FLykosAI%2FStabilityMatrix%2Freleases%2Flatest)][release]
4460

45-
[![Windows](https://img.shields.io/badge/Windows-%230079d5.svg?style=for-the-badge&logo=Windows%2011&logoColor=white)][download-win-x64]
61+
[![Windows](https://img.shields.io/badge/Windows%2010,%2011-%230079d5.svg?style=for-the-badge&logo=Windows%2011&logoColor=white)][download-win-x64]
4662
[![Linux](https://img.shields.io/badge/Linux-FCC624?style=for-the-badge&logo=linux&logoColor=black)][download-linux-x64]
4763
[![macOS](https://img.shields.io/badge/mac%20os%20%28apple%20silicon%29-000000?style=for-the-badge&logo=macos&logoColor=F0F0F0)][download-macos-arm64]
4864

StabilityMatrix.Avalonia/App.axaml.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -574,7 +574,7 @@ internal static IServiceCollection ConfigureServices()
574574
.ConfigureHttpClient(c =>
575575
{
576576
c.BaseAddress = new Uri("https://auth.lykos.ai");
577-
c.Timeout = TimeSpan.FromSeconds(15);
577+
c.Timeout = TimeSpan.FromSeconds(60);
578578
})
579579
.ConfigurePrimaryHttpMessageHandler(() => new HttpClientHandler { AllowAutoRedirect = false })
580580
.AddPolicyHandler(retryPolicy)
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,22 @@
1-
using StabilityMatrix.Core.Services;
1+
using System.Threading;
2+
using System.Threading.Tasks;
3+
using StabilityMatrix.Core.Services;
24

35
namespace StabilityMatrix.Avalonia.DesignData;
46

57
public class MockSettingsManager : SettingsManager
68
{
7-
protected override void LoadSettings() {}
8-
protected override void SaveSettings() {}
9+
protected override void LoadSettings(CancellationToken cancellationToken = default) { }
10+
11+
protected override Task LoadSettingsAsync(CancellationToken cancellationToken = default)
12+
{
13+
return Task.CompletedTask;
14+
}
15+
16+
protected override void SaveSettings(CancellationToken cancellationToken = default) { }
17+
18+
protected override Task SaveSettingsAsync(CancellationToken cancellationToken = default)
19+
{
20+
return Task.CompletedTask;
21+
}
922
}

StabilityMatrix.Avalonia/Helpers/UnixPrerequisiteHelper.cs

+6-17
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,14 @@ namespace StabilityMatrix.Avalonia.Helpers;
2323

2424
[SupportedOSPlatform("macos")]
2525
[SupportedOSPlatform("linux")]
26-
public class UnixPrerequisiteHelper : IPrerequisiteHelper
26+
public class UnixPrerequisiteHelper(
27+
IDownloadService downloadService,
28+
ISettingsManager settingsManager,
29+
IPyRunner pyRunner
30+
) : IPrerequisiteHelper
2731
{
2832
private static readonly Logger Logger = LogManager.GetCurrentClassLogger();
2933

30-
private readonly IDownloadService downloadService;
31-
private readonly ISettingsManager settingsManager;
32-
private readonly IPyRunner pyRunner;
33-
3434
private DirectoryPath HomeDir => settingsManager.LibraryDir;
3535
private DirectoryPath AssetsDir => HomeDir.JoinDir("Assets");
3636

@@ -46,17 +46,6 @@ public class UnixPrerequisiteHelper : IPrerequisiteHelper
4646
// Cached store of whether or not git is installed
4747
private bool? isGitInstalled;
4848

49-
public UnixPrerequisiteHelper(
50-
IDownloadService downloadService,
51-
ISettingsManager settingsManager,
52-
IPyRunner pyRunner
53-
)
54-
{
55-
this.downloadService = downloadService;
56-
this.settingsManager = settingsManager;
57-
this.pyRunner = pyRunner;
58-
}
59-
6049
private async Task<bool> CheckIsGitInstalled()
6150
{
6251
var result = await ProcessRunner.RunBashCommand("git --version");
@@ -298,7 +287,7 @@ public async Task RunNpm(
298287
{
299288
var command = args.Prepend([NpmPath]);
300289

301-
var result = await ProcessRunner.RunBashCommand(command.ToArray(), workingDirectory ?? "");
290+
var result = await ProcessRunner.RunBashCommand(command.ToArray(), workingDirectory ?? "", envVars);
302291
if (result.ExitCode != 0)
303292
{
304293
Logger.Error(

StabilityMatrix.Avalonia/Helpers/WindowsPrerequisiteHelper.cs

+14-23
Original file line numberDiff line numberDiff line change
@@ -20,15 +20,16 @@
2020
namespace StabilityMatrix.Avalonia.Helpers;
2121

2222
[SupportedOSPlatform("windows")]
23-
public class WindowsPrerequisiteHelper : IPrerequisiteHelper
23+
public class WindowsPrerequisiteHelper(
24+
IDownloadService downloadService,
25+
ISettingsManager settingsManager,
26+
IPyRunner pyRunner
27+
) : IPrerequisiteHelper
2428
{
2529
private static readonly Logger Logger = LogManager.GetCurrentClassLogger();
2630

27-
private readonly IGitHubClient gitHubClient;
28-
private readonly IDownloadService downloadService;
29-
private readonly ISettingsManager settingsManager;
30-
private readonly IPyRunner pyRunner;
31-
31+
private const string PortableGitDownloadUrl =
32+
"https://github.com/git-for-windows/git/releases/download/v2.41.0.windows.1/PortableGit-2.41.0-64-bit.7z.exe";
3233
private const string VcRedistDownloadUrl = "https://aka.ms/vs/16/release/vc_redist.x64.exe";
3334
private const string TkinterDownloadUrl =
3435
"https://cdn.lykos.ai/tkinter-cpython-embedded-3.10.11-win-x64.zip";
@@ -62,19 +63,6 @@ public class WindowsPrerequisiteHelper : IPrerequisiteHelper
6263
public string GitBinPath => Path.Combine(PortableGitInstallDir, "bin");
6364
public bool IsPythonInstalled => File.Exists(PythonDllPath);
6465

65-
public WindowsPrerequisiteHelper(
66-
IGitHubClient gitHubClient,
67-
IDownloadService downloadService,
68-
ISettingsManager settingsManager,
69-
IPyRunner pyRunner
70-
)
71-
{
72-
this.gitHubClient = gitHubClient;
73-
this.downloadService = downloadService;
74-
this.settingsManager = settingsManager;
75-
this.pyRunner = pyRunner;
76-
}
77-
7866
public async Task RunGit(
7967
ProcessArgs args,
8068
Action<ProcessOutput>? onProcessOutput,
@@ -166,6 +154,11 @@ public async Task InstallPackageRequirements(
166154
{
167155
await InstallNodeIfNecessary(progress);
168156
}
157+
158+
if (prerequisites.Contains(PackagePrerequisite.Tkinter))
159+
{
160+
await InstallTkinterIfNecessary(progress);
161+
}
169162
}
170163

171164
public async Task InstallAllIfNecessary(IProgress<ProgressReport>? progress = null)
@@ -363,13 +356,11 @@ public async Task InstallGitIfNecessary(IProgress<ProgressReport>? progress = nu
363356

364357
Logger.Info("Git not found at {GitExePath}, downloading...", GitExePath);
365358

366-
var portableGitUrl =
367-
"https://github.com/git-for-windows/git/releases/download/v2.41.0.windows.1/PortableGit-2.41.0-64-bit.7z.exe";
368-
359+
// Download
369360
if (!File.Exists(PortableGitDownloadPath))
370361
{
371362
await downloadService.DownloadToFileAsync(
372-
portableGitUrl,
363+
PortableGitDownloadUrl,
373364
PortableGitDownloadPath,
374365
progress: progress
375366
);

StabilityMatrix.Avalonia/ViewModels/PackageManager/PackageInstallDetailViewModel.cs

+2
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,8 @@ private async Task Install()
126126
return;
127127
}
128128

129+
InstallName = InstallName.Trim();
130+
129131
var setPackageInstallingStep = new SetPackageInstallingStep(settingsManager, InstallName);
130132

131133
var installLocation = Path.Combine(settingsManager.LibraryDir, "Packages", InstallName);

StabilityMatrix.Avalonia/ViewModels/Settings/MainSettingsViewModel.cs

+1
Original file line numberDiff line numberDiff line change
@@ -595,6 +595,7 @@ AppData Directory [SpecialFolder.ApplicationData]
595595
AppDataHome: {Compat.AppDataHome}
596596
AppCurrentDir: {Compat.AppCurrentDir}
597597
ExecutableName: {Compat.GetExecutableName()}
598+
AppName: {Compat.GetAppName()}
598599
-- Settings --
599600
Expected Portable Marker file: {expectedPortableFile}
600601
Portable Marker file exists: {isPortableMode}

StabilityMatrix.Core/Exceptions/ProcessException.cs

+59-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
using StabilityMatrix.Core.Processes;
1+
using System.Diagnostics;
2+
using System.Text;
3+
using StabilityMatrix.Core.Processes;
24

35
namespace StabilityMatrix.Core.Exceptions;
46

@@ -14,9 +16,64 @@ public ProcessException(string message)
1416

1517
public ProcessException(ProcessResult processResult)
1618
: base(
17-
$"Process {processResult.ProcessName} exited with code {processResult.ExitCode}. {{StdOut = {processResult.StandardOutput}, StdErr = {processResult.StandardError}}}"
19+
$"Process {processResult.ProcessName} exited with code {processResult.ExitCode}. "
20+
+ $"{{StdOut = {processResult.StandardOutput}, StdErr = {processResult.StandardError}}}"
1821
)
1922
{
2023
ProcessResult = processResult;
2124
}
25+
26+
public static void ThrowIfNonZeroExitCode(ProcessResult processResult)
27+
{
28+
if (processResult.IsSuccessExitCode)
29+
return;
30+
31+
throw new ProcessException(processResult);
32+
}
33+
34+
public static void ThrowIfNonZeroExitCode(Process process, string output)
35+
{
36+
if (!process.HasExited || process.ExitCode == 0)
37+
return;
38+
39+
throw new ProcessException(
40+
new ProcessResult
41+
{
42+
ProcessName = process.StartInfo.FileName,
43+
ExitCode = process.ExitCode,
44+
StandardOutput = output
45+
}
46+
);
47+
}
48+
49+
public static void ThrowIfNonZeroExitCode(Process process, StringBuilder outputBuilder)
50+
{
51+
if (!process.HasExited || process.ExitCode == 0)
52+
return;
53+
54+
throw new ProcessException(
55+
new ProcessResult
56+
{
57+
ProcessName = process.StartInfo.FileName,
58+
ExitCode = process.ExitCode,
59+
StandardOutput = outputBuilder.ToString()
60+
}
61+
);
62+
}
63+
64+
public static void ThrowIfNonZeroExitCode(Process process, string stdOut, string stdErr)
65+
{
66+
if (!process.HasExited || process.ExitCode == 0)
67+
return;
68+
69+
throw new ProcessException(
70+
new ProcessResult
71+
{
72+
ProcessName = process.StartInfo.FileName,
73+
ExitCode = process.ExitCode,
74+
StandardOutput = stdOut,
75+
StandardError = stdErr
76+
}
77+
);
78+
}
2279
}

StabilityMatrix.Core/Helper/ArchiveHelper.cs

+9-4
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
using NLog;
66
using SharpCompress.Common;
77
using SharpCompress.Readers;
8+
using StabilityMatrix.Core.Exceptions;
89
using StabilityMatrix.Core.Extensions;
910
using StabilityMatrix.Core.Models.FileInterfaces;
1011
using StabilityMatrix.Core.Models.Progress;
@@ -89,9 +90,10 @@ public static async Task<ArchiveInfo> Extract7Z(string archivePath, string extra
8990
{
9091
var args = $"x {ProcessRunner.Quote(archivePath)} -o{ProcessRunner.Quote(extractDirectory)} -y";
9192

92-
var result = await ProcessRunner.GetProcessResultAsync(SevenZipPath, args).ConfigureAwait(false);
93-
94-
result.EnsureSuccessExitCode();
93+
var result = await ProcessRunner
94+
.GetProcessResultAsync(SevenZipPath, args)
95+
.EnsureSuccessExitCode()
96+
.ConfigureAwait(false);
9597

9698
var output = result.StandardOutput ?? "";
9799

@@ -145,7 +147,10 @@ IProgress<ProgressReport> progress
145147
Logger.Debug($"Starting process '{SevenZipPath}' with arguments '{args}'");
146148

147149
using var process = ProcessRunner.StartProcess(SevenZipPath, args, outputDataReceived: onOutput);
148-
await ProcessRunner.WaitForExitConditionAsync(process).ConfigureAwait(false);
150+
151+
await process.WaitForExitAsync().ConfigureAwait(false);
152+
153+
ProcessException.ThrowIfNonZeroExitCode(process, outputStore);
149154

150155
progress.Report(new ProgressReport(1f, "Finished extracting", type: ProgressType.Extract));
151156

StabilityMatrix.Core/Models/PackagePrerequisite.cs

+2-1
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,6 @@ public enum PackagePrerequisite
77
Git,
88
Node,
99
Dotnet7,
10-
Dotnet8
10+
Dotnet8,
11+
Tkinter,
1112
}

0 commit comments

Comments
 (0)