diff --git a/CHANGELOG.md b/CHANGELOG.md index 8cb19019..97092981 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,7 @@ and this project adheres to [Semantic Versioning 2.0](https://semver.org/spec/v2 - 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 - Fixed Civitai model browser error when sorting by Installed with more than 100 installed models +- Fixed CLIP Install errors due to setuptools distutils conflict, added default environment variable setting `SETUPTOOLS_USE_DISTUTILS=stdlib` ## v2.10.0-pre.2 ### Added diff --git a/StabilityMatrix.Avalonia/ViewModels/Settings/MainSettingsViewModel.cs b/StabilityMatrix.Avalonia/ViewModels/Settings/MainSettingsViewModel.cs index 0da8ab4c..c02c396b 100644 --- a/StabilityMatrix.Avalonia/ViewModels/Settings/MainSettingsViewModel.cs +++ b/StabilityMatrix.Avalonia/ViewModels/Settings/MainSettingsViewModel.cs @@ -365,7 +365,7 @@ public partial class MainSettingsViewModel : PageViewModelBase var viewModel = dialogFactory.Get(); // Load current settings - var current = settingsManager.Settings.EnvironmentVariables ?? new Dictionary(); + var current = settingsManager.Settings.UserEnvironmentVariables ?? new Dictionary(); viewModel.EnvVars = new ObservableCollection( current.Select(kvp => new EnvVarKeyPair(kvp.Key, kvp.Value)) ); @@ -385,7 +385,7 @@ public partial class MainSettingsViewModel : PageViewModelBase .EnvVars.Where(kvp => !string.IsNullOrWhiteSpace(kvp.Key)) .GroupBy(kvp => kvp.Key, StringComparer.Ordinal) .ToDictionary(g => g.Key, g => g.First().Value, StringComparer.Ordinal); - settingsManager.Transaction(s => s.EnvironmentVariables = newEnvVars); + settingsManager.Transaction(s => s.UserEnvironmentVariables = newEnvVars); } } diff --git a/StabilityMatrix.Core/Models/Settings/Settings.cs b/StabilityMatrix.Core/Models/Settings/Settings.cs index bf5e080f..01e22fd2 100644 --- a/StabilityMatrix.Core/Models/Settings/Settings.cs +++ b/StabilityMatrix.Core/Models/Settings/Settings.cs @@ -110,7 +110,18 @@ public class Settings public bool IsDiscordRichPresenceEnabled { get; set; } - public Dictionary? EnvironmentVariables { get; set; } + [JsonIgnore] + public Dictionary DefaultEnvironmentVariables { get; } = + new() { ["SETUPTOOLS_USE_DISTUTILS"] = "stdlib" }; + + [JsonPropertyName("EnvironmentVariables")] + public Dictionary? UserEnvironmentVariables { get; set; } + + [JsonIgnore] + public IReadOnlyDictionary EnvironmentVariables => + DefaultEnvironmentVariables + .Concat(UserEnvironmentVariables ?? []) + .ToDictionary(x => x.Key, x => x.Value); public HashSet? InstalledModelHashes { get; set; } = new();