From 49aa55425776384b59ec83f4dba8316f598db1ff Mon Sep 17 00:00:00 2001 From: Ionite Date: Thu, 11 Apr 2024 15:22:01 -0400 Subject: [PATCH 1/2] Fix settings env var conflict --- .../Models/Settings/Settings.cs | 20 +++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/StabilityMatrix.Core/Models/Settings/Settings.cs b/StabilityMatrix.Core/Models/Settings/Settings.cs index 01e22fd2..ff65f104 100644 --- a/StabilityMatrix.Core/Models/Settings/Settings.cs +++ b/StabilityMatrix.Core/Models/Settings/Settings.cs @@ -118,10 +118,22 @@ public class Settings public Dictionary? UserEnvironmentVariables { get; set; } [JsonIgnore] - public IReadOnlyDictionary EnvironmentVariables => - DefaultEnvironmentVariables - .Concat(UserEnvironmentVariables ?? []) - .ToDictionary(x => x.Key, x => x.Value); + public IReadOnlyDictionary EnvironmentVariables + { + get + { + if (UserEnvironmentVariables is null || UserEnvironmentVariables.Count == 0) + { + return DefaultEnvironmentVariables; + } + + return DefaultEnvironmentVariables + .Concat(UserEnvironmentVariables) + .GroupBy(pair => pair.Key) + // User variables override default variables with the same key + .ToDictionary(grouping => grouping.Key, grouping => grouping.Last().Value); + } + } public HashSet? InstalledModelHashes { get; set; } = new(); From e41b4195dc90de7738ff2dfeada3e04409547b2b Mon Sep 17 00:00:00 2001 From: Ionite Date: Thu, 11 Apr 2024 15:24:01 -0400 Subject: [PATCH 2/2] Update CHANGELOG.md --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 546b1b81..c644343d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,10 @@ All notable changes to Stability Matrix will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and this project adheres to [Semantic Versioning 2.0](https://semver.org/spec/v2.0.0.html). +## v2.10.1 +### Fixed +- Fixed package launch not working when environment variable `SETUPTOOLS_USE_DISTUTILS` is set due to conflict with a default environment variable. User environment variables will now correctly override any default environment variables. + ## v2.10.0 ### Added - Added Reference-Only mode for Inference ControlNet, used for guiding the sampler with an image without a pretrained model. Part of the latent and attention layers will be connected to the reference image, similar to Image to Image or Inpainting.