ComfyUI Node
Crop For Inpaint π
Cuts the masked region plus surrounding context out of an image so an inpainter works at native resolution, and emits a stitcher that Stitch Inpaint π uses to paste the result back seamlessly. The selection can be inverted, grown or shrunk, and edge-softened before cropping; context comes from a growth factor plus optional flat pixels. target_megapixels rescales the crop to a sampler-friendly area, and the extend inputs grow the frame itself for outpainting. By default the sampling mask stays hard-edged; feathering lives in a separate blend mask used only while pasting. An empty mask selects the full image and stitches back unchanged.
Crop For Inpaint π
- image
- mask
- image
- mask
- stitcher
βcontext_factor1.20βΊ
βblend_pixels16βΊ
βoutput_multiple8βΊ
βtarget_width0βΊ
βtarget_height0βΊ
βmask_grow0βΊ
βmask_blur0.0βΊ
βinvert_maskfalseβΊ
βcontext_pixels0βΊ
βtarget_megapixels0.00βΊ
βrescale_algorithmbilinearβΊ
βextend_left0βΊ
βextend_right0βΊ
βextend_up0βΊ
βextend_down0βΊ
Categoryπ AusBoss/Inpaint
Inputs (17)
| Name | Type | Default | Description |
|---|---|---|---|
| image | IMAGE | BHWC image or video frames to crop around the mask. | |
| mask | MASK | White marks the area to inpaint. A multi-frame mask is unioned into one crop window; an empty mask selects the whole image. | |
| context_factor | FLOAT | 1.201β10 | Grows the mask bounding box symmetrically by this factor so the inpainter sees surrounding context. |
| blend_pixels | INT | 160β256 | Feather width for pasting the result back: the paste mask is widened by this many pixels and blurred. The sampling mask is never feathered. 0 pastes hard. |
| output_multiple | INT | 81β128 | Crop and target dimensions are rounded up to a multiple of this so samplers accept them. |
| target_widthopt | INT | 00β16384 | Rescale the crop to this width for the sampler; 0 keeps the native crop width (or follows target_height at the crop's aspect ratio). |
| target_heightopt | INT | 00β16384 | Rescale the crop to this height for the sampler; 0 keeps the native crop height (or follows target_width at the crop's aspect ratio). |
| mask_growopt | INT | 0-256β256 | Dilate the sampling mask by this many pixels (negative shrinks) so the inpainter repaints past the drawn edge. Reshapes what gets painted, unlike blend_pixels which only feathers the paste-back. |
| mask_bluropt | FLOAT | 0.00β64 | Gaussian sigma softening the sampling mask's edge for models that honor soft masks. 0 keeps the hard edge. |
| invert_maskopt | BOOLEAN | false | Inpaint the black area instead of the white area β everything outside the drawn region. |
| context_pixelsopt | INT | 00β4096 | Flat extra context in pixels added around the mask box after context_factor's growth. |
| target_megapixelsopt | FLOAT | 0.000β64 | Rescale the crop for the sampler so its area is about this many megapixels β 1.0 suits SDXL-class models, 0 keeps the native crop size. Explicit target_width/height overrides this. |
| rescale_algorithmopt | COMBO | bilinear | Resize filter for the sampler round trip. bilinear is the safe default, bicubic keeps upscales a touch crisper, area suits heavy downscales, nearest never invents pixels. |
| extend_leftopt | INT | 00β8192 | Outpainting: grow the frame this many pixels leftward. The new band is added to the mask and becomes part of the stitched output. |
| extend_rightopt | INT | 00β8192 | Outpainting: grow the frame this many pixels rightward. The new band is added to the mask and becomes part of the stitched output. |
| extend_upopt | INT | 00β8192 | Outpainting: grow the frame this many pixels upward. The new band is added to the mask and becomes part of the stitched output. |
| extend_downopt | INT | 00β8192 | Outpainting: grow the frame this many pixels downward. The new band is added to the mask and becomes part of the stitched output. |
Outputs (3)
| Name | Type | Description |
|---|---|---|
| image | IMAGE | Cropped BHWC region around the mask, sized for the sampler. |
| mask | MASK | Hard-edged sampling mask matching the crop; never feathered. |
| stitcher | AUSBOSS_STITCHER | Stitch data for Stitch Inpaint π: canvas, rects, blend mask, scale. |