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.
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)
| Name | Type | Default | Description |
|---|---|---|---|
| images | NPARRAY,IMAGE,MASK | Image 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. | |
| features | COMBO | orb | Feature detector type. ORB is fast and universally available. SIFT is more distinctive but slower. |
| matcher | COMBO | best_of_2_nearest | Feature 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_conf | FLOAT | -1.00-1–1 | Feature match confidence threshold. -1 = auto (0.3 for ORB, 0.65 for SIFT). Higher = fewer, more reliable matches. |
| range_width | INT | -1-1–100 | Range width for best_of_2_nearest_range matcher. -1 = match against all images. Only used when matcher is best_of_2_nearest_range. |
| estimator | COMBO | homography | Camera estimator. homography (default): perspective transforms between images (PANORAMA mode). affine: affine transforms (SCANS mode, planar scenes). |
| bundle_adjuster | COMBO | ray | Bundle adjustment cost function. ray (default): ray-based error. reproj: reprojection error. affine_partial: partial affine refinement. no: skip bundle adjustment. |
| pano_confidence_thresh | FLOAT | 1.000–10 | Confidence threshold for feature matching. Images with confidence below this are excluded. Also passed to the bundle adjuster. |
| warp_type | COMBO | spherical | Projection warp type. spherical (default): good for wide panoramas. plane: no warping (flat scenes). cylindrical: vertical lines stay straight. fisheye/stereographic/mercator: specialized projections. |
| wave_correction | COMBO | auto | Wave correction for horizontal/vertical drift. auto (default): auto-detect direction. horiz/vert: force direction. no: disable. |
| registration_resol | FLOAT | -1.00-1–100 | Resolution in megapixels for the registration stage (feature detection + matching). -1 = full resolution. |
| seam_estimation_resol | FLOAT | -1.00-1–100 | Resolution in megapixels for seam estimation and exposure compensation. -1 = full resolution. |
| compositing_resol | FLOAT | -1.00-1–100 | Resolution in megapixels for compositing/warping phase. -1 = full resolution. |
| interpolation_flags | COMBO | INTER_LINEAR | Interpolation method for warping. INTER_LINEAR (default) is fast; INTER_CUBIC or INTER_LANCZOS4 are sharper. |
| exposure_compensation | COMBO | gain_blocks | Exposure 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_feeds | INT | 11–10 | Number of exposure compensation feeds. Only used for channel / channel_blocks compensators. |
| expos_comp_nr_filtering | INT | 21–10 | Number of filtering iterations for exposure compensation gains. Higher = smoother gain maps. Default 2. Only used for channel / channel_blocks compensators. |
| expos_comp_block_size | INT | 321–256 | Block size (pixels) for block-based exposure compensators (gain_blocks, channel_blocks). |
| seam_finder | COMBO | gc_colorgrad | Seam 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_type | COMBO | multiband | Blending method. multiband (default): Laplacian pyramid blend (best quality). feather: linear distance blend. no: direct cut. |
| blend_strength | FLOAT | 5.00–100 | Blending strength [0-100]. Higher = softer transition at seams. Default 5.0. |
| masksopt | NPARRAY,MASK | Optional 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)
| Name | Type | Description |
|---|---|---|
| panorama | NPARRAY | Stitched panorama (uint8 BGR). On failure returns a copy of the first input frame. |
| status | STRING | 'OK' or an error label returned by the detail pipeline. |
| success | BOOLEAN | True when stitching succeeded (status == OK). Use with IfElse to branch on success/failure. |