From 96430e9d485d404d5fc1388f322c9e702f68f469 Mon Sep 17 00:00:00 2001 From: zhaog100 Date: Sun, 22 Mar 2026 11:12:08 +0800 Subject: [PATCH 1/2] fix: include folder path in 'Value not in list' error messages When a COMBO input validation fails (e.g. model not found), the error now includes the folder path where the model was expected. This helps users quickly identify which directory to check for the missing file. Closes #13098 --- execution.py | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/execution.py b/execution.py index 1a6c3429c..f0ee59376 100644 --- a/execution.py +++ b/execution.py @@ -980,10 +980,27 @@ async def validate_inputs(prompt_id, prompt, item, validated): else: list_info = str(combo_options) + # Attempt to resolve the folder path for model-type inputs + 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 + except Exception: + pass + + details = f"{x}: '{val}' not in {list_info}" + if folder_path: + details += f" — expected in folder: {folder_path}" + error = { "type": "value_not_in_list", "message": "Value not in list", - "details": f"{x}: '{val}' not in {list_info}", + "details": details, "extra_info": { "input_name": x, "input_config": input_config, From d61ec431c437482cbef457896cfccc04505714d6 Mon Sep 17 00:00:00 2001 From: zhaog100 Date: Sun, 22 Mar 2026 13:27:11 +0800 Subject: [PATCH 2/2] 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