From 612509f4ff59e6ff634e86f87dfec3a8696682e5 Mon Sep 17 00:00:00 2001 From: JT Date: Sun, 7 Apr 2024 11:25:21 -0700 Subject: [PATCH] Fixed incorrect output path for A3WebUI & made package launch update output links --- CHANGELOG.md | 1 + .../Services/RunningPackageService.cs | 5 +++++ StabilityMatrix.Core/Models/Packages/A3WebUI.cs | 17 +++++++++++------ .../Models/Packages/SDWebForge.cs | 5 ----- 4 files changed, 17 insertions(+), 11 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7456d558..0d4dcaaf 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning 2.0](https://semver.org/spec/v2 - Updated translations for French, Spanish, and Turkish ### Fixed - Fixed [#559](https://github.com/LykosAI/StabilityMatrix/issues/559) - "Unable to load bitmap from provided data" error in Checkpoints page +- Fixed [#522](https://github.com/LykosAI/StabilityMatrix/issues/522) - Incorrect output directory path for latest Auto1111 ## v2.10.0-pre.2 ### Added diff --git a/StabilityMatrix.Avalonia/Services/RunningPackageService.cs b/StabilityMatrix.Avalonia/Services/RunningPackageService.cs index 96f1d719..38db4dc3 100644 --- a/StabilityMatrix.Avalonia/Services/RunningPackageService.cs +++ b/StabilityMatrix.Avalonia/Services/RunningPackageService.cs @@ -100,6 +100,11 @@ public partial class RunningPackageService( installedPackage.PreferredSharedFolderMethod ?? basePackage.RecommendedSharedFolderMethod ); + if (installedPackage.UseSharedOutputFolder) + { + await basePackage.SetupOutputFolderLinks(installedPackage.FullPath!); + } + // Load user launch args from settings and convert to string var userArgs = installedPackage.LaunchArgs ?? []; var userArgsString = string.Join(" ", userArgs.Select(opt => opt.ToArgString())); diff --git a/StabilityMatrix.Core/Models/Packages/A3WebUI.cs b/StabilityMatrix.Core/Models/Packages/A3WebUI.cs index f823efeb..9635cecc 100644 --- a/StabilityMatrix.Core/Models/Packages/A3WebUI.cs +++ b/StabilityMatrix.Core/Models/Packages/A3WebUI.cs @@ -72,12 +72,12 @@ public class A3WebUI( public override Dictionary>? SharedOutputFolders => new() { - [SharedOutputType.Extras] = new[] { "outputs/extras-images" }, + [SharedOutputType.Extras] = new[] { "output/extras-images" }, [SharedOutputType.Saved] = new[] { "log/images" }, - [SharedOutputType.Img2Img] = new[] { "outputs/img2img-images" }, - [SharedOutputType.Text2Img] = new[] { "outputs/txt2img-images" }, - [SharedOutputType.Img2ImgGrids] = new[] { "outputs/img2img-grids" }, - [SharedOutputType.Text2ImgGrids] = new[] { "outputs/txt2img-grids" } + [SharedOutputType.Img2Img] = new[] { "output/img2img-images" }, + [SharedOutputType.Text2Img] = new[] { "output/txt2img-images" }, + [SharedOutputType.Img2ImgGrids] = new[] { "output/img2img-grids" }, + [SharedOutputType.Text2ImgGrids] = new[] { "output/txt2img-grids" } }; [SuppressMessage("ReSharper", "ArrangeObjectCreationWhenTypeNotEvident")] @@ -184,7 +184,7 @@ public class A3WebUI( public override string MainBranch => "master"; - public override string OutputFolderName => "outputs"; + public override string OutputFolderName => "output"; public override IPackageExtensionManager ExtensionManager => new A3WebUiExtensionManager(this); @@ -294,6 +294,11 @@ public class A3WebUI( VenvRunner.RunDetached(args.TrimEnd(), HandleConsoleOutput, OnExit); } + public override string? ExtraLaunchArguments { get; set; } = + settingsManager.IsLibraryDirSet + ? $"--gradio-allowed-path \"{settingsManager.ImagesDirectory}\"" + : string.Empty; + private class A3WebUiExtensionManager(A3WebUI package) : GitPackageExtensionManager(package.PrerequisiteHelper) { diff --git a/StabilityMatrix.Core/Models/Packages/SDWebForge.cs b/StabilityMatrix.Core/Models/Packages/SDWebForge.cs index 69a501d9..f64a4197 100644 --- a/StabilityMatrix.Core/Models/Packages/SDWebForge.cs +++ b/StabilityMatrix.Core/Models/Packages/SDWebForge.cs @@ -178,9 +178,4 @@ public class SDWebForge( await venvRunner.PipInstall(pipArgs, onConsoleOutput).ConfigureAwait(false); progress?.Report(new ProgressReport(1f, "Install complete", isIndeterminate: false)); } - - public override string? ExtraLaunchArguments { get; set; } = - settingsManager.IsLibraryDirSet - ? $"--gradio-allowed-path \"{settingsManager.ImagesDirectory}\"" - : string.Empty; }