ComfyUI nodes to crop before sampling and stitch back after sampling that speed up inpainting
Paketprofil
README
ComfyUI-Inpaint-CropAndStitch
Copyright (c) 2024-2026, Luis Quesada Torres - https://github.com/lquesada | www.luisquesada.com
Check ComfyUI here: https://github.com/comfyanonymous/ComfyUI
Verwandte Ressourcen
19 VerbindungenQuellen
3 QuellenVerifiziert 15. Juli
Quellenauszüge
1 AuszugSource context: Repo lquesada/ComfyUI-Inpaint-CropAndStitch
The '✂️ Inpaint Crop' and '✂️ Inpaint Stitch' nodes enable inpainting only on masked area very easily
"✂️ Inpaint Crop" crops the image around the masked area (optionally with a context area that marks all parts relevant to the context), taking care of pre-resizing the image if desired, extending it for outpainting, filling mask holes, growing or blurring the mask, cutting around a larger context area, and resizing the cropped area to a target resolution.
The cropped image can be used in any standard workflow for sampling. It can even be rescaled up with any model (please keep the aspect ratio) and hiRes-fixed and it will be retrofit in the original image.
Then, the "✂️ Inpaint Stitch" node stitches the inpainted image back into the original image without altering unmasked areas.
The main advantages of inpainting only in a masked area with these nodes are:
GenAI is not just for the sake of GenAI, but to unblock creativity and empower humans. I am not only a developer; I use GenAI myself to do more things better than I could otherwise do.
Do you like this node? Check, listen to, or follow my GenAI music project Windlereye on Spotify to support me!
Note: this video tutorial is for the previous version of the nodes, but still it shows how to use them. The parameters are mostly the same.
downscale_algorithm and upscale_algorithm: Which algorithms to use when resizing an image up or down.preresize: Shows options to resize the input image before any cropping: to ensure minimum resolution, to ensure maximum resolution, to ensure both minimum and maximum resolution. This makes it very convenient to ensure that any input images have a certain resolution.mask_fill_holes: Whether to fully fill any holes (small or large) in the mask, that is, mark fully enclosed areas as part of the mask.mask_expand_pixels: Grows the mask by the specified amount of pixels.mask_invert: Whether to fully invert the mask, that is, only keep what was masked, instead of removing what was marked.mask_blend_pixels: Grows the stitch mask and blurs it by the specified amount of pixels, so that the stitch is slowly blended and there are no seams.mask_hipass_filter: Ignores mask values lower than the one specified here. This is to avoid sections in the mask that are almost 0 (black) to count as masked area. Sometimes that leads to confusion, as the user believes the area is not really masked and the node is considering it as masked.extend_for_outpainting: Shows options to extend the mask in any/all directions (up/down/left/right) by a certain factor. >1 extends the image, e.g. 2 extends the image in a direction by the same amount of space the image takesKnoten in diesem Paket
2 Knoten (Plural)Verifiziert 4. Aug.