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.
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)
| Name | Type | Default | Description |
|---|---|---|---|
| image | IMAGE | — | |
| downscale_algorithm | COMBO | bilinear | 6 options: nearest, bilinear, bicubic, lanczos, box, hamming |
| upscale_algorithm | COMBO | bicubic | 6 options: nearest, bilinear, bicubic, lanczos, box, hamming |
| preresize | BOOLEAN | false | Resize the original image before processing. |
| preresize_mode | COMBO | ensure minimum resolution | 3 options: ensure minimum resolution, ensure maximum resolution, ensure minimum and maximum resolution |
| preresize_min_width | INT | 10240–16384 | — |
| preresize_min_height | INT | 10240–16384 | — |
| preresize_max_width | INT | 163840–16384 | — |
| preresize_max_height | INT | 163840–16384 | — |
| mask_fill_holes | BOOLEAN | true | Mark as masked any areas fully enclosed by mask. |
| mask_expand_pixels | INT | 00–16384 | Expand the mask by a certain amount of pixels before processing. |
| mask_invert | BOOLEAN | false | Invert mask so that anything masked will be kept. |
| mask_blend_pixels | INT | 320–64 | How many pixels to blend into the original image. |
| mask_hipass_filter | FLOAT | 0.100–1 | Ignore mask values lower than this value. |
| extend_for_outpainting | BOOLEAN | false | Extend the image for outpainting. |
| extend_up_factor | FLOAT | 1.000.01–100 | — |
| extend_down_factor | FLOAT | 1.000.01–100 | — |
| extend_left_factor | FLOAT | 1.000.01–100 | — |
| extend_right_factor | FLOAT | 1.000.01–100 | — |
| context_from_mask_extend_factor | FLOAT | 1.201–100 | Grow 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_size | BOOLEAN | true | Force a specific resolution for sampling. |
| output_target_width | INT | 51264–16384 | — |
| output_target_height | INT | 51264–16384 | — |
| output_padding | COMBO | 32 | 8 options: 0, 8, 16, 32, 64, 128, +2 |
| device_mode | COMBO | cpu (compatible) | 2 options: cpu (compatible), gpu (much faster) |
| maskopt | MASK | — | |
| optional_context_maskopt | MASK | — |
Outputs (3)
| Name | Type | Description |
|---|---|---|
| stitcher | STITCHER | — |
| cropped_image | IMAGE | — |
| cropped_mask | MASK | — |