ComfyUI Node

AP Bridge Preview Batch

A preview node that shows every frame in the batch, not just the last one

By adampolczynski·Created 6 months ago·Updated 6 months ago· 1
AP Bridge Preview Batch
  • images
  • masks
  • images
  • masks
preview_modeimage

ComfyUI's built-in Preview Image shows you one image per execution slot - which, when you're working with a batch of frames or a video, usually means you see a single frame and have to dig through the UI to inspect the rest. AP Bridge Preview Batch is the fix: it previews the whole batch, and it can show you the images, the masks, or a composite of both, from one node. The name says "bridge" because it's also a pass-through - the images and masks come out the other side unchanged, so you can drop it mid-pipeline without adding a routing detour.

If you're doing frame-by-frame optical flow or video work with this pack, this is the node you hang at the end of a chain to actually see what the batch looks like - all frames at once. It's an OUTPUT_NODE, so it always executes, which makes it a reliable place to inspect intermediate results even when the cache thinks nothing changed.

The mechanism

Pure passthrough plus a preview emit. It takes optional images and masks, passes both through untouched as outputs, and pushes the batch to the UI for preview. The preview_mode widget picks what the preview shows:

  • image (default) - the image batch.
  • mask - the mask batch (useful for checking that your masks actually cover what you think they cover before committing to a render).
  • composite - image and mask overlaid, which is the fastest way to confirm the mask lines up with the content.

Nothing is written to disk - the README is explicit that the preview bridge is "pure passthrough and does not write any files." It's for looking, not saving.

Inputs and outputs

Inputs: preview_mode, plus optional images and masks (either can be left unconnected). Outputs: images and masks, identical to what went in.

Installing it

Pack-wide install: ComfyUI Manager (search "AP_OpticalFlow"), or

cd ComfyUI/custom_nodes
git clone https://github.com/adampolczynski/ComfyUI_AP_OpticalFlow
python -m pip install -r custom_nodes/ComfyUI_AP_OpticalFlow/requirements.txt

Restart. Dependency: torchvision>=0.15.

When to use it

Two good moments. First, as a debug endpoint: hang it off a flow warp, an inpaint stitch, or a loop output and flip preview_mode to see exactly what your batch holds before you save. Second, inside a video pipeline as a low-friction inspector - because it passes its inputs through, you can park it between stages and re-run without rewiring. It's a small, unglamorous node, but in a pack whose whole pitch is "batch-safe, production-style," it's the pair of eyes that keeps batch work honest.

For actual file output, that's what AP Bridge Save is for - this one's sibling with the same pass-through contract but real save logic and a compress_level knob. Preview here, save there, and you never have to guess which one wrote the file.

CategoryAP_OpticalFlow

Inputs (3)

NameTypeDefaultDescription
preview_modeCOMBOimage3 options: image, mask, composite
imagesoptIMAGE
masksoptMASK

Outputs (2)

NameTypeDescription
imagesIMAGE
masksMASK