MCPcopy Create free account
hub / github.com/Nynxz/ComfyUI-IdeogramHelper / execute

Method execute

backend/nodes/bbox_select.py:49–65  ·  view source on GitHub ↗
(cls, bboxes, ids="")

Source from the content-addressed store, hash-verified

47
48 @classmethod
49 def execute(cls, bboxes, ids="") -> io.NodeOutput:
50 # normalise to list[list[dict]] (per-frame), tolerating a single box or flat list
51 if isinstance(bboxes, dict):
52 frames = [[bboxes]]
53 elif not isinstance(bboxes, list) or not bboxes:
54 frames = []
55 elif isinstance(bboxes[0], dict):
56 frames = [bboxes]
57 else:
58 frames = bboxes
59
60 wanted = _parse_ids(ids)
61 if not wanted:
62 return io.NodeOutput(frames) # blank passes everything through
63
64 out = [[f[i - 1] for i in wanted if 1 <= i <= len(f)] for f in frames]
65 return io.NodeOutput(out)

Callers

nothing calls this directly

Calls 1

_parse_idsFunction · 0.85

Tested by

no test coverage detected