From 5e39e4695484ddeecd0dc63d587b495bc2b3c37d Mon Sep 17 00:00:00 2001 From: psychedelicious <4822129+psychedelicious@users.noreply.github.com> Date: Tue, 12 Mar 2024 01:39:08 +1100 Subject: [PATCH] feat(config): more resiliant update_config method Only set values that have changed. --- invokeai/app/services/config/config_default.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/invokeai/app/services/config/config_default.py b/invokeai/app/services/config/config_default.py index fd224fb74e..38e79bc2b4 100644 --- a/invokeai/app/services/config/config_default.py +++ b/invokeai/app/services/config/config_default.py @@ -190,7 +190,10 @@ class InvokeAIAppConfig(BaseSettings): new_config = config for field_name in new_config.model_fields_set: - setattr(self, field_name, getattr(new_config, field_name)) + new_value = getattr(new_config, field_name) + current_value = getattr(self, field_name) + if new_value != current_value: + setattr(self, field_name, new_value) def write_file(self, exclude_defaults: bool) -> None: """Write the current configuration to the `invokeai.yaml` file. This will overwrite the existing file.