Skip to content

Commit

Permalink
Merge pull request LykosAI#590 from ionite34/fix-stuffs
Browse files Browse the repository at this point in the history
Fixed incorrect output path for A3WebUI
  • Loading branch information
mohnjiles committed Apr 7, 2024
2 parents c8ab3a7 + 5441572 commit 60ab7bb
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 11 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning 2.0](https://semver.org/spec/v2
- Updated translations for French, Spanish, and Turkish
### Fixed
- Fixed [#559](https://github.com/LykosAI/StabilityMatrix/issues/559) - "Unable to load bitmap from provided data" error in Checkpoints page
- Fixed [#522](https://github.com/LykosAI/StabilityMatrix/issues/522) - Incorrect output directory path for latest Auto1111

## v2.10.0-pre.2
### Added
Expand Down
5 changes: 5 additions & 0 deletions StabilityMatrix.Avalonia/Services/RunningPackageService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,11 @@ IPyRunner pyRunner
installedPackage.PreferredSharedFolderMethod ?? basePackage.RecommendedSharedFolderMethod
);

if (installedPackage.UseSharedOutputFolder)
{
await basePackage.SetupOutputFolderLinks(installedPackage.FullPath!);
}

// Load user launch args from settings and convert to string
var userArgs = installedPackage.LaunchArgs ?? [];
var userArgsString = string.Join(" ", userArgs.Select(opt => opt.ToArgString()));
Expand Down
17 changes: 11 additions & 6 deletions StabilityMatrix.Core/Models/Packages/A3WebUI.cs
Original file line number Diff line number Diff line change
Expand Up @@ -72,12 +72,12 @@ IPrerequisiteHelper prerequisiteHelper
public override Dictionary<SharedOutputType, IReadOnlyList<string>>? SharedOutputFolders =>
new()
{
[SharedOutputType.Extras] = new[] { "outputs/extras-images" },
[SharedOutputType.Extras] = new[] { "output/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.Img2Img] = new[] { "output/img2img-images" },
[SharedOutputType.Text2Img] = new[] { "output/txt2img-images" },
[SharedOutputType.Img2ImgGrids] = new[] { "output/img2img-grids" },
[SharedOutputType.Text2ImgGrids] = new[] { "output/txt2img-grids" }
};

[SuppressMessage("ReSharper", "ArrangeObjectCreationWhenTypeNotEvident")]
Expand Down Expand Up @@ -184,7 +184,7 @@ IPrerequisiteHelper prerequisiteHelper

public override string MainBranch => "master";

public override string OutputFolderName => "outputs";
public override string OutputFolderName => "output";

public override IPackageExtensionManager ExtensionManager => new A3WebUiExtensionManager(this);

Expand Down Expand Up @@ -294,6 +294,11 @@ void HandleConsoleOutput(ProcessOutput s)
VenvRunner.RunDetached(args.TrimEnd(), HandleConsoleOutput, OnExit);
}

public override string? ExtraLaunchArguments { get; set; } =
settingsManager.IsLibraryDirSet
? $"--gradio-allowed-path \"{settingsManager.ImagesDirectory}\""
: string.Empty;

private class A3WebUiExtensionManager(A3WebUI package)
: GitPackageExtensionManager(package.PrerequisiteHelper)
{
Expand Down
5 changes: 0 additions & 5 deletions StabilityMatrix.Core/Models/Packages/SDWebForge.cs
Original file line number Diff line number Diff line change
Expand Up @@ -178,9 +178,4 @@ torchVersion switch
await venvRunner.PipInstall(pipArgs, onConsoleOutput).ConfigureAwait(false);
progress?.Report(new ProgressReport(1f, "Install complete", isIndeterminate: false));
}

public override string? ExtraLaunchArguments { get; set; } =
settingsManager.IsLibraryDirSet
? $"--gradio-allowed-path \"{settingsManager.ImagesDirectory}\""
: string.Empty;
}

0 comments on commit 60ab7bb

Please sign in to comment.