From 67ce55d429ba29542367a78f6db89679c9200de0 Mon Sep 17 00:00:00 2001 From: JT Date: Wed, 3 Apr 2024 19:28:04 -0700 Subject: [PATCH 1/5] Fixed invoke install/run failing & fixed model browser not showing any images --- CHANGELOG.md | 7 +++ .../DesignData/DesignData.cs | 2 +- .../CheckpointBrowserCardViewModel.cs | 2 +- .../Dialogs/SelectModelVersionViewModel.cs | 2 +- StabilityMatrix.Core/Models/Api/CivitImage.cs | 14 ++--- .../Models/Packages/InvokeAI.cs | 57 ++----------------- 6 files changed, 23 insertions(+), 61 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index cebef51c..cb439da1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,13 @@ 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.9.3 +### Changed +- Removed Symlink option for InvokeAI to prevent InvokeAI from moving models into its own directories (will be replaced with a Config option in a future update) +### Fixed +- Fixed images not appearing in Civitai Model Browser when "Show NSFW" was disabled +- Fixed [#556](https://github.com/LykosAI/StabilityMatrix/issues/556) - "Could not find entry point for InvokeAI" error + ## v2.9.2 ### Changed - Due to changes with the CivitAI API, you can no longer select a specific page in the CivitAI Model Browser diff --git a/StabilityMatrix.Avalonia/DesignData/DesignData.cs b/StabilityMatrix.Avalonia/DesignData/DesignData.cs index 9cabf8af..263ae811 100644 --- a/StabilityMatrix.Avalonia/DesignData/DesignData.cs +++ b/StabilityMatrix.Avalonia/DesignData/DesignData.cs @@ -345,7 +345,7 @@ public static class DesignData { new() { - Nsfw = "None", + NsfwLevel = 1, Url = "https://image.civitai.com/xG1nkqKTMzGDvpLrqFT7WA/" + "78fd2a0a-42b6-42b0-9815-81cb11bb3d05/00009-2423234823.jpeg" diff --git a/StabilityMatrix.Avalonia/ViewModels/CheckpointBrowser/CheckpointBrowserCardViewModel.cs b/StabilityMatrix.Avalonia/ViewModels/CheckpointBrowser/CheckpointBrowserCardViewModel.cs index 148712c0..048a6c3d 100644 --- a/StabilityMatrix.Avalonia/ViewModels/CheckpointBrowser/CheckpointBrowserCardViewModel.cs +++ b/StabilityMatrix.Avalonia/ViewModels/CheckpointBrowser/CheckpointBrowserCardViewModel.cs @@ -158,7 +158,7 @@ public partial class CheckpointBrowserCardViewModel : Base.ProgressViewModel // Try to find a valid image var image = images ?.Where(img => LocalModelFile.SupportedImageExtensions.Any(img.Url.Contains)) - .FirstOrDefault(image => nsfwEnabled || image.Nsfw == "None"); + .FirstOrDefault(image => nsfwEnabled || image.NsfwLevel <= 1); if (image != null) { CardImage = new Uri(image.Url); diff --git a/StabilityMatrix.Avalonia/ViewModels/Dialogs/SelectModelVersionViewModel.cs b/StabilityMatrix.Avalonia/ViewModels/Dialogs/SelectModelVersionViewModel.cs index 9ef4c378..2cf7f264 100644 --- a/StabilityMatrix.Avalonia/ViewModels/Dialogs/SelectModelVersionViewModel.cs +++ b/StabilityMatrix.Avalonia/ViewModels/Dialogs/SelectModelVersionViewModel.cs @@ -99,7 +99,7 @@ public partial class SelectModelVersionViewModel( var allImages = value ?.ModelVersion ?.Images - ?.Where(img => nsfwEnabled || img.Nsfw == "None") + ?.Where(img => nsfwEnabled || img.NsfwLevel <= 1) ?.Select(x => new ImageSource(x.Url)) .ToList(); diff --git a/StabilityMatrix.Core/Models/Api/CivitImage.cs b/StabilityMatrix.Core/Models/Api/CivitImage.cs index 0cab1b50..82aadce2 100644 --- a/StabilityMatrix.Core/Models/Api/CivitImage.cs +++ b/StabilityMatrix.Core/Models/Api/CivitImage.cs @@ -6,18 +6,18 @@ public class CivitImage { [JsonPropertyName("url")] public string Url { get; set; } - - [JsonPropertyName("nsfw")] - public string Nsfw { get; set; } - + + [JsonPropertyName("nsfwLevel")] + public int? NsfwLevel { get; set; } + [JsonPropertyName("width")] public int Width { get; set; } - + [JsonPropertyName("height")] public int Height { get; set; } - + [JsonPropertyName("hash")] public string Hash { get; set; } - + // TODO: "meta" ( object? ) } diff --git a/StabilityMatrix.Core/Models/Packages/InvokeAI.cs b/StabilityMatrix.Core/Models/Packages/InvokeAI.cs index 6502f292..625a76f9 100644 --- a/StabilityMatrix.Core/Models/Packages/InvokeAI.cs +++ b/StabilityMatrix.Core/Models/Packages/InvokeAI.cs @@ -32,23 +32,14 @@ public class InvokeAI : BaseGitPackage public override PackageDifficulty InstallerSortOrder => PackageDifficulty.Nightmare; public override IReadOnlyList ExtraLaunchCommands => - new[] - { - "invokeai-configure", - "invokeai-merge", - "invokeai-metadata", - "invokeai-model-install", - "invokeai-node-cli", - "invokeai-ti", - "invokeai-update", - }; + new[] { "invokeai-db-maintenance", "invokeai-import-images", }; public override Uri PreviewImageUri => new("https://raw.githubusercontent.com/invoke-ai/InvokeAI/main/docs/assets/canvas_preview.png"); public override IEnumerable AvailableSharedFolderMethods => - new[] { SharedFolderMethod.Symlink, SharedFolderMethod.None }; - public override SharedFolderMethod RecommendedSharedFolderMethod => SharedFolderMethod.Symlink; + new[] { SharedFolderMethod.None }; + public override SharedFolderMethod RecommendedSharedFolderMethod => SharedFolderMethod.None; public override string MainBranch => "main"; @@ -127,23 +118,11 @@ public class InvokeAI : BaseGitPackage Options = ["--allow-origins"] }, new LaunchOptionDefinition - { - Name = "Always use CPU", - Type = LaunchOptionType.Bool, - Options = ["--always_use_cpu"] - }, - new LaunchOptionDefinition { Name = "Precision", Type = LaunchOptionType.Bool, Options = ["--precision auto", "--precision float16", "--precision float32"] }, - new LaunchOptionDefinition - { - Name = "Aggressively free up GPU memory after each operation", - Type = LaunchOptionType.Bool, - Options = ["--free_gpu_mem"] - }, LaunchOptionDefinition.Extras ]; @@ -223,9 +202,9 @@ public class InvokeAI : BaseGitPackage await venvRunner .PipInstall( new PipInstallArgs(args.Any() ? args.ToArray() : Array.Empty()) - .WithTorch("==2.1.2") - .WithTorchVision("==0.16.2") - .WithXFormers("==0.0.23post1") + .WithTorch("==2.2.1") + .WithTorchVision("==0.17.1") + .WithXFormers("==0.0.25") .WithTorchExtraIndex("cu121"), onConsoleOutput ) @@ -262,24 +241,6 @@ public class InvokeAI : BaseGitPackage .ConfigureAwait(false); await venvRunner.PipInstall("rich packaging python-dotenv", onConsoleOutput).ConfigureAwait(false); - - progress?.Report(new ProgressReport(-1f, "Configuring InvokeAI", isIndeterminate: true)); - - // need to setup model links before running invokeai-configure so it can do its conversion - await SetupModelFolders(installLocation, selectedSharedFolderMethod).ConfigureAwait(false); - - await RunInvokeCommand( - installLocation, - "invokeai-configure", - "--yes --skip-sd-weights", - true, - onConsoleOutput, - spam3: true - ) - .ConfigureAwait(false); - - await VenvRunner.Process.WaitForExitAsync(); - progress?.Report(new ProgressReport(1f, "Done!", isIndeterminate: false)); } @@ -362,12 +323,6 @@ public class InvokeAI : BaseGitPackage await SetupVenv(installedPackagePath).ConfigureAwait(false); - arguments = command switch - { - "invokeai-configure" => "--yes --skip-sd-weights", - _ => arguments - }; - VenvRunner.EnvironmentVariables = GetEnvVars(installedPackagePath); // fix frontend build missing for people who updated to v3.6 before the fix From c6a8722ab2570ea1b770e09f61d8bb1e1ce2a93b Mon Sep 17 00:00:00 2001 From: Ionite Date: Fri, 5 Apr 2024 02:17:56 -0400 Subject: [PATCH 2/5] Fix dmg build script (cherry picked from commit 2d95adbda7f7786e155bb7e9bb7aa3debb1de536) --- .github/workflows/release.yml | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index ffad36eb..320b8bc9 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -257,13 +257,11 @@ jobs: - uses: actions/setup-node@v4 with: - node-version: '20.x' + node-version: '20.11.x' - name: Install dependencies for dmg creation - run: > - npm install --global create-dmg - brew install graphicsmagick imagemagick - + run: brew install graphicsmagick imagemagick && npm install --global create-dmg + - name: Create dmg working-directory: signing run: > From 2a22a43cc8e3f6015e8a3f2349c9a786c4902923 Mon Sep 17 00:00:00 2001 From: JT Date: Wed, 10 Apr 2024 18:51:20 -0700 Subject: [PATCH 3/5] Fixed double 2.9.2 changelog --- CHANGELOG.md | 9 --------- 1 file changed, 9 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5648ef9f..d14f30f9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -111,15 +111,6 @@ and this project adheres to [Semantic Versioning 2.0](https://semver.org/spec/v2 - Fixed images not appearing in Civitai Model Browser when "Show NSFW" was disabled - Fixed [#556](https://github.com/LykosAI/StabilityMatrix/issues/556) - "Could not find entry point for InvokeAI" error -## v2.9.2 -### Changed -- Model download location selector now searches all subfolders -### Fixed -- Fixed Civitai model browser not showing images when "Show NSFW" is disabled -- Fixed crash when Installed Workflows page is opened with no Workflows folder -- Fixed progress bars not displaying properly during package installs & updates -- Fixed ComfyUI extension updates not running install.py / updating requirements.txt - ## v2.9.2 ### Changed - Due to changes with the CivitAI API, you can no longer select a specific page in the CivitAI Model Browser From ef25d5b944aacfc1b507c272bbde97620befbee0 Mon Sep 17 00:00:00 2001 From: JT Date: Fri, 12 Apr 2024 18:26:05 -0700 Subject: [PATCH 4/5] Fix Inference teaching tip showing more often & fix `--launch-package` argument not working --- CHANGELOG.md | 5 +++ .../Inference/PromptCardViewModel.cs | 4 ++ .../ViewModels/PackageManagerViewModel.cs | 45 ++++++++++++++++--- 3 files changed, 49 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 546b1b81..ecc12f07 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,11 @@ 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.1 +### Fixed +- Fixed [#584](https://github.com/LykosAI/StabilityMatrix/issues/584) - `--launch-package` argument not working +- Fixed [#581](https://github.com/LykosAI/StabilityMatrix/issues/581) - Inference teaching tip showing more often than it should + ## v2.10.0 ### Added - Added Reference-Only mode for Inference ControlNet, used for guiding the sampler with an image without a pretrained model. Part of the latent and attention layers will be connected to the reference image, similar to Image to Image or Inpainting. diff --git a/StabilityMatrix.Avalonia/ViewModels/Inference/PromptCardViewModel.cs b/StabilityMatrix.Avalonia/ViewModels/Inference/PromptCardViewModel.cs index 919e4e30..cbae5b9c 100644 --- a/StabilityMatrix.Avalonia/ViewModels/Inference/PromptCardViewModel.cs +++ b/StabilityMatrix.Avalonia/ViewModels/Inference/PromptCardViewModel.cs @@ -104,6 +104,10 @@ public partial class PromptCardViewModel : LoadableViewModelBase, IParametersLoa if (!settingsManager.Settings.SeenTeachingTips.Contains(TeachingTip.InferencePromptHelpButtonTip)) { IsHelpButtonTeachingTipOpen = true; + settingsManager.Transaction(settings => + { + settings.SeenTeachingTips.Add(TeachingTip.InferencePromptHelpButtonTip); + }); } } diff --git a/StabilityMatrix.Avalonia/ViewModels/PackageManagerViewModel.cs b/StabilityMatrix.Avalonia/ViewModels/PackageManagerViewModel.cs index 9d59df05..faf3e63f 100644 --- a/StabilityMatrix.Avalonia/ViewModels/PackageManagerViewModel.cs +++ b/StabilityMatrix.Avalonia/ViewModels/PackageManagerViewModel.cs @@ -42,6 +42,7 @@ public partial class PackageManagerViewModel : PageViewModelBase private readonly INotificationService notificationService; private readonly INavigationService packageNavigationService; private readonly ILogger logger; + private readonly RunningPackageService runningPackageService; public override string Title => Resources.Label_Packages; public override IconSource IconSource => new SymbolIconSource { Symbol = Symbol.Box, IsFilled = true }; @@ -69,7 +70,8 @@ public partial class PackageManagerViewModel : PageViewModelBase ServiceManager dialogFactory, INotificationService notificationService, INavigationService packageNavigationService, - ILogger logger + ILogger logger, + RunningPackageService runningPackageService ) { this.settingsManager = settingsManager; @@ -77,6 +79,7 @@ public partial class PackageManagerViewModel : PageViewModelBase this.notificationService = notificationService; this.packageNavigationService = packageNavigationService; this.logger = logger; + this.runningPackageService = runningPackageService; EventManager.Instance.InstalledPackagesChanged += OnInstalledPackagesChanged; EventManager.Instance.OneClickInstallFinished += OnOneClickInstallFinished; @@ -118,15 +121,39 @@ public partial class PackageManagerViewModel : PageViewModelBase unknownInstalledPackages.Edit(s => s.Load(packages)); } + protected override async Task OnInitialLoadedAsync() + { + if (string.IsNullOrWhiteSpace(Program.Args.LaunchPackageName)) + { + await base.OnInitialLoadedAsync(); + return; + } + + await LoadPackages(); + + var package = Packages.FirstOrDefault(x => x.DisplayName == Program.Args.LaunchPackageName); + if (package is not null) + { + await runningPackageService.StartPackage(package); + return; + } + + package = Packages.FirstOrDefault(x => x.Id.ToString() == Program.Args.LaunchPackageName); + if (package is null) + { + await base.OnInitialLoadedAsync(); + return; + } + + await runningPackageService.StartPackage(package); + } + public override async Task OnLoadedAsync() { if (Design.IsDesignMode || !settingsManager.IsLibraryDirSet) return; - installedPackages.EditDiff(settingsManager.Settings.InstalledPackages, InstalledPackage.Comparer); - - var currentUnknown = await Task.Run(IndexUnknownPackages); - unknownInstalledPackages.Edit(s => s.Load(currentUnknown)); + await LoadPackages(); timer.Start(); } @@ -142,6 +169,14 @@ public partial class PackageManagerViewModel : PageViewModelBase NavigateToSubPage(typeof(PackageInstallBrowserViewModel)); } + private async Task LoadPackages() + { + installedPackages.EditDiff(settingsManager.Settings.InstalledPackages, InstalledPackage.Comparer); + + var currentUnknown = await Task.Run(IndexUnknownPackages); + unknownInstalledPackages.Edit(s => s.Load(currentUnknown)); + } + private async Task CheckPackagesForUpdates() { foreach (var package in PackageCards) From 68a9968794b2b3f6480a77ad4f05def4478a4112 Mon Sep 17 00:00:00 2001 From: JT Date: Fri, 12 Apr 2024 20:21:18 -0700 Subject: [PATCH 5/5] twoway? --- StabilityMatrix.Avalonia/Controls/Inference/PromptCard.axaml | 2 +- .../ViewModels/Inference/PromptCardViewModel.cs | 4 ---- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/StabilityMatrix.Avalonia/Controls/Inference/PromptCard.axaml b/StabilityMatrix.Avalonia/Controls/Inference/PromptCard.axaml index 12423e48..7539cbde 100644 --- a/StabilityMatrix.Avalonia/Controls/Inference/PromptCard.axaml +++ b/StabilityMatrix.Avalonia/Controls/Inference/PromptCard.axaml @@ -72,7 +72,7 @@ + IsOpen="{Binding IsHelpButtonTeachingTipOpen, Mode=TwoWay}"/>