mirror of
https://github.com/comfyanonymous/ComfyUI.git
synced 2026-06-25 17:29:24 +08:00
Throw an error if frontend send more row than in max in List.
This commit is contained in:
parent
a3b9cf837d
commit
708e09b2b2
@ -1338,6 +1338,7 @@ class List(ComfyTypeI):
|
|||||||
):
|
):
|
||||||
info = value[1]
|
info = value[1]
|
||||||
min_rows: int = info.get("min", 0)
|
min_rows: int = info.get("min", 0)
|
||||||
|
max_rows: int = info.get("max", List._MaxRows)
|
||||||
template: dict[str, Any] = info.get("template", {})
|
template: dict[str, Any] = info.get("template", {})
|
||||||
|
|
||||||
# Collect all template field specs across required/optional sections
|
# Collect all template field specs across required/optional sections
|
||||||
@ -1363,6 +1364,10 @@ class List(ComfyTypeI):
|
|||||||
except ValueError:
|
except ValueError:
|
||||||
pass
|
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)
|
row_count = max(min_rows, present_rows)
|
||||||
|
|
||||||
for row in range(row_count):
|
for row in range(row_count):
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user