From 3f8e2bfd18e6d7c5d25ce4c965a8136aa308e71a Mon Sep 17 00:00:00 2001 From: psychedelicious <4822129+psychedelicious@users.noreply.github.com> Date: Tue, 12 Mar 2024 08:39:38 +1100 Subject: [PATCH] fix(config): migrate deprecated `max_cache_size` and `max_vram_cache_size` settings --- invokeai/app/services/config/config_default.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/invokeai/app/services/config/config_default.py b/invokeai/app/services/config/config_default.py index 5a31deffdf..c157f92090 100644 --- a/invokeai/app/services/config/config_default.py +++ b/invokeai/app/services/config/config_default.py @@ -349,9 +349,15 @@ def migrate_v3_config_dict(config_dict: dict[str, Any]) -> InvokeAIAppConfig: parsed_config_dict: dict[str, Any] = {} for _category_name, category_dict in config_dict["InvokeAI"].items(): for k, v in category_dict.items(): + # `outdir` was renamed to `outputs_dir` in v4 if k == "outdir": - # `outdir` was renamed to `outputs_dir` parsed_config_dict["outputs_dir"] = v + # `max_cache_size` was renamed to `ram` some time in v3, but both names were used + if k == "max_cache_size" and "ram" not in category_dict: + parsed_config_dict["ram"] = v + # `max_vram_cache_size` was renamed to `vram` some time in v3, but both names were used + if k == "max_vram_cache_size" and "vram" not in category_dict: + parsed_config_dict["vram"] = v elif k in InvokeAIAppConfig.model_fields: # skip unknown fields parsed_config_dict[k] = v