Nodes/comfyui_cv/CV Feather Blend
ComfyUI Node

CV Feather Blend

Blends two same-size images by their coverage: pixels covered by only one image are copied untouched, and in the overlap the weights ramp linearly with the distance to each image's border (cv2.distanceTransform) over 'feather' pixels - a seamless transition for panorama stitching. Coverage masks default to the non-black pixels of each image; for warped images connect the warped 'CV Constant Like' masks instead, which also keeps true-black image content from being treated as uncovered. The weights output (1 = pure image_a) previews well as a heatmap.

By bmad4ever·Created 3 months ago·Updated 2 days ago· 0
CV Feather Blend
  • image_a
  • image_b
  • mask_a
  • mask_b
  • image
  • weights
feather32
Categoryimage/CV/features

Inputs (5)

NameTypeDefaultDescription
image_aCOMFY_MATCHTYPE_V3First image, already on the shared output canvas. 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.
image_bCOMFY_MATCHTYPE_V3Second image, same size and format as image_a. 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.
featherFLOAT320–1024Transition width in pixels inside the overlap. 0 = hard 50/50 average where both images are valid.
mask_aoptNPARRAY,MASKCoverage of image_a (>0 = valid). Default: non-black pixels of image_a. 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.
mask_boptNPARRAY,MASKCoverage of image_b. Default: non-black pixels of image_b. 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 (2)

NameTypeDescription
imageCOMFY_MATCHTYPE_V3Blended image in the inputs' format; black where neither input is covered.
weightsNPARRAYHxW float32 share of image_a (1 = pure A, 0 = pure B) - debug it with 'Preview CV Array' in heatmap mode.