diff --git a/CHANGELOG.md b/CHANGELOG.md index c3a13d5c..bc914823 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,21 @@ 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.12.1 +### Fixed +- Fixed [#916](https://github.com/LykosAI/StabilityMatrix/issues/916) - InvokeAI failing to install/update on macOS +- Fixed [#914](https://github.com/LykosAI/StabilityMatrix/issues/914) - Unable to use escaped colon `:` character in Inference prompts +- Fixed [#908](https://github.com/LykosAI/StabilityMatrix/issues/908) - Forge unable to use models from "unet" shared folder +- Fixed [#902](https://github.com/LykosAI/StabilityMatrix/issues/902) - Images from shared outputs folder not displaying properly in Stable Diffusion WebUI-UX +- Fixed [#898](https://github.com/LykosAI/StabilityMatrix/issues/898) - Incorrect launch options for RuinedFooocus +- Fixed index url parsing in Python Packages window causing some packages to not have versions available +- Fixed a crash when switching between Model Sharing options for certain packages +### Supporters +#### Visionaries +- A sincere thank you to our valued Visionary-tier Patreon supporter, **Waterclouds**. Your continued support is truly appreciated, and we’re grateful to have you with us on this journey. +#### Pioneers +- We’d also like to extend our gratitude to our Pioneer-tier patrons: **tankfox**, **tanangular**, **Mr. Unknown**, and **Szir777**. Your ongoing support means a great deal to us! + ## v2.12.0 ### Added #### New Packages @@ -79,7 +94,7 @@ and this project adheres to [Semantic Versioning 2.0](https://semver.org/spec/v2 ### Supporters #### Visionaries - A heartfelt thank you to our Visionary-tier patron, **Waterclouds**! We greatly appreciate your continued support! -### Pioneers +#### Pioneers - A special shoutout to our Pioneer-tier patrons: **tankfox**, **tanangular**, **Mr. Unknown**, and **Szir777**! Your unwavering support means a great deal! ## v2.12.0-pre.3 diff --git a/StabilityMatrix.Avalonia/Assets/ImagePrompt.tmLanguage.json b/StabilityMatrix.Avalonia/Assets/ImagePrompt.tmLanguage.json index 6cca1b54..149a4a95 100644 --- a/StabilityMatrix.Avalonia/Assets/ImagePrompt.tmLanguage.json +++ b/StabilityMatrix.Avalonia/Assets/ImagePrompt.tmLanguage.json @@ -26,7 +26,7 @@ "name": "constant.character.escape.prompt" } }, - "end": "[-+.!(){}\\[\\]<\\>]", + "end": "[-+.!(){}\\[\\]<\\>:]", "endCaptures": { "0": { "name": "constant.character.escape.target.prompt" @@ -35,7 +35,7 @@ "name": "meta.structure.escape.prompt", "patterns": [ { - "match": "[^-+.!(){}\\[\\]<\\>]", + "match": "[^-+.!(){}\\[\\]<\\>:]", "name": "invalid.illegal.escape.prompt" } ] diff --git a/StabilityMatrix.Avalonia/ViewModels/PackageManager/PackageCardViewModel.cs b/StabilityMatrix.Avalonia/ViewModels/PackageManager/PackageCardViewModel.cs index 0a80a92d..3632ff37 100644 --- a/StabilityMatrix.Avalonia/ViewModels/PackageManager/PackageCardViewModel.cs +++ b/StabilityMatrix.Avalonia/ViewModels/PackageManager/PackageCardViewModel.cs @@ -451,11 +451,6 @@ public async Task Update() IsUpdateAvailable = false; InstalledVersion = Package.Version?.DisplayVersion ?? "Unknown"; - notificationService.Show( - Resources.Progress_UpdateComplete, - string.Format(Resources.TextTemplate_PackageUpdatedToLatest, packageName), - NotificationType.Success - ); } catch (Exception e) { diff --git a/StabilityMatrix.Core/Helper/FileTransfers.cs b/StabilityMatrix.Core/Helper/FileTransfers.cs index 128d3281..4bc46cbc 100644 --- a/StabilityMatrix.Core/Helper/FileTransfers.cs +++ b/StabilityMatrix.Core/Helper/FileTransfers.cs @@ -161,6 +161,16 @@ await MoveAllFiles(sourceDir, destinationDir, overwrite, overwriteIfHashMatches) // Recursively move sub directories await MoveAllFilesAndDirectories(subDir, destinationSubDir, overwrite, overwriteIfHashMatches) .ConfigureAwait(false); + + if (!subDir.EnumerateFileSystemInfos().Any()) + { + subDir.Delete(); + } + + if (destinationSubDir.Exists) + continue; + + destinationSubDir.Create(); } } diff --git a/StabilityMatrix.Core/Models/Packages/A3WebUI.cs b/StabilityMatrix.Core/Models/Packages/A3WebUI.cs index 5d023cdb..95f7fd1d 100644 --- a/StabilityMatrix.Core/Models/Packages/A3WebUI.cs +++ b/StabilityMatrix.Core/Models/Packages/A3WebUI.cs @@ -47,41 +47,42 @@ IPrerequisiteHelper prerequisiteHelper public override Dictionary> SharedFolders => new() { - [SharedFolderType.StableDiffusion] = new[] { "models/Stable-diffusion" }, - [SharedFolderType.ESRGAN] = new[] { "models/ESRGAN" }, - [SharedFolderType.GFPGAN] = new[] { "models/GFPGAN" }, - [SharedFolderType.RealESRGAN] = new[] { "models/RealESRGAN" }, - [SharedFolderType.SwinIR] = new[] { "models/SwinIR" }, - [SharedFolderType.Lora] = new[] { "models/Lora" }, - [SharedFolderType.LyCORIS] = new[] { "models/LyCORIS" }, - [SharedFolderType.ApproxVAE] = new[] { "models/VAE-approx" }, - [SharedFolderType.VAE] = new[] { "models/VAE" }, - [SharedFolderType.DeepDanbooru] = new[] { "models/deepbooru" }, - [SharedFolderType.Karlo] = new[] { "models/karlo" }, - [SharedFolderType.TextualInversion] = new[] { "embeddings" }, - [SharedFolderType.Hypernetwork] = new[] { "models/hypernetworks" }, - [SharedFolderType.ControlNet] = new[] { "models/controlnet/ControlNet" }, - [SharedFolderType.Codeformer] = new[] { "models/Codeformer" }, - [SharedFolderType.LDSR] = new[] { "models/LDSR" }, - [SharedFolderType.AfterDetailer] = new[] { "models/adetailer" }, - [SharedFolderType.T2IAdapter] = new[] { "models/controlnet/T2IAdapter" }, - [SharedFolderType.IpAdapter] = new[] { "models/controlnet/IpAdapter" }, - [SharedFolderType.InvokeIpAdapters15] = new[] { "models/controlnet/DiffusersIpAdapters" }, - [SharedFolderType.InvokeIpAdaptersXl] = new[] { "models/controlnet/DiffusersIpAdaptersXL" }, - [SharedFolderType.SVD] = new[] { "models/svd" }, - [SharedFolderType.CLIP] = new[] { "models/text_encoder" } + [SharedFolderType.StableDiffusion] = ["models/Stable-diffusion/sd"], + [SharedFolderType.ESRGAN] = ["models/ESRGAN"], + [SharedFolderType.GFPGAN] = ["models/GFPGAN"], + [SharedFolderType.RealESRGAN] = ["models/RealESRGAN"], + [SharedFolderType.SwinIR] = ["models/SwinIR"], + [SharedFolderType.Lora] = ["models/Lora"], + [SharedFolderType.LyCORIS] = ["models/LyCORIS"], + [SharedFolderType.ApproxVAE] = ["models/VAE-approx"], + [SharedFolderType.VAE] = ["models/VAE"], + [SharedFolderType.DeepDanbooru] = ["models/deepbooru"], + [SharedFolderType.Karlo] = ["models/karlo"], + [SharedFolderType.TextualInversion] = ["embeddings"], + [SharedFolderType.Hypernetwork] = ["models/hypernetworks"], + [SharedFolderType.ControlNet] = ["models/controlnet/ControlNet"], + [SharedFolderType.Codeformer] = ["models/Codeformer"], + [SharedFolderType.LDSR] = ["models/LDSR"], + [SharedFolderType.AfterDetailer] = ["models/adetailer"], + [SharedFolderType.T2IAdapter] = ["models/controlnet/T2IAdapter"], + [SharedFolderType.IpAdapter] = ["models/controlnet/IpAdapter"], + [SharedFolderType.InvokeIpAdapters15] = ["models/controlnet/DiffusersIpAdapters"], + [SharedFolderType.InvokeIpAdaptersXl] = ["models/controlnet/DiffusersIpAdaptersXL"], + [SharedFolderType.SVD] = ["models/svd"], + [SharedFolderType.CLIP] = ["models/text_encoder"], + [SharedFolderType.Unet] = ["models/Stable-diffusion/unet"], }; public override Dictionary>? SharedOutputFolders => new() { - [SharedOutputType.Extras] = new[] { "outputs/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.SVD] = new[] { "outputs/svd" } + [SharedOutputType.Extras] = ["outputs/extras-images"], + [SharedOutputType.Saved] = ["log/images"], + [SharedOutputType.Img2Img] = ["outputs/img2img-images"], + [SharedOutputType.Text2Img] = ["outputs/txt2img-images"], + [SharedOutputType.Img2ImgGrids] = ["outputs/img2img-grids"], + [SharedOutputType.Text2ImgGrids] = ["outputs/txt2img-grids"], + [SharedOutputType.SVD] = ["outputs/svd"] }; [SuppressMessage("ReSharper", "ArrangeObjectCreationWhenTypeNotEvident")] @@ -101,7 +102,7 @@ IPrerequisiteHelper prerequisiteHelper DefaultValue = "7860", Options = ["--port"] }, - new LaunchOptionDefinition + new() { Name = "Share", Type = LaunchOptionType.Bool, @@ -181,10 +182,10 @@ IPrerequisiteHelper prerequisiteHelper ]; public override IEnumerable AvailableSharedFolderMethods => - new[] { SharedFolderMethod.Symlink, SharedFolderMethod.None }; + [SharedFolderMethod.Symlink, SharedFolderMethod.None]; public override IEnumerable AvailableTorchIndices => - new[] { TorchIndex.Cpu, TorchIndex.Cuda, TorchIndex.Rocm, TorchIndex.Mps }; + [TorchIndex.Cpu, TorchIndex.Cuda, TorchIndex.Rocm, TorchIndex.Mps]; public override string MainBranch => "master"; diff --git a/StabilityMatrix.Core/Models/Packages/Fooocus.cs b/StabilityMatrix.Core/Models/Packages/Fooocus.cs index 1e968b30..fa0b3996 100644 --- a/StabilityMatrix.Core/Models/Packages/Fooocus.cs +++ b/StabilityMatrix.Core/Models/Packages/Fooocus.cs @@ -81,12 +81,6 @@ IPrerequisiteHelper prerequisiteHelper Options = { "--language" } }, new LaunchOptionDefinition - { - Name = "Auto-Launch", - Type = LaunchOptionType.Bool, - Options = { "--auto-launch" } - }, - new LaunchOptionDefinition { Name = "Disable Image Log", Type = LaunchOptionType.Bool, diff --git a/StabilityMatrix.Core/Models/Packages/InvokeAI.cs b/StabilityMatrix.Core/Models/Packages/InvokeAI.cs index 9939f978..3290c5ae 100644 --- a/StabilityMatrix.Core/Models/Packages/InvokeAI.cs +++ b/StabilityMatrix.Core/Models/Packages/InvokeAI.cs @@ -216,7 +216,10 @@ await SetupAndBuildInvokeFrontend( torchInstallArgs = torchInstallArgs.WithUserOverrides(installedPackage.PipOverrides); } - await venvRunner.PipInstall(torchInstallArgs, onConsoleOutput).ConfigureAwait(false); + if (torchInstallArgs.Arguments.Count > 0) + { + await venvRunner.PipInstall(torchInstallArgs, onConsoleOutput).ConfigureAwait(false); + } await venvRunner .PipInstall($"{pipCommandArgs}{(exists ? " --upgrade" : "")}", onConsoleOutput) @@ -345,21 +348,6 @@ await SetupAndBuildInvokeFrontend( // above the minimum in invokeai.frontend.install.widgets var code = $""" - try: - import os - import shutil - from invokeai.frontend.install import widgets - - _min_cols = widgets.MIN_COLS - _min_lines = widgets.MIN_LINES - - static_size_fn = lambda: os.terminal_size((_min_cols, _min_lines)) - shutil.get_terminal_size = static_size_fn - widgets.get_terminal_size = static_size_fn - except Exception as e: - import warnings - warnings.warn('Could not patch terminal size for InvokeAI' + str(e)) - import sys from {split[0]} import {split[1]} sys.exit({split[1]}()) diff --git a/StabilityMatrix.Core/Models/Packages/RuinedFooocus.cs b/StabilityMatrix.Core/Models/Packages/RuinedFooocus.cs index d2e5aa55..3b0717fe 100644 --- a/StabilityMatrix.Core/Models/Packages/RuinedFooocus.cs +++ b/StabilityMatrix.Core/Models/Packages/RuinedFooocus.cs @@ -32,77 +32,44 @@ IPrerequisiteHelper prerequisiteHelper public override SharedFolderMethod RecommendedSharedFolderMethod => SharedFolderMethod.Symlink; public override List LaunchOptions => - new() - { - new LaunchOptionDefinition - { - Name = "Preset", - Type = LaunchOptionType.Bool, - Options = { "--preset anime", "--preset realistic" } - }, - new LaunchOptionDefinition + [ + new() { Name = "Port", Type = LaunchOptionType.String, Description = "Sets the listen port", Options = { "--port" } }, - new LaunchOptionDefinition + new() { Name = "Share", Type = LaunchOptionType.Bool, Description = "Set whether to share on Gradio", Options = { "--share" } }, - new LaunchOptionDefinition + new() { Name = "Listen", Type = LaunchOptionType.String, Description = "Set the listen interface", Options = { "--listen" } }, - new LaunchOptionDefinition + new() { - Name = "Output Directory", + Name = "Auth", Type = LaunchOptionType.String, - Description = "Override the output directory", - Options = { "--output-directory" } + Description = "Set credentials username/password", + Options = { "--auth" } }, new() { - Name = "VRAM", - Type = LaunchOptionType.Bool, - InitialValue = HardwareHelper.IterGpuInfo().Select(gpu => gpu.MemoryLevel).Max() switch - { - MemoryLevel.Low => "--lowvram", - MemoryLevel.Medium => "--normalvram", - _ => null - }, - Options = { "--highvram", "--normalvram", "--lowvram", "--novram" } - }, - new LaunchOptionDefinition - { - Name = "Use DirectML", - Type = LaunchOptionType.Bool, - Description = "Use pytorch with DirectML support", - InitialValue = HardwareHelper.PreferDirectML(), - Options = { "--directml" } - }, - new LaunchOptionDefinition - { - Name = "Disable Xformers", - Type = LaunchOptionType.Bool, - InitialValue = !HardwareHelper.HasNvidiaGpu(), - Options = { "--disable-xformers" } - }, - new LaunchOptionDefinition - { - Name = "Auto-Launch", + Name = "No Browser", Type = LaunchOptionType.Bool, - Options = { "--auto-launch" } + Description = "Do not launch in browser", + Options = { "--nobrowser" } }, LaunchOptionDefinition.Extras - }; + ]; public override async Task InstallPackage( string installLocation, diff --git a/StabilityMatrix.Core/Models/Packages/SDWebForge.cs b/StabilityMatrix.Core/Models/Packages/SDWebForge.cs index de250aa1..aa1599ba 100644 --- a/StabilityMatrix.Core/Models/Packages/SDWebForge.cs +++ b/StabilityMatrix.Core/Models/Packages/SDWebForge.cs @@ -41,78 +41,78 @@ IPrerequisiteHelper prerequisiteHelper public override List LaunchOptions => [ - new LaunchOptionDefinition + new() { Name = "Host", Type = LaunchOptionType.String, DefaultValue = "localhost", Options = ["--server-name"] }, - new LaunchOptionDefinition + new() { Name = "Port", Type = LaunchOptionType.String, DefaultValue = "7860", Options = ["--port"] }, - new LaunchOptionDefinition + new() { Name = "Share", Type = LaunchOptionType.Bool, Description = "Set whether to share on Gradio", Options = { "--share" } }, - new LaunchOptionDefinition + new() { Name = "Pin Shared Memory", Type = LaunchOptionType.Bool, Options = { "--pin-shared-memory" } }, - new LaunchOptionDefinition + new() { Name = "CUDA Malloc", Type = LaunchOptionType.Bool, Options = { "--cuda-malloc" } }, - new LaunchOptionDefinition + new() { Name = "CUDA Stream", Type = LaunchOptionType.Bool, Options = { "--cuda-stream" } }, - new LaunchOptionDefinition + new() { Name = "Always Offload from VRAM", Type = LaunchOptionType.Bool, Options = ["--always-offload-from-vram"] }, - new LaunchOptionDefinition + new() { Name = "Always GPU", Type = LaunchOptionType.Bool, Options = ["--always-gpu"] }, - new LaunchOptionDefinition + new() { Name = "Always CPU", Type = LaunchOptionType.Bool, Options = ["--always-cpu"] }, - new LaunchOptionDefinition + new() { Name = "Use DirectML", Type = LaunchOptionType.Bool, InitialValue = HardwareHelper.PreferDirectML(), Options = ["--directml"] }, - new LaunchOptionDefinition + new() { Name = "Skip Torch CUDA Test", Type = LaunchOptionType.Bool, InitialValue = Compat.IsMacOS, Options = ["--skip-torch-cuda-test"] }, - new LaunchOptionDefinition + new() { Name = "No half-precision VAE", Type = LaunchOptionType.Bool, @@ -123,7 +123,7 @@ IPrerequisiteHelper prerequisiteHelper ]; public override IEnumerable AvailableTorchIndices => - new[] { TorchIndex.Cpu, TorchIndex.Cuda, TorchIndex.DirectMl, TorchIndex.Rocm, TorchIndex.Mps }; + [TorchIndex.Cpu, TorchIndex.Cuda, TorchIndex.DirectMl, TorchIndex.Rocm, TorchIndex.Mps]; public override async Task InstallPackage( string installLocation, diff --git a/StabilityMatrix.Core/Models/Packages/StableDiffusionUx.cs b/StabilityMatrix.Core/Models/Packages/StableDiffusionUx.cs index 8907c850..94a70ee7 100644 --- a/StabilityMatrix.Core/Models/Packages/StableDiffusionUx.cs +++ b/StabilityMatrix.Core/Models/Packages/StableDiffusionUx.cs @@ -177,6 +177,9 @@ IPrerequisiteHelper prerequisiteHelper public override string OutputFolderName => "outputs"; + public override IReadOnlyList ExtraLaunchArguments => + settingsManager.IsLibraryDirSet ? ["--gradio-allowed-path", settingsManager.ImagesDirectory] : []; + public override async Task InstallPackage( string installLocation, InstalledPackage installedPackage, @@ -263,33 +266,16 @@ void HandleConsoleOutput(ProcessOutput s) } VenvRunner.RunDetached( - [Path.Combine(installLocation, options.Command ?? LaunchCommand), ..options.Arguments], + [ + Path.Combine(installLocation, options.Command ?? LaunchCommand), + ..options.Arguments, + ..ExtraLaunchArguments + ], HandleConsoleOutput, OnExit ); } - private async Task InstallRocmTorch( - PyVenvRunner venvRunner, - IProgress? progress = null, - Action? onConsoleOutput = null - ) - { - progress?.Report(new ProgressReport(-1f, "Installing PyTorch for ROCm", isIndeterminate: true)); - - await venvRunner.PipInstall(["--upgrade", "pip", "wheel"], onConsoleOutput).ConfigureAwait(false); - - await venvRunner - .PipInstall( - new PipInstallArgs() - .WithTorch("==2.0.1") - .WithTorchVision("==0.15.2") - .WithTorchExtraIndex("rocm5.4.2"), - onConsoleOutput - ) - .ConfigureAwait(false); - } - private class A3WebUiExtensionManager(StableDiffusionUx package) : GitPackageExtensionManager(package.PrerequisiteHelper) { diff --git a/StabilityMatrix.Core/Python/PyVenvRunner.cs b/StabilityMatrix.Core/Python/PyVenvRunner.cs index b984f7f9..378dbb34 100644 --- a/StabilityMatrix.Core/Python/PyVenvRunner.cs +++ b/StabilityMatrix.Core/Python/PyVenvRunner.cs @@ -393,7 +393,7 @@ public async Task> PipList() if (indexUrl is not null) { - args = args.AddArg(("--index-url", indexUrl)); + args = args.AddKeyedArgs("--index-url", ["--index-url", indexUrl]); } var result = await ProcessRunner