Skip to content

Commit 4b4ad61

Browse files
authored
Merge pull request LykosAI#970 from ionite34/backport/main/pr-966
[dev to main] backport: Fixes n stuff (966)
2 parents 75e7346 + e4a57cd commit 4b4ad61

File tree

10 files changed

+89
-68
lines changed

10 files changed

+89
-68
lines changed

CHANGELOG.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,21 @@ All notable changes to Stability Matrix will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
66
and this project adheres to [Semantic Versioning 2.0](https://semver.org/spec/v2.0.0.html).
77

8+
## v2.13.3
9+
### Changed
10+
- "Remove symbolic links on shutdown" option now also removes links from Output Sharing
11+
### Fixed
12+
- Fixed [#1083](https://github.com/LykosAI/StabilityMatrix/issues/1083) - "Show Nested Models" incorrectly displaying models from some non-nested folders
13+
- Fixed issue with InvokeAI model sharing when the host address is set to 0.0.0.0
14+
- Fixed issue when parsing index URLs in Python Dependencies Override menu
15+
- Fixed issue where models were filtered incorrectly in the Checkpoint Manager
16+
- Fixed ComfyUI-Zluda not using the user-defined pip overrides
17+
### Supporters
18+
#### Visionaries
19+
- A heartfelt thank you to our incredible Visionary-tier Patrons, **Waterclouds** and **TheTekknician**! Your unwavering support means the world to us!
20+
#### Pioneers
21+
- A big shoutout to our outstanding Pioneer-tier Patrons, **tankfox**, **Mr. Unknown**, **Szir777**, and **NowFallenAngel**! We deeply appreciate your ongoing support and dedication!
22+
823
## v2.13.2
924
### Changed
1025
- Removed SimpleSDXL due to security concerns - thanks to @iwr-redmond for the detailed report. For more information please visit https://github.com/LykosAI/StabilityMatrix/security/advisories.

StabilityMatrix.Avalonia/Languages/Resources.Designer.cs

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

StabilityMatrix.Avalonia/Languages/Resources.resx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -418,10 +418,10 @@
418418
<value>Checkpoint Manager</value>
419419
</data>
420420
<data name="Label_RemoveSymlinksOnShutdown" xml:space="preserve">
421-
<value>Remove shared checkpoints directory symbolic links on shutdown</value>
421+
<value>Remove shared folder symbolic links on shutdown</value>
422422
</data>
423423
<data name="Label_RemoveSymlinksOnShutdown_Details" xml:space="preserve">
424-
<value>Select this option if you&apos;re having problems moving Stability Matrix to another drive</value>
424+
<value>Removes both model and output folder symbolic links when closing Stability Matrix. Select this option if you're having problems moving Stability Matrix to another drive</value>
425425
</data>
426426
<data name="Label_ResetCheckpointsCache" xml:space="preserve">
427427
<value>Reset Checkpoints Cache</value>

StabilityMatrix.Avalonia/ViewModels/CheckpointsPageViewModel.cs

Lines changed: 22 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1041,8 +1041,9 @@ private bool FilterModels(LocalModelFile file)
10411041
{
10421042
if (SelectedCategory?.Path is null || SelectedCategory?.Path == settingsManager.ModelsDirectory)
10431043
return file.HasConnectedModel
1044-
? SelectedBaseModels.Contains(file.ConnectedModelInfo.BaseModel ?? "Other")
1045-
: SelectedBaseModels.Contains("Other");
1044+
? SelectedBaseModels.Count == 0
1045+
|| SelectedBaseModels.Contains(file.ConnectedModelInfo.BaseModel ?? "Other")
1046+
: SelectedBaseModels.Count == 0 || SelectedBaseModels.Contains("Other");
10461047

10471048
var folderPath = Path.GetDirectoryName(file.RelativePath);
10481049
var categoryRelativePath = SelectedCategory
@@ -1056,16 +1057,30 @@ private bool FilterModels(LocalModelFile file)
10561057
if (
10571058
(
10581059
file.HasConnectedModel
1059-
? SelectedBaseModels.Contains(file.ConnectedModelInfo?.BaseModel ?? "Other")
1060-
: SelectedBaseModels.Contains("Other")
1060+
? SelectedBaseModels.Count == 0
1061+
|| SelectedBaseModels.Contains(file.ConnectedModelInfo?.BaseModel ?? "Other")
1062+
: SelectedBaseModels.Count == 0 || SelectedBaseModels.Contains("Other")
10611063
)
10621064
is false
10631065
)
10641066
return false;
10651067

1066-
return ShowModelsInSubfolders
1067-
? folderPath.StartsWith(categoryRelativePath)
1068-
: categoryRelativePath.Equals(folderPath);
1068+
// If not showing nested models, just check if the file is directly in this folder
1069+
if (!ShowModelsInSubfolders)
1070+
return categoryRelativePath.Equals(folderPath, StringComparison.OrdinalIgnoreCase);
1071+
1072+
// Split paths into segments
1073+
var categorySegments = categoryRelativePath.Split(Path.DirectorySeparatorChar);
1074+
var folderSegments = folderPath.Split(Path.DirectorySeparatorChar);
1075+
1076+
// Check if folder is a subfolder of category by comparing path segments
1077+
if (folderSegments.Length < categorySegments.Length)
1078+
return false;
1079+
1080+
// Compare each segment of the category path with the folder path
1081+
return !categorySegments
1082+
.Where((t, i) => !t.Equals(folderSegments[i], StringComparison.OrdinalIgnoreCase))
1083+
.Any();
10691084
}
10701085

10711086
private bool FilterCategories(CheckpointCategory category)

StabilityMatrix.Core/Helper/SharedFolders.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -195,6 +195,12 @@ public void RemoveLinksForAllPackages()
195195
.RemoveModelFolderLinks(package.FullPath, sharedFolderMethod)
196196
.GetAwaiter()
197197
.GetResult();
198+
199+
// Remove output folder links if enabled
200+
if (package.UseSharedOutputFolder)
201+
{
202+
basePackage.RemoveOutputFolderLinks(package.FullPath).GetAwaiter().GetResult();
203+
}
198204
}
199205
catch (Exception e)
200206
{

StabilityMatrix.Core/Models/Packages/A3WebUI.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ IPrerequisiteHelper prerequisiteHelper
3939
new("https://github.com/AUTOMATIC1111/stable-diffusion-webui/raw/master/screenshot.png");
4040
public string RelativeArgsDefinitionScriptPath => "modules.cmd_args";
4141

42-
public override PackageDifficulty InstallerSortOrder => PackageDifficulty.Recommended;
42+
public override PackageDifficulty InstallerSortOrder => PackageDifficulty.Simple;
4343

4444
public override SharedFolderMethod RecommendedSharedFolderMethod => SharedFolderMethod.Symlink;
4545

StabilityMatrix.Core/Models/Packages/ComfyZluda.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,11 @@ await requirements.ReadAllTextAsync(cancellationToken).ConfigureAwait(false),
7171

7272
pipArgs = pipArgs.AddArg("numpy==1.26.0");
7373

74+
if (installedPackage.PipOverrides != null)
75+
{
76+
pipArgs = pipArgs.WithUserOverrides(installedPackage.PipOverrides);
77+
}
78+
7479
progress?.Report(
7580
new ProgressReport(-1f, "Installing Package Requirements...", isIndeterminate: true)
7681
);

StabilityMatrix.Core/Models/Packages/InvokeAI.cs

Lines changed: 30 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ public class InvokeAI : BaseGitPackage
2222
{
2323
private static readonly Logger Logger = LogManager.GetCurrentClassLogger();
2424
private const string RelativeRootPath = "invokeai-root";
25-
private string RelativeFrontendBuildPath = Path.Combine("invokeai", "frontend", "web", "dist");
25+
private readonly string relativeFrontendBuildPath = Path.Combine("invokeai", "frontend", "web", "dist");
2626

2727
public override string Name => "InvokeAI";
2828
public override string DisplayName { get; set; } = "InvokeAI";
@@ -35,7 +35,7 @@ public class InvokeAI : BaseGitPackage
3535
public override PackageDifficulty InstallerSortOrder => PackageDifficulty.Nightmare;
3636

3737
public override IReadOnlyList<string> ExtraLaunchCommands =>
38-
new[] { "invokeai-db-maintenance", "invokeai-import-images", };
38+
["invokeai-db-maintenance", "invokeai-import-images"];
3939

4040
public override Uri PreviewImageUri =>
4141
new("https://raw.githubusercontent.com/invoke-ai/InvokeAI/main/docs/assets/canvas_preview.png");
@@ -57,80 +57,50 @@ IPrerequisiteHelper prerequisiteHelper
5757
public override Dictionary<SharedFolderType, IReadOnlyList<string>> SharedFolders =>
5858
new()
5959
{
60-
[SharedFolderType.StableDiffusion] = new[]
61-
{
62-
Path.Combine(RelativeRootPath, "autoimport", "main")
63-
},
64-
[SharedFolderType.Lora] = new[] { Path.Combine(RelativeRootPath, "autoimport", "lora") },
65-
[SharedFolderType.TextualInversion] = new[]
66-
{
67-
Path.Combine(RelativeRootPath, "autoimport", "embedding")
68-
},
69-
[SharedFolderType.ControlNet] = new[]
70-
{
71-
Path.Combine(RelativeRootPath, "autoimport", "controlnet")
72-
},
73-
[SharedFolderType.InvokeIpAdapters15] = new[]
74-
{
60+
[SharedFolderType.StableDiffusion] = [Path.Combine(RelativeRootPath, "autoimport", "main")],
61+
[SharedFolderType.Lora] = [Path.Combine(RelativeRootPath, "autoimport", "lora")],
62+
[SharedFolderType.TextualInversion] = [Path.Combine(RelativeRootPath, "autoimport", "embedding")],
63+
[SharedFolderType.ControlNet] = [Path.Combine(RelativeRootPath, "autoimport", "controlnet")],
64+
[SharedFolderType.InvokeIpAdapters15] =
65+
[
7566
Path.Combine(RelativeRootPath, "models", "sd-1", "ip_adapter")
76-
},
77-
[SharedFolderType.InvokeIpAdaptersXl] = new[]
78-
{
67+
],
68+
[SharedFolderType.InvokeIpAdaptersXl] =
69+
[
7970
Path.Combine(RelativeRootPath, "models", "sdxl", "ip_adapter")
80-
},
81-
[SharedFolderType.InvokeClipVision] = new[]
82-
{
71+
],
72+
[SharedFolderType.InvokeClipVision] =
73+
[
8374
Path.Combine(RelativeRootPath, "models", "any", "clip_vision")
84-
},
85-
[SharedFolderType.T2IAdapter] = new[]
86-
{
87-
Path.Combine(RelativeRootPath, "autoimport", "t2i_adapter")
88-
}
75+
],
76+
[SharedFolderType.T2IAdapter] = [Path.Combine(RelativeRootPath, "autoimport", "t2i_adapter")]
8977
};
9078

9179
public override Dictionary<SharedOutputType, IReadOnlyList<string>>? SharedOutputFolders =>
92-
new() { [SharedOutputType.Text2Img] = new[] { Path.Combine("invokeai-root", "outputs", "images") } };
80+
new() { [SharedOutputType.Text2Img] = [Path.Combine("invokeai-root", "outputs", "images")] };
9381

9482
public override string OutputFolderName => Path.Combine("invokeai-root", "outputs", "images");
9583

9684
// https://github.com/invoke-ai/InvokeAI/blob/main/docs/features/CONFIGURATION.md
9785
public override List<LaunchOptionDefinition> LaunchOptions =>
9886
[
99-
new LaunchOptionDefinition
100-
{
101-
Name = "Host",
102-
Type = LaunchOptionType.String,
103-
DefaultValue = "localhost",
104-
Options = ["--host"]
105-
},
106-
new LaunchOptionDefinition
87+
new()
10788
{
108-
Name = "Port",
89+
Name = "Root Directory",
10990
Type = LaunchOptionType.String,
110-
DefaultValue = "9090",
111-
Options = ["--port"]
91+
Options = ["--root"]
11292
},
113-
new LaunchOptionDefinition
93+
new()
11494
{
115-
Name = "Allow Origins",
116-
Description =
117-
"List of host names or IP addresses that are allowed to connect to the "
118-
+ "InvokeAI API in the format ['host1','host2',...]",
95+
Name = "Config File",
11996
Type = LaunchOptionType.String,
120-
DefaultValue = "[]",
121-
Options = ["--allow-origins"]
122-
},
123-
new LaunchOptionDefinition
124-
{
125-
Name = "Precision",
126-
Type = LaunchOptionType.Bool,
127-
Options = ["--precision auto", "--precision float16", "--precision float32"]
97+
Options = ["--config"]
12898
},
12999
LaunchOptionDefinition.Extras
130100
];
131101

132102
public override IEnumerable<TorchIndex> AvailableTorchIndices =>
133-
new[] { TorchIndex.Cpu, TorchIndex.Cuda, TorchIndex.Rocm, TorchIndex.Mps };
103+
[TorchIndex.Cpu, TorchIndex.Cuda, TorchIndex.Rocm, TorchIndex.Mps];
134104

135105
public override TorchIndex GetRecommendedTorchVersion()
136106
{
@@ -325,7 +295,7 @@ private async Task RunInvokeCommand(
325295
VenvRunner.UpdateEnvironmentVariables(env => GetEnvVars(env, installedPackagePath));
326296

327297
// fix frontend build missing for people who updated to v3.6 before the fix
328-
var frontendExistsPath = Path.Combine(installedPackagePath, RelativeFrontendBuildPath);
298+
var frontendExistsPath = Path.Combine(installedPackagePath, relativeFrontendBuildPath);
329299
if (!Directory.Exists(frontendExistsPath))
330300
{
331301
await SetupAndBuildInvokeFrontend(
@@ -422,6 +392,11 @@ ProcessOutput s
422392
)
423393
{
424394
var invokeAiUrl = match.Value;
395+
if (invokeAiUrl.Contains("0.0.0.0"))
396+
{
397+
invokeAiUrl = invokeAiUrl.Replace("0.0.0.0", "127.0.0.1");
398+
}
399+
425400
var invokeAiApi = RestService.For<IInvokeAiApi>(
426401
invokeAiUrl,
427402
new RefitSettings

StabilityMatrix.Core/Models/Packages/StableDiffusionDirectMl.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ IPrerequisiteHelper prerequisiteHelper
3636
public override TorchIndex GetRecommendedTorchVersion() =>
3737
HardwareHelper.PreferDirectMLOrZluda() ? TorchIndex.DirectMl : base.GetRecommendedTorchVersion();
3838

39-
public override PackageDifficulty InstallerSortOrder => PackageDifficulty.Recommended;
39+
public override PackageDifficulty InstallerSortOrder => PackageDifficulty.Simple;
4040

4141
public override List<LaunchOptionDefinition> LaunchOptions
4242
{

StabilityMatrix.Core/Python/PipInstallArgs.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,11 @@ public PipInstallArgs WithUserOverrides(List<PipPackageSpecifierOverride> overri
6565
if (string.IsNullOrWhiteSpace(pipOverride.Name))
6666
continue;
6767

68+
if (pipOverride.Name is "--extra-index-url" or "--index-url")
69+
{
70+
pipOverride.Constraint = "=";
71+
}
72+
6873
var pipOverrideArg = pipOverride.ToArgument();
6974

7075
if (pipOverride.Action is PipPackageSpecifierOverrideAction.Update)

0 commit comments

Comments
 (0)