Skip to content

Commit

Permalink
Merge pull request LykosAI#780 from ionite34/fix-swarm-config
Browse files Browse the repository at this point in the history
Fix swarm settings being overwritten on launch
  • Loading branch information
mohnjiles authored Aug 17, 2024
2 parents 568860b + 0ac2ce8 commit 78476fc
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ and this project adheres to [Semantic Versioning 2.0](https://semver.org/spec/v2
## v2.11.8
### Fixed
- Fixed CivitAI model browser not loading search results
- Fixed SwarmUI settings being overwritten on launch

## v2.11.7
### Changed
Expand Down
30 changes: 29 additions & 1 deletion StabilityMatrix.Core/Models/Packages/StableSwarm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -376,7 +376,35 @@ private Task SetupModelFoldersConfig(DirectoryPath installDirectory)
if (settingsExists)
{
var section = FDSUtility.ReadFile(settingsPath);
existingSettings.Load(section);
var paths = section.GetSection("Paths");
paths.Set("ModelRoot", settingsManager.ModelsDirectory);
paths.Set(
"SDModelFolder",
Path.Combine(settingsManager.ModelsDirectory, SharedFolderType.StableDiffusion.ToString())
);
paths.Set(
"SDLoraFolder",
Path.Combine(settingsManager.ModelsDirectory, SharedFolderType.Lora.ToString())
);
paths.Set(
"SDVAEFolder",
Path.Combine(settingsManager.ModelsDirectory, SharedFolderType.VAE.ToString())
);
paths.Set(
"SDEmbeddingFolder",
Path.Combine(settingsManager.ModelsDirectory, SharedFolderType.TextualInversion.ToString())
);
paths.Set(
"SDControlNetsFolder",
Path.Combine(settingsManager.ModelsDirectory, SharedFolderType.ControlNet.ToString())
);
paths.Set(
"SDClipVisionFolder",
Path.Combine(settingsManager.ModelsDirectory, SharedFolderType.InvokeClipVision.ToString())
);
section.Set("Paths", paths);
section.SaveToFile(settingsPath);
return Task.CompletedTask;
}

existingSettings.Paths = new StableSwarmSettings.PathsData
Expand Down

0 comments on commit 78476fc

Please sign in to comment.