From 96430e9d485d404d5fc1388f322c9e702f68f469 Mon Sep 17 00:00:00 2001 From: zhaog100 Date: Sun, 22 Mar 2026 11:12:08 +0800 Subject: [PATCH] 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,