Browse Source

fixed invoke install on macos & fixed forge cli args on macos

pull/495/head
jt 9 months ago
parent
commit
bb465b502d
  1. 6
      CHANGELOG.md
  2. 44
      StabilityMatrix.Avalonia/Helpers/UnixPrerequisiteHelper.cs
  3. 2
      StabilityMatrix.Core/Models/Packages/InvokeAI.cs
  4. 14
      StabilityMatrix.Core/Models/Packages/SDWebForge.cs

6
CHANGELOG.md

@ -8,6 +8,8 @@ and this project adheres to [Semantic Versioning 2.0](https://semver.org/spec/v2
## v2.9.0-dev.3
### Fixed
- Fixed StableSwarmUI not installing properly on macOS
- Hopefully actually fixed [#464](https://github.com/LykosAI/StabilityMatrix/issues/464) - error when installing InvokeAI on macOS
- Fixed default command line args for SDWebUI Forge on macOS
## v2.9.0-dev.2
### Added
@ -23,6 +25,10 @@ and this project adheres to [Semantic Versioning 2.0](https://semver.org/spec/v2
- Added extension management for SD.Next and Stable Diffusion WebUI-UX
- Added the ability to choose where CivitAI model downloads are saved
## v2.8.4
### Fixed
- Hopefully actually fixed [#464](https://github.com/LykosAI/StabilityMatrix/issues/464) - error when installing InvokeAI on macOS
## v2.8.3
### Fixed
- Fixed user tokens read error causing failed downloads

44
StabilityMatrix.Avalonia/Helpers/UnixPrerequisiteHelper.cs

@ -1,5 +1,6 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Diagnostics;
using System.IO;
using System.Linq;
@ -311,6 +312,7 @@ public class UnixPrerequisiteHelper(
return ProcessRunner.RunBashCommand(args.Prepend("git").ToArray(), workingDirectory ?? "");
}
[Localizable(false)]
[SupportedOSPlatform("Linux")]
[SupportedOSPlatform("macOS")]
public async Task RunNpm(
@ -320,27 +322,33 @@ public class UnixPrerequisiteHelper(
IReadOnlyDictionary<string, string>? envVars = null
)
{
var command = args.Prepend([NpmPath]);
var process = ProcessRunner.StartAnsiProcess(
NpmPath,
args,
workingDirectory,
onProcessOutput,
envVars
);
var result = await ProcessRunner.RunBashCommand(command.ToArray(), workingDirectory ?? "", envVars);
if (result.ExitCode != 0)
{
Logger.Error(
"npm command [{Command}] failed with exit code " + "{ExitCode}:\n{StdOut}\n{StdErr}",
command,
result.ExitCode,
result.StandardOutput,
result.StandardError
);
await process.WaitForExitAsync();
throw new ProcessException(
$"npm command [{command}] failed with exit code"
+ $" {result.ExitCode}:\n{result.StandardOutput}\n{result.StandardError}"
);
}
if (process.ExitCode == 0)
return;
var stdOut = await process.StandardOutput.ReadToEndAsync();
var stdErr = await process.StandardError.ReadToEndAsync();
onProcessOutput?.Invoke(ProcessOutput.FromStdOutLine(result.StandardOutput));
onProcessOutput?.Invoke(ProcessOutput.FromStdErrLine(result.StandardError));
Logger.Error(
"RunNpm with args [{Args}] failed with exit code " + "{ExitCode}:\n{StdOut}\n{StdErr}",
args,
process.ExitCode,
stdOut,
stdErr
);
throw new ProcessException(
$"RunNpm with args [{args}] failed with exit code" + $" {process.ExitCode}:\n{stdOut}\n{stdErr}"
);
}
[SupportedOSPlatform("Linux")]

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

@ -298,7 +298,7 @@ public class InvokeAI : BaseGitPackage
if (Compat.IsMacOS || Compat.IsLinux)
{
await PrerequisiteHelper
.RunNpm(["i", "vite"], installLocation, envVars: envVars)
.RunNpm(["i", "vite", "--ignore-scripts=true"], installLocation, envVars: envVars)
.ConfigureAwait(false);
}

14
StabilityMatrix.Core/Models/Packages/SDWebForge.cs

@ -66,6 +66,20 @@ public class SDWebForge(
InitialValue = HardwareHelper.PreferDirectML(),
Options = ["--directml"]
},
new LaunchOptionDefinition
{
Name = "Skip Torch CUDA Test",
Type = LaunchOptionType.Bool,
InitialValue = Compat.IsMacOS,
Options = ["--skip-torch-cuda-test"]
},
new LaunchOptionDefinition
{
Name = "No half-precision VAE",
Type = LaunchOptionType.Bool,
InitialValue = Compat.IsMacOS,
Options = ["--no-half-vae"]
},
LaunchOptionDefinition.Extras
];

Loading…
Cancel
Save