ComfyUI > Nodes > ComfyUI Level Pixel > Inpaint Crop [LP]

ComfyUI Node: Inpaint Crop [LP]

Class Name

InpaintCrop|LP

Category
LevelPixel/Inpaint
Author
LevelPixel (Account age: 647days)
Extension
ComfyUI Level Pixel
Latest Updated
2026-02-24
Github Stars
0.03K

How to Install ComfyUI Level Pixel

Install this extension via the ComfyUI Manager by searching for ComfyUI Level Pixel
  • 1. Click the Manager button in the main menu
  • 2. Select Custom Nodes Manager button
  • 3. Enter ComfyUI Level Pixel in the search bar
After installation, click the Restart button to restart ComfyUI. Then, manually refresh your browser to clear the cache and access the updated list of nodes.

Visit ComfyUI Online for ready-to-use ComfyUI environment

  • Free trial available
  • 16GB VRAM to 80GB VRAM GPU machines
  • 400+ preloaded models/nodes
  • Freedom to upload custom models/nodes
  • 200+ ready-to-run workflows
  • 100% private workspace with up to 200GB storage
  • Dedicated Support

Run ComfyUI Online

Inpaint Crop [LP] Description

Facilitates precise inpainting by cropping images around a specified mask for focused editing.

Inpaint Crop [LP]| Inpaint Crop [LP]:

The Inpaint Crop [ Inpaint Crop [LP]] node is designed to facilitate the process of inpainting by cropping an image around a specified mask. This node is particularly useful for artists and designers who need to focus on specific areas of an image for inpainting, allowing for precise and efficient editing. The node's primary function is to isolate the region of interest defined by a mask, and optionally, an additional context mask can be used to retain extra areas for contextual purposes. This capability is essential for maintaining the integrity of the surrounding image while focusing on the inpainting task. By using this node, you can ensure that the cropped area is perfectly aligned with the mask, preventing any shape mismatch errors and optimizing the inpainting process.

Inpaint Crop [LP]| Inpaint Crop [LP] Input Parameters:

image

The image parameter represents the original image that you want to crop for inpainting. It is crucial as it serves as the base for the cropping operation. The image should be in a format compatible with the node's processing capabilities, typically a tensor or an image object. There are no specific minimum or maximum values for this parameter, but the image should be of a reasonable size for processing.

mask

The mask parameter defines the area of the image that you want to focus on for inpainting. This mask is used to determine the cropping boundaries. It should match the dimensions of the image to avoid any shape mismatch errors. The mask is essential for isolating the region of interest and ensuring that the inpainting is applied accurately.

optional_context_mask

The optional_context_mask parameter allows you to specify an additional area to retain for contextual purposes. This mask can be used to include extra regions around the primary mask, providing more context for the inpainting process. It should have the same dimensions as the primary mask to ensure compatibility. This parameter is optional and can be omitted if no additional context is needed.

extend_factor_parameters

The extend_factor_parameters parameter is used to define the extension factors for the cropping operation. These factors determine how much the cropping area should be extended in each direction (up, down, left, right). If not provided, default values of 1.0 are used, meaning no extension. This parameter is useful for adjusting the cropping area to include more of the surrounding image if needed.

output_padding

The output_padding parameter specifies the amount of padding to add to the cropped output. This padding can help ensure that the cropped image and mask maintain a consistent size, especially when working with batch processing. The value should be an integer, and it can be adjusted based on the desired output size.

Inpaint Crop [LP]| Inpaint Crop [LP] Output Parameters:

crop_data

The crop_data output provides information about the cropping operation, including the dimensions and position of the cropped area. This data is essential for understanding how the image was cropped and can be used for further processing or analysis.

cropped_image

The cropped_image output is the result of the cropping operation, containing only the area of the image defined by the mask and any optional context. This output is crucial for inpainting, as it isolates the region of interest and allows for focused editing.

cropped_mask

The cropped_mask output is the mask corresponding to the cropped image. It ensures that the inpainting process is applied accurately to the intended area. This output is important for maintaining the integrity of the inpainting operation and ensuring that the mask aligns with the cropped image.

Inpaint Crop [LP]| Inpaint Crop [LP] Usage Tips:

  • Ensure that the mask and optional_context_mask have the same dimensions as the image to avoid shape mismatch errors.
  • Use the extend_factor_parameters to adjust the cropping area if you need to include more of the surrounding image for context.
  • Consider using output_padding to maintain consistent output sizes, especially when processing batches of images.

Inpaint Crop [LP]| Inpaint Crop [LP] Common Errors and Solutions:

Shape mismatch error

  • Explanation: This error occurs when the dimensions of the mask or optional_context_mask do not match the dimensions of the image.
  • Solution: Ensure that all masks have the same dimensions as the image before processing.

Batch mode error

  • Explanation: This error arises when processing a batch of images without using the appropriate size parameters.
  • Solution: Use the Cropped Forsed Size Parameters node or ensure that all images in the batch have the same size to avoid this error.

Inpaint Crop [LP] Related Nodes

Go back to the extension to check out more related nodes.
ComfyUI Level Pixel
RunComfy
Copyright 2025 RunComfy. All Rights Reserved.

RunComfy is the premier ComfyUI platform, offering ComfyUI online environment and services, along with ComfyUI workflows featuring stunning visuals. RunComfy also provides AI Models, enabling artists to harness the latest AI tools to create incredible art.

Inpaint Crop [LP]