Nodes/ComfyUi-MpiNodes/Mpi Inpaint Crop
ComfyUI Node

Mpi Inpaint Crop

Crops an image around a mask for inpainting, the optional context mask defines an extra area to keep for the context.

By MadPonyInteractive·Created about a year ago·Updated a day ago· 4
Mpi Inpaint Crop
  • image
  • mask
  • optional_context_mask
  • stitcher
  • cropped_image
  • cropped_mask
◄downscale_algorithmbilinear►
◄upscale_algorithmbicubic►
◄preresizefalse►
◄preresize_modeensure minimum resolution►
◄preresize_min_width1024►
◄preresize_min_height1024►
◄preresize_max_width16384►
◄preresize_max_height16384►
◄mask_fill_holestrue►
◄mask_expand_pixels0►
◄mask_invertfalse►
◄mask_blend_pixels32►
◄mask_hipass_filter0.10►
◄extend_for_outpaintingfalse►
◄extend_up_factor1.00►
◄extend_down_factor1.00►
◄extend_left_factor1.00►
◄extend_right_factor1.00►
◄context_from_mask_extend_factor1.20►
◄output_resize_to_target_sizetrue►
◄output_target_width512►
◄output_target_height512►
◄output_padding32►
◄device_modecpu (compatible)►
Categoryinpaint

Inputs (27)

NameTypeDefaultDescription
imageIMAGE—
downscale_algorithmCOMBObilinear6 options: nearest, bilinear, bicubic, lanczos, box, hamming
upscale_algorithmCOMBObicubic6 options: nearest, bilinear, bicubic, lanczos, box, hamming
preresizeBOOLEANfalseResize the original image before processing.
preresize_modeCOMBOensure minimum resolution3 options: ensure minimum resolution, ensure maximum resolution, ensure minimum and maximum resolution
preresize_min_widthINT10240–16384—
preresize_min_heightINT10240–16384—
preresize_max_widthINT163840–16384—
preresize_max_heightINT163840–16384—
mask_fill_holesBOOLEANtrueMark as masked any areas fully enclosed by mask.
mask_expand_pixelsINT00–16384Expand the mask by a certain amount of pixels before processing.
mask_invertBOOLEANfalseInvert mask so that anything masked will be kept.
mask_blend_pixelsINT320–64How many pixels to blend into the original image.
mask_hipass_filterFLOAT0.100–1Ignore mask values lower than this value.
extend_for_outpaintingBOOLEANfalseExtend the image for outpainting.
extend_up_factorFLOAT1.000.01–100—
extend_down_factorFLOAT1.000.01–100—
extend_left_factorFLOAT1.000.01–100—
extend_right_factorFLOAT1.000.01–100—
context_from_mask_extend_factorFLOAT1.201–100Grow the context area from the mask by a certain factor in every direction. For example, 1.5 grabs extra 50% up, down, left, and right as context.
output_resize_to_target_sizeBOOLEANtrueForce a specific resolution for sampling.
output_target_widthINT51264–16384—
output_target_heightINT51264–16384—
output_paddingCOMBO328 options: 0, 8, 16, 32, 64, 128, +2
device_modeCOMBOcpu (compatible)2 options: cpu (compatible), gpu (much faster)
maskoptMASK—
optional_context_maskoptMASK—

Outputs (3)

NameTypeDescription
stitcherSTITCHER—
cropped_imageIMAGE—
cropped_maskMASK—