Browse Source

do some .ToSTrings() on DirectoryPaths so they dont enumerate & log every item

also added jsonmerge to a1111 & some other stuff
pull/438/head
JT 10 months ago
parent
commit
fbe3eb176b
  1. 1
      CHANGELOG.md
  2. 6
      StabilityMatrix.Avalonia/ViewModels/PackageManager/PackageInstallDetailViewModel.cs
  3. 5
      StabilityMatrix.Core/Models/Packages/A3WebUI.cs
  4. 2
      StabilityMatrix.Core/Python/PyVenvRunner.cs
  5. 11
      StabilityMatrix.Core/Services/ImageIndexService.cs

1
CHANGELOG.md

@ -17,6 +17,7 @@ and this project adheres to [Semantic Versioning 2.0](https://semver.org/spec/v2
### Fixed ### Fixed
- Inference file name patterns with directory separator characters will now have the subdirectories created automatically - Inference file name patterns with directory separator characters will now have the subdirectories created automatically
- Fixed missing up/downgrade buttons on the Python Packages dialog when the version was not semver compatible - Fixed missing up/downgrade buttons on the Python Packages dialog when the version was not semver compatible
- Automatic1111 package installs will now install the missing `jsonmerge` package
## v2.8.0-dev.4 ## v2.8.0-dev.4
### Added ### Added

6
StabilityMatrix.Avalonia/ViewModels/PackageManager/PackageInstallDetailViewModel.cs

@ -90,6 +90,9 @@ public partial class PackageInstallDetailViewModel(
OnInstallNameChanged(InstallName); OnInstallNameChanged(InstallName);
SelectedTorchVersion = SelectedPackage.GetRecommendedTorchVersion();
SelectedSharedFolderMethod = SelectedPackage.RecommendedSharedFolderMethod;
allOptions = await SelectedPackage.GetAllVersionOptions(); allOptions = await SelectedPackage.GetAllVersionOptions();
if (ShowReleaseMode) if (ShowReleaseMode)
{ {
@ -100,9 +103,6 @@ public partial class PackageInstallDetailViewModel(
UpdateVersions(); UpdateVersions();
await UpdateCommits(SelectedPackage.MainBranch); await UpdateCommits(SelectedPackage.MainBranch);
} }
SelectedTorchVersion = SelectedPackage.GetRecommendedTorchVersion();
SelectedSharedFolderMethod = SelectedPackage.RecommendedSharedFolderMethod;
} }
[RelayCommand] [RelayCommand]

5
StabilityMatrix.Core/Models/Packages/A3WebUI.cs

@ -187,13 +187,11 @@ public class A3WebUI(
progress?.Report(new ProgressReport(-1f, "Setting up venv", isIndeterminate: true)); progress?.Report(new ProgressReport(-1f, "Setting up venv", isIndeterminate: true));
var venvRunner = await SetupVenv(installLocation, forceRecreate: true).ConfigureAwait(false); var venvRunner = await SetupVenv(installLocation, forceRecreate: true).ConfigureAwait(false);
await venvRunner.PipInstall("--upgrade pip wheel", onConsoleOutput).ConfigureAwait(false); await venvRunner.PipInstall("--upgrade pip wheel", onConsoleOutput).ConfigureAwait(false);
progress?.Report(new ProgressReport(-1f, "Installing requirements...", isIndeterminate: true)); progress?.Report(new ProgressReport(-1f, "Installing requirements...", isIndeterminate: true));
var requirements = new FilePath(installLocation, "requirements_versions.txt"); var requirements = new FilePath(installLocation, "requirements_versions.txt");
var pipArgs = new PipInstallArgs() var pipArgs = new PipInstallArgs()
.WithTorch("==2.0.1") .WithTorch("==2.0.1")
.WithTorchVision("==0.15.2") .WithTorchVision("==0.15.2")
@ -222,6 +220,9 @@ public class A3WebUI(
pipArgs = pipArgs.AddArg("httpx==0.24.1"); pipArgs = pipArgs.AddArg("httpx==0.24.1");
} }
// Add jsonmerge to fix https://github.com/AUTOMATIC1111/stable-diffusion-webui/issues/12482
pipArgs = pipArgs.AddArg("jsonmerge");
await venvRunner.PipInstall(pipArgs, onConsoleOutput).ConfigureAwait(false); await venvRunner.PipInstall(pipArgs, onConsoleOutput).ConfigureAwait(false);
progress?.Report(new ProgressReport(-1f, "Updating configuration", isIndeterminate: true)); progress?.Report(new ProgressReport(-1f, "Updating configuration", isIndeterminate: true));

2
StabilityMatrix.Core/Python/PyVenvRunner.cs

@ -515,7 +515,7 @@ public class PyVenvRunner : IDisposable, IAsyncDisposable
"Launching venv process [{PythonPath}] " "Launching venv process [{PythonPath}] "
+ "in working directory [{WorkingDirectory}] with args {Arguments}", + "in working directory [{WorkingDirectory}] with args {Arguments}",
PythonPath, PythonPath,
WorkingDirectory, WorkingDirectory?.ToString(),
arguments arguments
); );

11
StabilityMatrix.Core/Services/ImageIndexService.cs

@ -26,10 +26,7 @@ public class ImageIndexService : IImageIndexService
this.logger = logger; this.logger = logger;
this.settingsManager = settingsManager; this.settingsManager = settingsManager;
InferenceImages = new IndexCollection<LocalImageFile, string>( InferenceImages = new IndexCollection<LocalImageFile, string>(this, file => file.AbsolutePath)
this,
file => file.AbsolutePath
)
{ {
RelativePath = "Inference" RelativePath = "Inference"
}; };
@ -56,7 +53,7 @@ public class ImageIndexService : IImageIndexService
// Start // Start
var stopwatch = Stopwatch.StartNew(); var stopwatch = Stopwatch.StartNew();
logger.LogInformation("Refreshing images index at {SearchDir}...", searchDir); logger.LogInformation("Refreshing images index at {SearchDir}...", searchDir.ToString());
var toAdd = new ConcurrentBag<LocalImageFile>(); var toAdd = new ConcurrentBag<LocalImageFile>();
@ -64,9 +61,7 @@ public class ImageIndexService : IImageIndexService
{ {
var files = searchDir var files = searchDir
.EnumerateFiles("*.*", SearchOption.AllDirectories) .EnumerateFiles("*.*", SearchOption.AllDirectories)
.Where( .Where(file => LocalImageFile.SupportedImageExtensions.Contains(file.Extension));
file => LocalImageFile.SupportedImageExtensions.Contains(file.Extension)
);
Parallel.ForEach( Parallel.ForEach(
files, files,

Loading…
Cancel
Save