Nodes/ComfyUI CV/CV Stitch (List)
ComfyUI Node

CV Stitch (List)

Panorama From a List, Which Is How ComfyUI Loaders Actually Hand You Images

By bmad4ever·Created 3 months ago·Updated 14 days ago· 1
CV Stitch (List)
  • images
  • masks
  • panorama
  • status
  • success
◄modeStitcher_PANORAMA►
◄registration_resol-1.00►
◄seam_estimation_resol-1.00►
◄compositing_resol-1.00►
◄pano_confidence_thresh1.00►
◄wave_correctiontrue►
◄interpolation_flagsINTER_LINEAR►

Same stitcher as CV Stitch, same knobs, one difference that decides which one you need: this version takes a ComfyUI list, not a batched NPARRAY.

That's not a pedantic distinction. In ComfyUI, "list" and "batch" are different data-flow shapes, and the inputs you have often arrive as a list: a folder loader, an indexed image set, anything that outputs several items through the list machinery. CV Stitch wants a [B,H,W,C] NPARRAY; if your images came as list items, you're converting for no reason. Wire them straight into this one.

What it does with your list

images is a poly socket, so each list element can be an IMAGE, a LATENT or an NPARRAY - and only the first frame of each element is used. So a list of five stills gives you five stitched frames, while a list of five batched clips gives you five stitched frames made from each clip's frame 0. The pack's example graph builds the list with core's Batch Images node, which is the usual way to get there.

There's an optional masks input: a list of coverage masks, one per image, for excluding things like a windshield edge from the seam search.

Then the same knobs as the batch version. mode - PANORAMA for general scenes, SCANS for flat documents. The three *_resol inputs are megapixels per stage (registration_resol, seam_estimation_resol, compositing_resol), with -1 meaning OpenCV's automatic choice; drop them if you hit memory limits. pano_confidence_thresh gates how sure the matcher must be. wave_correction compensates for the horizontal drift of hand-held rotation. interpolation_flags picks the compositing interpolator - INTER_LINEAR is fine, INTER_CUBIC and INTER_LANCZOS4 are sharper.

Outputs: panorama (uint8 BGR NPARRAY), status (an OK or ERR_* label from the stitcher), success (boolean). Failure returns a copy of the first input frame rather than raising, so branch on success - a "panorama" that's identical to your first photo is the failure state, and it looks like a success if you're not checking.

Like its batch sibling, the stitching runs in a separate process, so it stays interruptible and doesn't freeze the server.

Install

ComfyUI Manager → search ComfyUI CV (publisher bmad4ever), or:

cd ComfyUI/custom_nodes
git clone https://github.com/bmad4ever/comfyui_cv
pip install "opencv-contrib-python-headless~=5.0.0.93"

Restart ComfyUI afterwards. Python ≥ 3.12 and a recent build on the V3 node API. Keep the contrib wheel - replacing it with plain opencv-python shares one site-packages/cv2 and silently removes the contrib submodules other nodes in this pack depend on. tools/repair_opencv_contrib.py --check diagnoses, --apply fixes.

48_panorama_playground.json uses this node and the advanced list variant; 01_install_example_inputs.json brings in panorama_A.png / panorama_B.png. Run it once and reload the page.

Where it bites

Choosing list vs batch is the whole skill here. If a node gives you a batch and you feed this one, you get exactly one stitched frame - from the first element's first frame - and no warning. If a loader gives you a list and you feed CV Stitch, you need an Image Batch → CV Batch conversion first.

Overlap still matters, as does order: items are stitched in list order, so a scrambled list gives a scrambled panorama. And the pack's own README is worth reading once - it's unusually frank that this is a personal, heavily LLM-assisted project with no support planned and demo-grade workflows. This particular node is a clean wrapper around cv2.Stitcher, which is the part you can rely on.

Categoryimage/CV/features

Inputs (9)

NameTypeDefaultDescription
imagesNPARRAY,IMAGE,MASKList of images to stitch. Each element is an IMAGE / LATENT / NPARRAY; only the first frame of each is used. Accepts a ComfyUI IMAGE/MASK directly (frame 0 of a batch) or an NPARRAY. Arithmetic ops (add, multiply, etc.) process the full IMAGE batch when both inputs have the same batch size.
modeCOMBOStitcher_PANORAMAStitching mode: PANORAMA (default, general panoramas) or SCANS (scans/linear scenes).
registration_resolFLOAT-1.00-1–100Resolution in megapixels for the registration stage (feature detection + matching). -1 = opencv default (auto-selects based on image count).
seam_estimation_resolFLOAT-1.00-1–100Resolution in megapixels for seam estimation. -1 = opencv default (auto). Higher = more memory, lower speed.
compositing_resolFLOAT-1.00-1–100Resolution in megapixels for compositing/warping phase. -1 = opencv default (auto). Higher = more memory, sharper result.
pano_confidence_threshFLOAT1.000–10Confidence threshold for seam estimation. Higher values produce fewer, longer seams (simpler blends). OpenCV default is 1.0.
wave_correctionCOMBOtrueEnable wave correction (horizontal drift compensation). Recommended for panoramas with rotational motion.
interpolation_flagsCOMBOINTER_LINEARInterpolation method used for the compositing warp. INTER_LINEAR (default) is fast and adequate for most panoramas; INTER_CUBIC or INTER_LANCZOS4 are sharper but slower.
masksoptNPARRAY,MASKOptional list of coverage masks (one per image in the image list). Accepts a ComfyUI IMAGE/MASK directly (frame 0 of a batch) or an NPARRAY. Arithmetic ops (add, multiply, etc.) process the full IMAGE batch when both inputs have the same batch size.

Outputs (3)

NameTypeDescription
panoramaNPARRAYStitched panorama (uint8 BGR). On failure returns a copy of the first input frame.
statusSTRING'OK' or an error label returned by cv2.Stitcher.stitch().
successBOOLEANTrue when stitching succeeded (status == OK). Use with IfElse to branch on success/failure.