ComfyUI  >  Nodes  >  ComfyUI-Inpaint-CropAndStitch >  ✂️ Extend Image for Outpainting

ComfyUI Node: ✂️ Extend Image for Outpainting

Class Name

InpaintExtendOutpaint

Category
inpaint
Author
lquesada (Account age: 4048 days)
Extension
ComfyUI-Inpaint-CropAndStitch
Latest Updated
6/21/2024
Github Stars
0.1K

How to Install ComfyUI-Inpaint-CropAndStitch

Install this extension via the ComfyUI Manager by searching for  ComfyUI-Inpaint-CropAndStitch
  • 1. Click the Manager button in the main menu
  • 2. Select Custom Nodes Manager button
  • 3. Enter ComfyUI-Inpaint-CropAndStitch 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 Cloud 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

✂️ Extend Image for Outpainting Description

Efficient image inpainting with seamless extension and versatile context area specification for AI artists.

✂️ Extend Image for Outpainting:

The InpaintExtendOutpaint node is designed to facilitate efficient and high-quality inpainting by cropping the image before sampling and stitching it back together after sampling. This method ensures that unmasked areas remain unaltered, providing a seamless and natural extension of the image. The node allows you to specify the context area through pixel expansion, expansion factors, or an optional mask, making it versatile for various inpainting tasks. It supports different size modes, including free size, forced size, and ranged size, giving you flexibility in how you want to handle the image dimensions. This node is particularly beneficial for AI artists looking to extend or outpaint images without compromising the integrity of the original content.

✂️ Extend Image for Outpainting Input Parameters:

image

The image to be inpainted. This is the primary input where the inpainting process will be applied.

mask

The mask that defines the areas to be inpainted. Areas marked in the mask will be the focus of the inpainting process.

context_expand_pixels

An integer value that specifies the number of pixels to expand the context area around the masked region. This helps in providing additional context for better inpainting results. The default value is 20, with a minimum of 0 and a maximum defined by the node's maximum resolution.

context_expand_factor

A float value that determines the factor by which the context area should be expanded. This provides a scalable way to increase the context area. The default value is 1.0, with a minimum of 1.0 and a maximum of 100.0.

fill_mask_holes

A boolean parameter that, when set to True, fills any holes in the mask to ensure a continuous area for inpainting. The default value is True.

blur_mask_pixels

A float value that specifies the number of pixels to blur the mask edges. This helps in creating a smooth transition between the inpainted and original areas. The default value is 16.0, with a range from 0.0 to 64.0.

invert_mask

A boolean parameter that, when set to True, inverts the mask. This can be useful if you want to inpaint the areas outside the original mask. The default value is False.

blend_pixels

A float value that determines the number of pixels to blend the inpainted area with the original image. This helps in achieving a seamless integration. The default value is 16.0, with a range from 0.0 to 32.0.

rescale_algorithm

A selection parameter that allows you to choose the rescaling algorithm. Options include "nearest", "bilinear", "bicubic", and "bislerp". The default is "bicubic".

mode

A selection parameter that defines the size mode for the inpainting process. Options include "ranged size", "forced size", and "free size". The default is "ranged size".

force_width

An integer value that specifies the width to force the image to when using the "forced size" mode. The default value is 1024, with a minimum of 0 and a maximum defined by the node's maximum resolution.

force_height

An integer value that specifies the height to force the image to when using the "forced size" mode. The default value is 1024, with a minimum of 0 and a maximum defined by the node's maximum resolution.

rescale_factor

A float value that determines the factor by which the image should be rescaled in "free size" mode. The default value is 1.00, with a range from 0.01 to 100.0.

min_width

An integer value that specifies the minimum width for the image in "ranged size" mode. The default value is 512, with a minimum of 0 and a maximum defined by the node's maximum resolution.

min_height

An integer value that specifies the minimum height for the image in "ranged size" mode. The default value is 512, with a minimum of 0 and a maximum defined by the node's maximum resolution.

✂️ Extend Image for Outpainting Output Parameters:

image

The inpainted image. This is the primary output where the inpainting process has been applied, extending or outpainting the original image based on the provided mask and context parameters.

mask

The processed mask used during the inpainting. This output can be useful for further processing or for understanding how the inpainting was applied.

context_mask

The context mask that was used to define the area around the masked region. This output helps in visualizing the expanded context area that influenced the inpainting process.

✂️ Extend Image for Outpainting Usage Tips:

  • To achieve a seamless inpainting result, use the blur_mask_pixels parameter to smooth the edges of the mask.
  • Experiment with different rescale_algorithm options to find the best quality for your specific image.
  • Use the context_expand_pixels and context_expand_factor parameters to provide more context around the masked area, which can improve the inpainting quality.
  • If you need the image to be a specific size, use the forced size mode with force_width and force_height parameters.

✂️ Extend Image for Outpainting Common Errors and Solutions:

"Invalid mask dimensions"

  • Explanation: The dimensions of the mask do not match the dimensions of the image.
  • Solution: Ensure that the mask and image have the same dimensions before inputting them into the node.

"Unsupported rescale algorithm"

  • Explanation: The selected rescale algorithm is not supported.
  • Solution: Choose one of the supported rescale algorithms: "nearest", "bilinear", "bicubic", or "bislerp".

"Context area too large"

  • Explanation: The context area defined by context_expand_pixels or context_expand_factor exceeds the image boundaries.
  • Solution: Reduce the values of context_expand_pixels or context_expand_factor to fit within the image boundaries.

✂️ Extend Image for Outpainting Related Nodes

Go back to the extension to check out more related nodes.
ComfyUI-Inpaint-CropAndStitch
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.