Nodes/BV Node Pack/BV LUT Loop Advance (Prototype internal)
ComfyUI Node

BV LUT Loop Advance (Prototype internal)

The invisible node that advances a LUT loop

By BlackVortexAI·Created 8 months ago·Updated a day ago· 6
BV LUT Loop Advance (Prototype internal)
  • loop_state
  • processed_image
  • next_loop_state
  • continue_loop

You should almost never wire this node yourself. It's marked "(Prototype internal)" and hidden from the normal menus (__hidden__ category) for a reason: BV LUT Loop End expands into it automatically when a LUT loop runs. Think of it as the loop's stepping motor - the piece that takes the finished image from one job and decides whether there's a next job to run.

It exists because ComfyUI has no native for loop. To fake one, the pack's Loop End node assembles a small hidden graph on the fly, and this node is the middle of that graph: it consumes the current loop state and the processed image, advances the job index, and reports whether the loop should keep going.

How it works

Two inputs: loop_state (a BV_LUT_LOOP_STATE - the plan plus the current image and job index) and processed_image (the accumulated image after this job's processing). It does three things:

  1. Validates the loop state against the version-1 prototype schema.
  2. Checks the processed image has the exact same B, H, W, C shape as the current image. If your loop body resized anything, this is where it throws "requires processed IMAGE with unchanged B,H,W,C shape" - resizing mid-loop breaks the accumulator contract, and the node refuses to continue.
  3. Bumps job_index by one, stores the processed image as the new current image, and returns continue_loop = true while the index is still inside the plan.

Outputs: next_loop_state (the advanced state) and continue_loop (boolean). That boolean is what BV LUT While End (Prototype internal) tests to decide whether to re-run the subgraph.

When you'd see it

Turn on debug/legacy views and you'll catch it in the expanded graph between Loop Start and Loop End. Understanding it helps decode the two most common loop failures: the shape error above, and a loop that silently stops one job early (which is a continue_loop/state problem upstream, not this node's fault).

How to install

It ships with BV Node Pack:

cd ComfyUI/custom_nodes
git clone https://github.com/BlackVortexAI/bv_nodepack.git

Restart ComfyUI, hard-refresh. Or ComfyUI Manager → "BV Node Pack".

Common issues

  • "requires processed IMAGE with unchanged B,H,W,C shape" - your loop body resized the image. Resize after the loop, or keep iterations shape-stable. This is the node's one failure mode, and it's doing exactly what it should.
  • Tempted to wire it manually? Don't. Let Loop End build it; hand-wiring hidden prototype nodes is how you get state that no consumer can read.

It's a utility nobody should ever think about - which is the highest compliment a loop-stepping node can get.

Category__hidden__

Inputs (2)

NameTypeDefaultDescription
loop_stateBV_LUT_LOOP_STATE
processed_imageIMAGE

Outputs (2)

NameTypeDescription
next_loop_stateBV_LUT_LOOP_STATE
continue_loopBOOLEAN