Browse Source

Merge pull request #585 from ionite34/fix-invoke-and-civit

Fix invoke and civit
pull/557/head
JT 8 months ago committed by GitHub
parent
commit
f224c77349
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 7
      CHANGELOG.md
  2. 2
      StabilityMatrix.Avalonia/DesignData/DesignData.cs
  3. 2
      StabilityMatrix.Avalonia/ViewModels/CheckpointBrowser/CheckpointBrowserCardViewModel.cs
  4. 2
      StabilityMatrix.Avalonia/ViewModels/Dialogs/SelectModelVersionViewModel.cs
  5. 4
      StabilityMatrix.Core/Models/Api/CivitImage.cs
  6. 57
      StabilityMatrix.Core/Models/Packages/InvokeAI.cs

7
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/), 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). 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 ## v2.9.2
### Changed ### Changed
- Due to changes with the CivitAI API, you can no longer select a specific page in the CivitAI Model Browser - Due to changes with the CivitAI API, you can no longer select a specific page in the CivitAI Model Browser

2
StabilityMatrix.Avalonia/DesignData/DesignData.cs

@ -345,7 +345,7 @@ public static class DesignData
{ {
new() new()
{ {
Nsfw = "None", NsfwLevel = 1,
Url = Url =
"https://image.civitai.com/xG1nkqKTMzGDvpLrqFT7WA/" "https://image.civitai.com/xG1nkqKTMzGDvpLrqFT7WA/"
+ "78fd2a0a-42b6-42b0-9815-81cb11bb3d05/00009-2423234823.jpeg" + "78fd2a0a-42b6-42b0-9815-81cb11bb3d05/00009-2423234823.jpeg"

2
StabilityMatrix.Avalonia/ViewModels/CheckpointBrowser/CheckpointBrowserCardViewModel.cs

@ -158,7 +158,7 @@ public partial class CheckpointBrowserCardViewModel : Base.ProgressViewModel
// Try to find a valid image // Try to find a valid image
var image = images var image = images
?.Where(img => LocalModelFile.SupportedImageExtensions.Any(img.Url.Contains)) ?.Where(img => LocalModelFile.SupportedImageExtensions.Any(img.Url.Contains))
.FirstOrDefault(image => nsfwEnabled || image.Nsfw == "None"); .FirstOrDefault(image => nsfwEnabled || image.NsfwLevel <= 1);
if (image != null) if (image != null)
{ {
CardImage = new Uri(image.Url); CardImage = new Uri(image.Url);

2
StabilityMatrix.Avalonia/ViewModels/Dialogs/SelectModelVersionViewModel.cs

@ -99,7 +99,7 @@ public partial class SelectModelVersionViewModel(
var allImages = value var allImages = value
?.ModelVersion ?.ModelVersion
?.Images ?.Images
?.Where(img => nsfwEnabled || img.Nsfw == "None") ?.Where(img => nsfwEnabled || img.NsfwLevel <= 1)
?.Select(x => new ImageSource(x.Url)) ?.Select(x => new ImageSource(x.Url))
.ToList(); .ToList();

4
StabilityMatrix.Core/Models/Api/CivitImage.cs

@ -7,8 +7,8 @@ public class CivitImage
[JsonPropertyName("url")] [JsonPropertyName("url")]
public string Url { get; set; } public string Url { get; set; }
[JsonPropertyName("nsfw")] [JsonPropertyName("nsfwLevel")]
public string Nsfw { get; set; } public int? NsfwLevel { get; set; }
[JsonPropertyName("width")] [JsonPropertyName("width")]
public int Width { get; set; } public int Width { get; set; }

57
StabilityMatrix.Core/Models/Packages/InvokeAI.cs

@ -32,23 +32,14 @@ public class InvokeAI : BaseGitPackage
public override PackageDifficulty InstallerSortOrder => PackageDifficulty.Nightmare; public override PackageDifficulty InstallerSortOrder => PackageDifficulty.Nightmare;
public override IReadOnlyList<string> ExtraLaunchCommands => public override IReadOnlyList<string> ExtraLaunchCommands =>
new[] new[] { "invokeai-db-maintenance", "invokeai-import-images", };
{
"invokeai-configure",
"invokeai-merge",
"invokeai-metadata",
"invokeai-model-install",
"invokeai-node-cli",
"invokeai-ti",
"invokeai-update",
};
public override Uri PreviewImageUri => public override Uri PreviewImageUri =>
new("https://raw.githubusercontent.com/invoke-ai/InvokeAI/main/docs/assets/canvas_preview.png"); new("https://raw.githubusercontent.com/invoke-ai/InvokeAI/main/docs/assets/canvas_preview.png");
public override IEnumerable<SharedFolderMethod> AvailableSharedFolderMethods => public override IEnumerable<SharedFolderMethod> AvailableSharedFolderMethods =>
new[] { SharedFolderMethod.Symlink, SharedFolderMethod.None }; new[] { SharedFolderMethod.None };
public override SharedFolderMethod RecommendedSharedFolderMethod => SharedFolderMethod.Symlink; public override SharedFolderMethod RecommendedSharedFolderMethod => SharedFolderMethod.None;
public override string MainBranch => "main"; public override string MainBranch => "main";
@ -127,23 +118,11 @@ public class InvokeAI : BaseGitPackage
Options = ["--allow-origins"] Options = ["--allow-origins"]
}, },
new LaunchOptionDefinition new LaunchOptionDefinition
{
Name = "Always use CPU",
Type = LaunchOptionType.Bool,
Options = ["--always_use_cpu"]
},
new LaunchOptionDefinition
{ {
Name = "Precision", Name = "Precision",
Type = LaunchOptionType.Bool, Type = LaunchOptionType.Bool,
Options = ["--precision auto", "--precision float16", "--precision float32"] 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 LaunchOptionDefinition.Extras
]; ];
@ -223,9 +202,9 @@ public class InvokeAI : BaseGitPackage
await venvRunner await venvRunner
.PipInstall( .PipInstall(
new PipInstallArgs(args.Any() ? args.ToArray() : Array.Empty<Argument>()) new PipInstallArgs(args.Any() ? args.ToArray() : Array.Empty<Argument>())
.WithTorch("==2.1.2") .WithTorch("==2.2.1")
.WithTorchVision("==0.16.2") .WithTorchVision("==0.17.1")
.WithXFormers("==0.0.23post1") .WithXFormers("==0.0.25")
.WithTorchExtraIndex("cu121"), .WithTorchExtraIndex("cu121"),
onConsoleOutput onConsoleOutput
) )
@ -262,24 +241,6 @@ public class InvokeAI : BaseGitPackage
.ConfigureAwait(false); .ConfigureAwait(false);
await venvRunner.PipInstall("rich packaging python-dotenv", onConsoleOutput).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)); progress?.Report(new ProgressReport(1f, "Done!", isIndeterminate: false));
} }
@ -362,12 +323,6 @@ public class InvokeAI : BaseGitPackage
await SetupVenv(installedPackagePath).ConfigureAwait(false); await SetupVenv(installedPackagePath).ConfigureAwait(false);
arguments = command switch
{
"invokeai-configure" => "--yes --skip-sd-weights",
_ => arguments
};
VenvRunner.EnvironmentVariables = GetEnvVars(installedPackagePath); VenvRunner.EnvironmentVariables = GetEnvVars(installedPackagePath);
// fix frontend build missing for people who updated to v3.6 before the fix // fix frontend build missing for people who updated to v3.6 before the fix

Loading…
Cancel
Save