Skip to content

Commit d815c8a

Browse files
authored
Merge pull request #207 from ionite34/fix-vlad-config
2 parents 0de52fc + af1cee0 commit d815c8a

File tree

6 files changed

+33
-112
lines changed

6 files changed

+33
-112
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@ 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.2.1
9+
### Fixed
10+
- Fixed SD.Next shared folders config not working with new config format, reverted to Junctions / Symlinks
11+
812
## v2.2.0
913
### Added
1014
- Added option to search by Base Model in the Model Browser

StabilityMatrix.Core/Models/Packages/A3WebUI.cs

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -193,23 +193,4 @@ void HandleConsoleOutput(ProcessOutput s)
193193

194194
VenvRunner.RunDetached(args.TrimEnd(), HandleConsoleOutput, OnExit);
195195
}
196-
197-
public override Task SetupModelFolders(DirectoryPath installDirectory)
198-
{
199-
StabilityMatrix.Core.Helper.SharedFolders
200-
.SetupLinks(SharedFolders, SettingsManager.ModelsDirectory, installDirectory);
201-
return Task.CompletedTask;
202-
}
203-
204-
public override async Task UpdateModelFolders(DirectoryPath installDirectory)
205-
{
206-
await StabilityMatrix.Core.Helper.SharedFolders.UpdateLinksForPackage(this,
207-
SettingsManager.ModelsDirectory, installDirectory).ConfigureAwait(false);
208-
}
209-
210-
public override Task RemoveModelFolderLinks(DirectoryPath installDirectory)
211-
{
212-
StabilityMatrix.Core.Helper.SharedFolders.RemoveLinksForPackage(this, installDirectory);
213-
return Task.CompletedTask;
214-
}
215196
}

StabilityMatrix.Core/Models/Packages/BaseGitPackage.cs

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
using StabilityMatrix.Core.Helper;
66
using StabilityMatrix.Core.Helper.Cache;
77
using StabilityMatrix.Core.Models.Database;
8+
using StabilityMatrix.Core.Models.FileInterfaces;
89
using StabilityMatrix.Core.Models.Progress;
910
using StabilityMatrix.Core.Python;
1011
using StabilityMatrix.Core.Services;
@@ -265,6 +266,34 @@ public override async Task<string> Update(InstalledPackage installedPackage,
265266
return latestCommit.Sha;
266267
}
267268

269+
public override Task SetupModelFolders(DirectoryPath installDirectory)
270+
{
271+
if (SharedFolders is { } folders)
272+
{
273+
StabilityMatrix.Core.Helper.SharedFolders
274+
.SetupLinks(folders, SettingsManager.ModelsDirectory, installDirectory);
275+
}
276+
return Task.CompletedTask;
277+
}
278+
279+
public override async Task UpdateModelFolders(DirectoryPath installDirectory)
280+
{
281+
if (SharedFolders is not null)
282+
{
283+
await StabilityMatrix.Core.Helper.SharedFolders.UpdateLinksForPackage(this,
284+
SettingsManager.ModelsDirectory, installDirectory).ConfigureAwait(false);
285+
}
286+
}
287+
288+
public override Task RemoveModelFolderLinks(DirectoryPath installDirectory)
289+
{
290+
if (SharedFolders is not null)
291+
{
292+
StabilityMatrix.Core.Helper.SharedFolders.RemoveLinksForPackage(this, installDirectory);
293+
}
294+
return Task.CompletedTask;
295+
}
296+
268297
// Send input to the running process.
269298
public virtual void SendInput(string input)
270299
{

StabilityMatrix.Core/Models/Packages/InvokeAI.cs

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -327,25 +327,6 @@ void HandleConsoleOutput(ProcessOutput s)
327327
}
328328
}
329329

330-
public override Task SetupModelFolders(DirectoryPath installDirectory)
331-
{
332-
StabilityMatrix.Core.Helper.SharedFolders
333-
.SetupLinks(SharedFolders, SettingsManager.ModelsDirectory, installDirectory);
334-
return Task.CompletedTask;
335-
}
336-
337-
public override async Task UpdateModelFolders(DirectoryPath installDirectory)
338-
{
339-
await StabilityMatrix.Core.Helper.SharedFolders.UpdateLinksForPackage(this,
340-
SettingsManager.ModelsDirectory, installDirectory).ConfigureAwait(false);
341-
}
342-
343-
public override Task RemoveModelFolderLinks(DirectoryPath installDirectory)
344-
{
345-
StabilityMatrix.Core.Helper.SharedFolders.RemoveLinksForPackage(this, installDirectory);
346-
return Task.CompletedTask;
347-
}
348-
349330
private Dictionary<string, string> GetEnvVars(DirectoryPath installPath)
350331
{
351332
// Set additional required environment variables

StabilityMatrix.Core/Models/Packages/VladAutomatic.cs

Lines changed: 0 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -245,61 +245,6 @@ void HandleExit(int i)
245245
VenvRunner.RunDetached(args.TrimEnd(), HandleConsoleOutput, HandleExit);
246246
}
247247

248-
public override Task SetupModelFolders(DirectoryPath installDirectory)
249-
{
250-
var configJsonPath = installDirectory + "config.json";
251-
var exists = File.Exists(configJsonPath);
252-
JsonObject? configRoot;
253-
if (exists)
254-
{
255-
var configJson = File.ReadAllText(configJsonPath);
256-
try
257-
{
258-
configRoot = JsonSerializer.Deserialize<JsonObject>(configJson) ?? new JsonObject();
259-
}
260-
catch (JsonException)
261-
{
262-
configRoot = new JsonObject();
263-
}
264-
}
265-
else
266-
{
267-
configRoot = new JsonObject();
268-
}
269-
270-
configRoot["ckpt_dir"] = Path.Combine(SettingsManager.ModelsDirectory, "StableDiffusion");
271-
configRoot["diffusers_dir"] = Path.Combine(SettingsManager.ModelsDirectory, "Diffusers");
272-
configRoot["vae_dir"] = Path.Combine(SettingsManager.ModelsDirectory, "VAE");
273-
configRoot["lora_dir"] = Path.Combine(SettingsManager.ModelsDirectory, "Lora");
274-
configRoot["lyco_dir"] = Path.Combine(SettingsManager.ModelsDirectory, "LyCORIS");
275-
configRoot["embeddings_dir"] = Path.Combine(SettingsManager.ModelsDirectory, "TextualInversion");
276-
configRoot["hypernetwork_dir"] = Path.Combine(SettingsManager.ModelsDirectory, "Hypernetwork");
277-
configRoot["codeformer_models_path"] = Path.Combine(SettingsManager.ModelsDirectory, "Codeformer");
278-
configRoot["gfpgan_models_path"] = Path.Combine(SettingsManager.ModelsDirectory, "GFPGAN");
279-
configRoot["bsrgan_models_path"] = Path.Combine(SettingsManager.ModelsDirectory, "BSRGAN");
280-
configRoot["esrgan_models_path"] = Path.Combine(SettingsManager.ModelsDirectory, "ESRGAN");
281-
configRoot["realesrgan_models_path"] = Path.Combine(SettingsManager.ModelsDirectory, "RealESRGAN");
282-
configRoot["scunet_models_path"] = Path.Combine(SettingsManager.ModelsDirectory, "ScuNET");
283-
configRoot["swinir_models_path"] = Path.Combine(SettingsManager.ModelsDirectory, "SwinIR");
284-
configRoot["ldsr_models_path"] = Path.Combine(SettingsManager.ModelsDirectory, "LDSR");
285-
configRoot["clip_models_path"] = Path.Combine(SettingsManager.ModelsDirectory, "CLIP");
286-
configRoot["control_net_models_path"] = Path.Combine(SettingsManager.ModelsDirectory, "ControlNet");
287-
288-
var configJsonStr = JsonSerializer.Serialize(configRoot, new JsonSerializerOptions
289-
{
290-
WriteIndented = true
291-
});
292-
File.WriteAllText(configJsonPath, configJsonStr);
293-
294-
return Task.CompletedTask;
295-
}
296-
297-
public override Task UpdateModelFolders(DirectoryPath installDirectory) =>
298-
SetupModelFolders(installDirectory);
299-
300-
public override Task RemoveModelFolderLinks(DirectoryPath installDirectory) =>
301-
Task.CompletedTask;
302-
303248
public override async Task<string> Update(InstalledPackage installedPackage,
304249
IProgress<ProgressReport>? progress = null, bool includePrerelease = false)
305250
{

StabilityMatrix.Core/Models/Packages/VoltaML.cs

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -178,23 +178,4 @@ void HandleConsoleOutput(ProcessOutput s)
178178

179179
VenvRunner.RunDetached(args.TrimEnd(), HandleConsoleOutput, OnExit);
180180
}
181-
182-
public override Task SetupModelFolders(DirectoryPath installDirectory)
183-
{
184-
StabilityMatrix.Core.Helper.SharedFolders.SetupLinks(SharedFolders,
185-
SettingsManager.ModelsDirectory, installDirectory);
186-
return Task.CompletedTask;
187-
}
188-
189-
public override async Task UpdateModelFolders(DirectoryPath installDirectory)
190-
{
191-
await StabilityMatrix.Core.Helper.SharedFolders.UpdateLinksForPackage(this,
192-
SettingsManager.ModelsDirectory, installDirectory).ConfigureAwait(false);
193-
}
194-
195-
public override Task RemoveModelFolderLinks(DirectoryPath installDirectory)
196-
{
197-
StabilityMatrix.Core.Helper.SharedFolders.RemoveLinksForPackage(this, installDirectory);
198-
return Task.CompletedTask;
199-
}
200181
}

0 commit comments

Comments
 (0)