Nodes/ComfyUI-BFSNodes/BFS Workflow Loop
ComfyUI Node

BFS Workflow Loop

BFS Workflow Loop: run any part of any workflow once per item, injecting the item (and per-iteration parameters) into nodes you pick, and collect the results in order.

By alisson-anjos·Created 8 months ago·Updated a day ago· 137
BFS Workflow Loop
  • result
  • items
  • items_b
  • item_masks
  • images
  • count
◄loop{}►
◄count0►
CategoryBFS/Loop

Inputs (6)

NameTypeDefaultDescription
resultIMAGEWhat one iteration produces; everything upstream of it can be looped.
loopSTRING{}Set by the panel: injected nodes and per-iteration widgets.
itemsoptIMAGEThe batch to iterate over: item i is injected on iteration i.
items_boptIMAGEA second batch, same length (e.g. the marked frames next to the plain ones).
item_masksoptMASKOne mask per item, injected where the panel says (source 'item_masks').
countoptINT00–256Iterations when there are no items (params only); 0 = as many as the longest value list.

Outputs (2)

NameTypeDescription
imagesIMAGEThe result of every iteration, in order, as one batch (resized to the first one's size).
countINTIterations run.