mirror of
https://github.com/comfyanonymous/ComfyUI.git
synced 2026-04-30 12:22:37 +08:00
fix: validate MultiCombo list values against options individually
Amp-Thread-ID: https://ampcode.com/threads/T-019dad04-a07a-724b-af4d-fbfe98654fdd Co-authored-by: Amp <amp@ampcode.com>
This commit is contained in:
parent
15e097411b
commit
fc51d13beb
@ -994,7 +994,12 @@ async def validate_inputs(prompt_id, prompt, item, validated):
|
|||||||
combo_options = extra_info.get("options", [])
|
combo_options = extra_info.get("options", [])
|
||||||
else:
|
else:
|
||||||
combo_options = input_type
|
combo_options = input_type
|
||||||
if val not in combo_options:
|
# MultiCombo sends a list of selected values
|
||||||
|
if isinstance(val, list):
|
||||||
|
invalid_vals = [v for v in val if v not in combo_options]
|
||||||
|
else:
|
||||||
|
invalid_vals = [val] if val not in combo_options else []
|
||||||
|
if invalid_vals:
|
||||||
input_config = info
|
input_config = info
|
||||||
list_info = ""
|
list_info = ""
|
||||||
|
|
||||||
@ -1009,7 +1014,7 @@ async def validate_inputs(prompt_id, prompt, item, validated):
|
|||||||
error = {
|
error = {
|
||||||
"type": "value_not_in_list",
|
"type": "value_not_in_list",
|
||||||
"message": "Value not in list",
|
"message": "Value not in list",
|
||||||
"details": f"{x}: '{val}' not in {list_info}",
|
"details": f"{x}: '{invalid_vals}' not in {list_info}",
|
||||||
"extra_info": {
|
"extra_info": {
|
||||||
"input_name": x,
|
"input_name": x,
|
||||||
"input_config": input_config,
|
"input_config": input_config,
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user