Length one processing
Internally, the Comfy server represents data flowing from one node to the next as a Pythonlist, normally
length 1, of the relevant datatype. In normal operation, when a node returns an output, each element in the
output is separately wrapped in a list (length 1); then when the next node is called, the data is unwrapped
and passed to the execute method.
List processing
In some circumstance, multiple data instances are processed in a single workflow, in which case the internal data will be a list containing the data instances. An example of this might be processing a series of images one at a time to avoid running out of VRAM, or handling images of different sizes. By default, Comfy will process the values in the list sequentially:- if the inputs are
lists of different lengths, the shorter ones are padded by repeating the last value - the
executemethod is called once for each value in the input lists - the outputs are
lists, each of which is the same length as the longest input
map_node_over_list in execution.py.
However, as Comfy wraps node outputs into a list of length one, if the values returned by a custom node
contain a list, that list will be wrapped, and treated as a single piece of data.
Two V3 schema options change this behaviour:
is_input_list=Trueon the schema: the node receives the whole list in a single call, instead of being called once per item. All inputs becomelist[type], regardless of how many items are passed in. This replaces the legacy V1 class attributeINPUT_IS_LIST.is_output_list=Trueon an output: the list returned for that output is not wrapped, and is treated as a series of data for sequential processing by downstream nodes. This replaces the legacy V1 class attributeOUTPUT_IS_LIST.
ImageRebatch-style node written in the V3 schema. It
takes one or more batches of images (received as a list, because is_input_list=True) and rebatches them
into batches of the requested size: