From d61ec431c437482cbef457896cfccc04505714d6 Mon Sep 17 00:00:00 2001 From: zhaog100 Date: Sun, 22 Mar 2026 13:27:11 +0800 Subject: [PATCH] fix: correct folder path resolution for COMBO validation errors Use input name to derive folder key instead of iterating all folders. Handle paths as list/tuple and join with comma for clean output. Fixes coderabbit Major review on #13105 --- execution.py | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/execution.py b/execution.py index f0ee59376..9cefeee6c 100644 --- a/execution.py +++ b/execution.py @@ -984,12 +984,15 @@ async def validate_inputs(prompt_id, prompt, item, validated): folder_path = None try: import folder_paths as fp - for folder_name in fp.folder_names_and_paths: - if x.endswith("_name") or x.endswith("_dir"): - paths = fp.folder_names_and_paths[folder_name] - if paths and paths[0]: - folder_path = paths[0] - break + if x.endswith("_name") or x.endswith("_dir"): + folder_key = x.removesuffix("_name").removesuffix("_dir") + folder_entry = fp.folder_names_and_paths.get(folder_key) + if folder_entry and folder_entry[0]: + paths = folder_entry[0] + if isinstance(paths, (list, tuple)): + folder_path = ", ".join(str(p) for p in paths) + else: + folder_path = str(paths) except Exception: pass