ComfyUI > Nodes > ComfyUI_Fill-Nodes > FL Inpaint Crop

ComfyUI Node: FL Inpaint Crop

Class Name

FL_InpaintCrop

Category
🏵️Fill Nodes
Author
filliptm (Account age: 1737days)
Extension
ComfyUI_Fill-Nodes
Latest Updated
2024-06-23
Github Stars
0.12K

How to Install ComfyUI_Fill-Nodes

Install this extension via the ComfyUI Manager by searching for ComfyUI_Fill-Nodes
  • 1. Click the Manager button in the main menu
  • 2. Select Custom Nodes Manager button
  • 3. Enter ComfyUI_Fill-Nodes 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
  • High-speed GPU machines
  • 200+ preloaded models/nodes
  • Freedom to upload custom models/nodes
  • 50+ ready-to-run workflows
  • 100% private workspace with up to 200GB storage
  • Dedicated Support

Run ComfyUI Online

FL Inpaint Crop Description

Versatile node for inpainting images, cropping, and expanding context for AI artists to repair or modify specific areas effectively.

FL Inpaint Crop:

FL_InpaintCrop is a versatile node designed to facilitate the inpainting process by cropping and preparing images and masks for further manipulation. This node is particularly useful for AI artists who need to seamlessly repair or modify specific areas of an image. By expanding the context around the masked area, it ensures that the inpainting process has enough surrounding information to produce coherent and visually appealing results. The node offers various options to control the cropping and context expansion, making it adaptable to different inpainting scenarios. Whether you need to fill in missing parts of an image or remove unwanted elements, FL_InpaintCrop provides the necessary tools to achieve high-quality results.

FL Inpaint Crop Input Parameters:

image

The image parameter represents the input image that you want to process. This is the primary image on which the inpainting will be performed. The quality and resolution of this image will directly impact the final output.

mask

The mask parameter is a binary mask that indicates the areas of the image that need to be inpainted. Areas marked with 1 (or white) will be inpainted, while areas marked with 0 (or black) will remain unchanged. This mask guides the inpainting process to focus on specific regions.

context_expand_pixels

This parameter defines the number of pixels by which the context around the masked area should be expanded. Expanding the context helps the inpainting algorithm to have more surrounding information, leading to better results. The value should be an integer, with higher values providing more context.

context_expand_factor

The context_expand_factor parameter is a multiplier that scales the context area around the mask. This factor allows for proportional expansion based on the size of the masked area. A value greater than 1 will increase the context area, while a value less than 1 will decrease it.

invert_mask

The invert_mask parameter is a boolean flag that, when set to true, inverts the mask. This means that areas marked for inpainting will be swapped with areas to remain unchanged. This can be useful in scenarios where the initial mask needs to be reversed.

fill_mask_holes

This boolean parameter determines whether holes in the mask should be filled before inpainting. Filling holes can help create a more contiguous area for inpainting, leading to smoother and more natural results.

mode

The mode parameter specifies the operational mode of the node. Different modes may offer various inpainting strategies or adjustments, such as free size or fixed size. The exact modes available depend on the implementation.

force_size

This parameter allows you to force the output to a specific size. It can be useful when you need the inpainted image to match certain dimensions, regardless of the original image size.

rescale_factor

The rescale_factor parameter is used to scale the image and mask before inpainting. This can help in scenarios where the image needs to be upscaled or downscaled to match the desired output resolution. The value should be a float, with 1.0 indicating no rescaling.

padding

Padding adds extra space around the cropped area to ensure that the inpainting process has enough room to blend the new content seamlessly. The value should be an integer, with higher values providing more padding.

optional_context_mask

This optional parameter allows you to provide an additional context mask. If provided, it should match the dimensions of the input image. This mask can be used to further refine the context area for inpainting.

FL Inpaint Crop Output Parameters:

stitch

The stitch output is a dictionary containing information about the original image, the cropped mask, and the coordinates of the cropped area. This information is essential for the subsequent stitching process, ensuring that the inpainted area is correctly aligned with the original image.

cropped_image

The cropped_image output is the portion of the input image that has been cropped based on the mask and context expansion parameters. This image is ready for inpainting and contains the area that needs to be modified.

cropped_mask

The cropped_mask output is the corresponding mask for the cropped image. It indicates the areas within the cropped image that need to be inpainted, ensuring that the inpainting process focuses on the correct regions.

FL Inpaint Crop Usage Tips:

  • Use a higher context_expand_pixels value to provide more surrounding information for better inpainting results.
  • Experiment with the context_expand_factor to find the optimal balance between context size and processing time.
  • Invert the mask if the initial mask selection is incorrect, saving time on manual adjustments.
  • Utilize the fill_mask_holes option to ensure a more contiguous inpainting area, especially for complex masks.
  • Adjust the rescale_factor to match the desired output resolution, ensuring that the inpainted image fits seamlessly with the original.

FL Inpaint Crop Common Errors and Solutions:

"context_mask size must match image size"

  • Explanation: This error occurs when the optional_context_mask provided does not match the dimensions of the input image.
  • Solution: Ensure that the optional_context_mask has the same width and height as the input image before passing it to the node.

"No non-zero indices in the context_mask"

  • Explanation: This error indicates that the context_mask does not contain any areas marked for inpainting.
  • Solution: Verify that the mask and optional_context_mask correctly highlight the areas to be inpainted. Adjust the mask to ensure it includes the desired regions.

"Invalid rescale_factor value"

  • Explanation: This error occurs when the rescale_factor is set to a value outside the acceptable range.
  • Solution: Ensure that the rescale_factor is a float value close to 1.0. Values significantly lower or higher than 1.0 may cause issues with the inpainting process.

FL Inpaint Crop Related Nodes

Go back to the extension to check out more related nodes.
ComfyUI_Fill-Nodes
RunComfy

© Copyright 2024 RunComfy. All Rights Reserved.

RunComfy is the premier ComfyUI platform, offering ComfyUI online environment and services, along with ComfyUI workflows featuring stunning visuals.