Nodes/ComfyUI-TextureAlchemy/Crop to Mask (with Padding)
ComfyUI Node

Crop to Mask (with Padding)

A ComfyUI node in Texture Alchemist/Texture with 7 inputs and 10 outputs.

By amtarr·Created 8 months ago·Updated 4 months ago· 54
Crop to Mask (with Padding)
  • image
  • mask
  • image
  • mask
  • original_width
  • original_height
  • bbox_x
  • bbox_y
  • bbox_width
  • bbox_height
  • bbox_data
  • info
padding50
pad_to_squarefalse
padding_colorblack
custom_color#000000
invert_maskfalse
CategoryTexture Alchemist/Texture

Inputs (7)

NameTypeDefaultDescription
imageIMAGE
maskMASK
paddingINT500–500Padding in pixels (expands canvas)
pad_to_squareBOOLEANfalseExpand to square canvas (uses longest dimension)
padding_colorCOMBOblackuse_image (with pad to square): crop a square from the full input, centered on the mask—real image pixels, no solid/mirror. Other modes: from_crop/edge/mirror = fill from the tight mask crop; black/white/average/custom = solid/avg
custom_colorSTRING#000000Hex color for custom padding (e.g., #FF5733)
invert_maskBOOLEANfalseInvert mask (swap black/white)

Outputs (10)

NameTypeDescription
imageIMAGE
maskMASK
original_widthINT
original_heightINT
bbox_xINT
bbox_yINT
bbox_widthINT
bbox_heightINT
bbox_dataBBOX_DATA
infoSTRING