From 3120b593c67071a56d7b1c71f06656ff83fc3f03 Mon Sep 17 00:00:00 2001 From: cmdr2 Date: Fri, 30 Jun 2023 16:30:29 +0530 Subject: [PATCH] Handle the legacy yaml config path --- ui/easydiffusion/app.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/ui/easydiffusion/app.py b/ui/easydiffusion/app.py index 7e9e7890..3beabbb7 100644 --- a/ui/easydiffusion/app.py +++ b/ui/easydiffusion/app.py @@ -102,7 +102,13 @@ def getConfig(default_val=APP_CONFIG_DEFAULTS): config_json_path = os.path.join(CONFIG_DIR, "config.json") # compatibility with upcoming yaml changes, switching from beta to main - config_yaml_path = os.path.join(CONFIG_DIR, "config.yaml") + config_yaml_path = os.path.join(CONFIG_DIR, "..", "config.yaml") + + # migrate the old config yaml location + config_legacy_yaml = os.path.join(CONFIG_DIR, "config.yaml") + if os.path.isfile(config_legacy_yaml): + shutil.move(config_legacy_yaml, config_yaml_path) + if os.path.exists(config_yaml_path): try: import yaml