Skip to content

Commit 3ee8887

Browse files
authored
Merge pull request LykosAI#1121 from ionite34/fix-litedb-case-sensitivity
Fix litedb case sensitivity
2 parents ab11220 + c268324 commit 3ee8887

5 files changed

Lines changed: 55 additions & 18 deletions

File tree

CHANGELOG.md

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ 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.15.0-dev.3
8+
## v2.15.0-pre.1
99
### Added
1010
- Added settings to disable base models from appearing in the Checkpoint Manager and Civitai Model Browser base model selectors
1111
- Added Inference "Favorite Dimensions" quick selector - editable in Settings → Inference, or click the 💾 button inside the dropdown
@@ -14,9 +14,17 @@ and this project adheres to [Semantic Versioning 2.0](https://semver.org/spec/v2
1414
- Added "Select All" button to the Installed Extensions page
1515
- Added experimental ROCm pytorch install for ComfyUI (non-Zluda) on Windows - requires a compatible AMD GPU
1616
- Added base model type labels (SD1.5, SDXL, Flux, etc.) to Inference model selection boxes
17+
- Added UNET shared folder link for SD.Next
1718
- Added Ukrainian translation thanks to @r0ddty!
1819
### Changed
19-
- Redesigned Civitai model details page
20+
🌟 Civitai Model Details: A Grand Reimagining! 🌟
21+
- No more peering through a tiny window! Introducing a massive overhaul of the Civitai Model Details page, transforming it from a cramped dialog into a spacious, feature-rich hub for all your model exploration needs.
22+
- We've listened to your howls for more, and now you can dive deep into every aspect of your favorite models with unprecedented clarity and control:
23+
- Expansive View: The new full-page layout means all essential information, descriptions, and previews are laid out beautifully, banishing the old, restrictive dialog forever.
24+
- Rich Details at a Glance: Author, base model, last updated, SHA hashes, file name overrides/patterns – everything you need, perfectly organized and always accessible.
25+
- Overhauled Image Viewer: Enjoy a sleek, modern image viewer that includes Civitai metadata and supports zooming, panning, and full-screen viewing. No more squinting at tiny thumbnails!
26+
- Integrated Inference Options: For supported models, adjust sampler, scheduler, steps, CFG Scale, width, and height directly from the details page, streamlining your workflow like never before!
27+
----
2028
- You can now select release versions when installing ComfyUI
2129
- You can no longer select branches when installing InvokeAI
2230
- Updated InvokeAI install to use pinned torch index from release tag
@@ -26,11 +34,17 @@ and this project adheres to [Semantic Versioning 2.0](https://semver.org/spec/v2
2634
- Removed disclaimer from reForge since the author is now active again
2735
- Updated git operations to better avoid conflicts
2836
- Updated Japanese translation
37+
- Undo ComfyUI process tracking changes for now due to causing more issues than it solved
38+
- Updated GPU parsing fallback on Linux systems to use the method provided by @irql-notlessorequal
2939
### Fixed
3040
- Fixed Civitai-generated image parsing in Inference
3141
- Fixed some first-time setup crashes from missing prerequisites
3242
- Fixed one-click installer not using default preferred Python version
3343
- Fixed updating from old installs of InvokeAI using old frontend
44+
- Fixed [#1357](https://github.com/LykosAI/StabilityMatrix/issues/1357) - Case insensitivity causing duplicate key exceptions on non-Windows systems
45+
### Supporters
46+
#### 🌟 Visionaries
47+
To our brilliant Visionary-tier Patrons: **Waterclouds**, **Corey T**, **bluepopsicle**, **Bob S**, **Ibixat**, and **whudunit** — your support is the spark that keeps Stability Matrix blazing forward. Thanks to you, we can explore bolder features, tackle complex challenges, and keep making the impossible feel effortless. Thank you all so very much! 🚀
3448

3549
## v2.15.0-dev.2
3650
### Added

StabilityMatrix.Core/Database/LiteDbContext.cs

Lines changed: 25 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
using System.Collections.Immutable;
2+
using System.Globalization;
3+
using AsyncAwaitBestPractices;
24
using LiteDB;
35
using LiteDB.Async;
6+
using LiteDB.Engine;
47
using Microsoft.Extensions.Logging;
58
using Microsoft.Extensions.Options;
69
using StabilityMatrix.Core.Extensions;
@@ -73,8 +76,24 @@ private LiteDatabaseAsync CreateDatabase()
7376
{
7477
var dbPath = Path.Combine(settingsManager.LibraryDir, "StabilityMatrix.db");
7578
db = new LiteDatabaseAsync(
76-
new ConnectionString() { Filename = dbPath, Connection = ConnectionType.Shared, }
79+
new ConnectionString { Filename = dbPath, Connection = ConnectionType.Shared }
7780
);
81+
82+
var sortOption = db.Collation.SortOptions;
83+
if (sortOption is not CompareOptions.Ordinal)
84+
{
85+
logger.LogDebug(
86+
"Database collation is not Ordinal ({SortOption}), rebuilding...",
87+
sortOption
88+
);
89+
90+
var options = new RebuildOptions
91+
{
92+
Collation = new Collation(CultureInfo.InvariantCulture.LCID, CompareOptions.Ordinal),
93+
};
94+
95+
db.RebuildAsync(options).GetAwaiter().GetResult();
96+
}
7897
}
7998
catch (IOException e)
8099
{
@@ -100,11 +119,10 @@ private LiteDatabaseAsync CreateDatabase()
100119
{
101120
var version = await CivitModelVersions
102121
.Query()
103-
.Where(
104-
mv =>
105-
mv.Files!.Select(f => f.Hashes)
106-
.Select(hashes => hashes.BLAKE3)
107-
.Any(hash => hash == hashBlake3)
122+
.Where(mv =>
123+
mv.Files!.Select(f => f.Hashes)
124+
.Select(hashes => hashes.BLAKE3)
125+
.Any(hash => hash == hashBlake3)
108126
)
109127
.FirstOrDefaultAsync()
110128
.ConfigureAwait(false);
@@ -201,7 +219,7 @@ public async Task ClearAllCacheCollectionsAsync()
201219
nameof(CivitModelQueryCache),
202220
nameof(GithubCache),
203221
nameof(LocalModelFiles),
204-
nameof(LocalImageFiles)
222+
nameof(LocalImageFiles),
205223
};
206224

207225
logger.LogInformation("Clearing all cache collections: [{@Names}]", collectionNames);

StabilityMatrix.Core/Helper/HardwareInfo/HardwareHelper.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,10 +87,10 @@ private static IEnumerable<GpuInfo> IterGpuInfoLinux()
8787
string? name = null;
8888

8989
// Parse output with regex
90-
var match = Regex.Match(gpuOutput, @"VGA compatible controller: ([^\n]*)");
90+
var match = Regex.Match(gpuOutput, @"(VGA compatible controller|3D controller): ([^\n]*)");
9191
if (match.Success)
9292
{
93-
name = match.Groups[1].Value.Trim();
93+
name = match.Groups[2].Value.Trim();
9494
}
9595

9696
match = Regex.Match(gpuOutput, @"prefetchable\) \[size=(\\d+)M\]");

StabilityMatrix.Core/Models/Packages/ComfyUI.cs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -469,11 +469,6 @@ await SetupVenv(installLocation, pythonVersion: PyVersion.Parse(installedPackage
469469
OnExit
470470
);
471471

472-
if (Compat.IsWindows)
473-
{
474-
ProcessTracker.AttachExitHandlerJobToProcess(VenvRunner.Process);
475-
}
476-
477472
return;
478473

479474
void HandleConsoleOutput(ProcessOutput s)

StabilityMatrix.Core/Models/Packages/VladAutomatic.cs

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,12 @@ IPyInstallationManager pyInstallationManager
164164
TargetRelativePaths = ["models/ControlNet"],
165165
ConfigDocumentPaths = ["control_net_models_path"],
166166
}, // Combined ControlNet/T2I
167+
new SharedFolderLayoutRule
168+
{
169+
SourceTypes = [SharedFolderType.DiffusionModels],
170+
TargetRelativePaths = ["models/UNET"],
171+
ConfigDocumentPaths = ["unet_dir"],
172+
},
167173
],
168174
};
169175

@@ -304,11 +310,15 @@ public override async Task InstallPackage(
304310
);
305311
}
306312

313+
var requirementsContent = await new FilePath(installLocation, "requirements.txt")
314+
.ReadAllTextAsync(cancellationToken)
315+
.ConfigureAwait(false);
316+
var pipArgs = new PipInstallArgs("--upgrade").WithParsedFromRequirementsTxt(requirementsContent);
307317
if (installedPackage.PipOverrides != null)
308318
{
309-
var pipArgs = new PipInstallArgs().WithUserOverrides(installedPackage.PipOverrides);
310-
await venvRunner.PipInstall(pipArgs, onConsoleOutput).ConfigureAwait(false);
319+
pipArgs = pipArgs.WithUserOverrides(installedPackage.PipOverrides);
311320
}
321+
await venvRunner.PipInstall(pipArgs, onConsoleOutput).ConfigureAwait(false);
312322

313323
var torchVersion = options.PythonOptions.TorchIndex ?? GetRecommendedTorchVersion();
314324
switch (torchVersion)

0 commit comments

Comments
 (0)