Nodes/comfyui_cv/CV Stitch
ComfyUI Node

CV Stitch

Stitches a batch of images into a panorama (cv2.Stitcher). Runs cv2.Stitcher in a separate process so stitching can be interrupted mid-workflow. Accepts IMAGE, LATENT, or NPARRAY inputs via the polytype socket. For batch stitching (2+ images), provide the frames as a batched NPARRAY from 'Image Batch → CV Batch' (uint8 recommended so cv2 receives the correct dtype). A single IMAGE or LATENT frame produces no panorama (ERR_NEED_MORE_IMGS). Returns the stitched panorama, a status label, and a success flag for downstream branching - a failed stitch never halts the workflow.

By bmad4ever·Created 3 months ago·Updated 2 days ago· 0
CV Stitch
  • 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
Categoryimage/CV/features

Inputs (9)

NameTypeDefaultDescription
imagesNPARRAY,IMAGE,MASKImage batch to stitch. IMAGE/LATENT: frame 0 only. NPARRAY batch [B,H,W,C]: all B frames are stitched in order. Use 'Image Batch → CV Batch' to convert a ComfyUI IMAGE batch into a batched NPARRAY. 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 coverage mask batch (same B dim as the image batch, or a single mask shared by all frames). 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.