mirror of
https://github.com/comfyanonymous/ComfyUI.git
synced 2026-06-27 18:29:49 +08:00
Throw an error if frontend send more row than in max in List.
This commit is contained in:
parent
46c7e8055c
commit
911e0b2acf
@ -1346,6 +1346,7 @@ class List(ComfyTypeI):
|
||||
):
|
||||
info = value[1]
|
||||
min_rows: int = info.get("min", 0)
|
||||
max_rows: int = info.get("max", List._MaxRows)
|
||||
template: dict[str, Any] = info.get("template", {})
|
||||
|
||||
# Collect all template field specs across required/optional sections
|
||||
@ -1371,6 +1372,10 @@ class List(ComfyTypeI):
|
||||
except ValueError:
|
||||
pass
|
||||
|
||||
if present_rows > max_rows:
|
||||
raise ValueError(
|
||||
f"List input '{finalized_prefix}' received {present_rows} rows but max is {max_rows}."
|
||||
)
|
||||
row_count = max(min_rows, present_rows)
|
||||
|
||||
for row in range(row_count):
|
||||
|
||||
Loading…
Reference in New Issue
Block a user