Nodes/ComfyUI-AusBoss/Cut Out πŸ†Ž
ComfyUI Node

Cut Out πŸ†Ž

Turns a picture and a mask into a cut-out with a see-through background, ready to save as a PNG or lay on a new background. Keep the white or the black part of the mask, grow or shrink it and soften its edge. Clean edges takes the old background's colour out of hair and soft edges, so the cut-out has no halo on a new background; pixels that are fully kept stay exactly as they were. Works on video frames too.

By ausbossΒ·Created 4 months agoΒ·Updated about 5 hours agoΒ· 163
Cut Out πŸ†Ž
  • image
  • mask
  • image
  • alpha
β—„keepwhiteβ–Ί
β—„grow0β–Ί
β—„feather1.0β–Ί
β—„clean_edgestrueβ–Ί
β—„clear_haze0.00β–Ί
β—„solid_above1.00β–Ί
β—„smooth_frames0β–Ί
β—„previewtrueβ–Ί
CategoryπŸ†Ž AusBoss/Image

Inputs (10)

NameTypeDefaultDescription
imageIMAGEThe picture or video frames to cut out.
maskMASKWhat to keep. One mask can serve every frame of a video.
keepCOMBOwhiteKeep the part under the white of the mask, or under the black.
growINT0-256–256Grow the kept part by this many pixels, or shrink it with a negative number.
featherFLOAT1.00–256How soft the edge is, in pixels. 0 keeps the mask's own edge.
clean_edgesBOOLEANtrueTake the old background's colour out of soft edges and hair, so the cut-out has no halo on a new background.
clear_hazeFLOAT0.000–1Parts this see-through or more become fully clear. Raise it a little to clear a faint haze around the cut-out.
solid_aboveFLOAT1.000–1Parts at least this solid become fully solid. Lower it a little to fill thin see-through spots inside the subject.
smooth_framesINT00–8For a video: blend each frame's edge with this many frames before and after it, which calms a flickering edge. 0 is off.
previewoptBOOLEANtrueShow the cut-out on its face, over a checkerboard. Off skips writing the preview file to ComfyUI's temp folder.

Outputs (2)

NameTypeDescription
imageIMAGEThe cut-out with a see-through background (RGBA). Save Image keeps the transparency in a PNG.
alphaMASKHow solid each pixel of the cut-out is: white is kept, black is clear.