From 07ca2c7816edc4d10956b9df84d9b957ae19aacf Mon Sep 17 00:00:00 2001 From: Alexander Piskun <13381981+bigcat88@users.noreply.github.com> Date: Tue, 10 Dec 2024 14:05:53 +0200 Subject: [PATCH] add_model_folder_path: ensure unique paths by removing duplicates Signed-off-by: bigcat88 --- folder_paths.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/folder_paths.py b/folder_paths.py index 577a7bc64..ab013a59d 100644 --- a/folder_paths.py +++ b/folder_paths.py @@ -200,6 +200,10 @@ def add_model_folder_path(folder_name: str, full_folder_path: str, is_default: b global folder_names_and_paths folder_name = map_legacy(folder_name) if folder_name in folder_names_and_paths: + current_paths = folder_names_and_paths[folder_name][0] + if full_folder_path in current_paths: + current_paths.remove(full_folder_path) # Remove the path if it exists + if is_default: folder_names_and_paths[folder_name][0].insert(0, full_folder_path) else: