From 8141c3276335c0ffda3baa2c9b67c12746275944 Mon Sep 17 00:00:00 2001 From: sgumil Date: Fri, 19 Dec 2025 10:41:11 +0100 Subject: [PATCH] Fix bug extra_model_paths (solution provided by @schoenid) --- utils/extra_config.py | 32 ++++++++++++++------------------ 1 file changed, 14 insertions(+), 18 deletions(-) diff --git a/utils/extra_config.py b/utils/extra_config.py index a0fcda9e8..5778e84fd 100644 --- a/utils/extra_config.py +++ b/utils/extra_config.py @@ -11,24 +11,20 @@ def load_extra_path_config(yaml_path): conf = config[c] if conf is None: continue - base_path = None - if "base_path" in conf: - base_path = conf.pop("base_path") - base_path = os.path.expandvars(os.path.expanduser(base_path)) + if "base_path" in c: + base_path = os.path.expandvars(os.path.expanduser(conf)) if not os.path.isabs(base_path): base_path = os.path.abspath(os.path.join(yaml_dir, base_path)) - is_default = False + continue if "is_default" in conf: - is_default = conf.pop("is_default") - for x in conf: - for y in conf[x].split("\n"): - if len(y) == 0: - continue - full_path = y - if base_path: - full_path = os.path.join(base_path, full_path) - elif not os.path.isabs(full_path): - full_path = os.path.abspath(os.path.join(yaml_dir, y)) - normalized_path = os.path.normpath(full_path) - logging.info("Adding extra search path {} {}".format(x, normalized_path)) - folder_paths.add_model_folder_path(x, normalized_path, is_default) + continue + if len(conf) == 0: + continue + full_path = conf + if base_path: + full_path = os.path.join(base_path, full_path) + elif not os.path.isabs(full_path): + full_path = os.path.abspath(os.path.join(yaml_dir, conf)) + normalized_path = os.path.normpath(full_path) + logging.info("Adding extra search path {} {}".format(c, normalized_path)) + folder_paths.add_model_folder_path(c, normalized_path, False) \ No newline at end of file