Nodes/comfyui_cv/CV Stitch (Advanced)
ComfyUI Node

CV Stitch (Advanced)

Stitches a batch of images into a panorama using the low-level cv2.detail pipeline. Provides full control over feature detection, matching, camera estimation, warp type, exposure compensation, seam finding, and blending. Runs in a separate process so stitching can be interrupted mid-workflow. Accepts IMAGE, LATENT, or NPARRAY inputs via the polytype socket. 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 (Advanced)
  • images
  • masks
  • panorama
  • status
  • success
featuresorb
matcherbest_of_2_nearest
match_conf-1.00
range_width-1
estimatorhomography
bundle_adjusterray
pano_confidence_thresh1.00
warp_typespherical
wave_correctionauto
registration_resol-1.00
seam_estimation_resol-1.00
compositing_resol-1.00
interpolation_flagsINTER_LINEAR
exposure_compensationgain_blocks
expos_comp_nr_feeds1
expos_comp_nr_filtering2
expos_comp_block_size32
seam_findergc_colorgrad
blend_typemultiband
blend_strength5.0
Categoryimage/CV/features

Inputs (22)

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.
featuresCOMBOorbFeature detector type. ORB is fast and universally available. SIFT is more distinctive but slower.
matcherCOMBObest_of_2_nearestFeature matcher. best_of_2_nearest (default): standard pairwise matching. best_of_2_nearest_range: limits matching to neighbors within range_width. affine_best_of_2_nearest: for affine transformations (SCANS mode).
match_confFLOAT-1.00-1–1Feature match confidence threshold. -1 = auto (0.3 for ORB, 0.65 for SIFT). Higher = fewer, more reliable matches.
range_widthINT-1-1–100Range width for best_of_2_nearest_range matcher. -1 = match against all images. Only used when matcher is best_of_2_nearest_range.
estimatorCOMBOhomographyCamera estimator. homography (default): perspective transforms between images (PANORAMA mode). affine: affine transforms (SCANS mode, planar scenes).
bundle_adjusterCOMBOrayBundle adjustment cost function. ray (default): ray-based error. reproj: reprojection error. affine_partial: partial affine refinement. no: skip bundle adjustment.
pano_confidence_threshFLOAT1.000–10Confidence threshold for feature matching. Images with confidence below this are excluded. Also passed to the bundle adjuster.
warp_typeCOMBOsphericalProjection warp type. spherical (default): good for wide panoramas. plane: no warping (flat scenes). cylindrical: vertical lines stay straight. fisheye/stereographic/mercator: specialized projections.
wave_correctionCOMBOautoWave correction for horizontal/vertical drift. auto (default): auto-detect direction. horiz/vert: force direction. no: disable.
registration_resolFLOAT-1.00-1–100Resolution in megapixels for the registration stage (feature detection + matching). -1 = full resolution.
seam_estimation_resolFLOAT-1.00-1–100Resolution in megapixels for seam estimation and exposure compensation. -1 = full resolution.
compositing_resolFLOAT-1.00-1–100Resolution in megapixels for compositing/warping phase. -1 = full resolution.
interpolation_flagsCOMBOINTER_LINEARInterpolation method for warping. INTER_LINEAR (default) is fast; INTER_CUBIC or INTER_LANCZOS4 are sharper.
exposure_compensationCOMBOgain_blocksExposure compensation method. gain_blocks (default): local block gain. gain: global per-image gain. channel: per-channel gain. channel_blocks: local per-channel gain. no: disable.
expos_comp_nr_feedsINT11–10Number of exposure compensation feeds. Only used for channel / channel_blocks compensators.
expos_comp_nr_filteringINT21–10Number of filtering iterations for exposure compensation gains. Higher = smoother gain maps. Default 2. Only used for channel / channel_blocks compensators.
expos_comp_block_sizeINT321–256Block size (pixels) for block-based exposure compensators (gain_blocks, channel_blocks).
seam_finderCOMBOgc_colorgradSeam finding method. gc_colorgrad (default): GraphCut with color + gradient cost. gc_color: GraphCut, color only. dp_color / dp_colorgrad: dynamic programming. voronoi: Voronoi diagram. no: skip.
blend_typeCOMBOmultibandBlending method. multiband (default): Laplacian pyramid blend (best quality). feather: linear distance blend. no: direct cut.
blend_strengthFLOAT5.00–100Blending strength [0-100]. Higher = softer transition at seams. Default 5.0.
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 the detail pipeline.
successBOOLEANTrue when stitching succeeded (status == OK). Use with IfElse to branch on success/failure.