ComfyUI Extension: ComfyUI-MaskMorph
Directional mask expansion node that extends masks along specified directions with pixel-precise control, plus separate pinch/widen morphology operations.
Custom Nodes (0)
README
Directional Mask Expand (ComfyUI custom node)
Expands a mask along a specified direction, measured clockwise in degrees:
0= up,90= right,180= down,270= left.pixelscontrols how many pixels to extend along that vector.- If
pixelsis0, the mask is returned unchanged.
Separate node for pinch/widen:
- Mask Pinch/Widen: keeps the outer silhouette fixed and adjusts inner gaps by operating inside the mask’s bounding box using directional morphology on the inverted mask.
vertical_pinch/vertical_widen: operate horizontally on the gap between left/right sides.horizontal_pinch/horizontal_widen: operate vertically on the gap between top/bottom.taper_amount= pixel amount for the operation;0disables the effect.
Installation
- Place this folder inside
ComfyUI/custom_nodes/(already done here). - Install any extra deps if you add them to
requirements.txt(none needed by default). - Restart or reload ComfyUI custom nodes.
Usage
- Add Directional Mask Expand from the
maskcategory.- Inputs:
mask,angle_deg(float),pixels(int). - Output: expanded
MASK.
- Inputs:
- Add Mask Pinch/Widen from the
maskcategory.- Inputs:
mask,taper_amount(int), pinch/widen toggles. - Output: reshaped
MASK.
- Inputs:
Notes
- The node includes
IS_CHANGEDso it won't re-run when inputs are unchanged.