ComfyUI > Nodes > ComfyUI Layer Style > LayerUtility: ExtendCanvas

ComfyUI Node: LayerUtility: ExtendCanvas

Class Name

LayerUtility: ExtendCanvas

Category
😺dzNodes/LayerUtility
Author
chflame163 (Account age: 445days)
Extension
ComfyUI Layer Style
Latest Updated
2024-06-24
Github Stars
0.64K

How to Install ComfyUI Layer Style

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

LayerUtility: ExtendCanvas Description

Extend image canvas with borders, padding, and color fill; control extension areas with mask and inversion option.

LayerUtility: ExtendCanvas:

The LayerUtility: ExtendCanvas node is designed to extend the canvas of an image by adding extra space around its edges. This can be particularly useful for creating borders, adding padding, or preparing an image for further processing or compositing. The node allows you to specify the amount of space to add on each side of the image (top, bottom, left, and right) and fill this space with a specified color. Additionally, you can use a mask to control which areas of the extended canvas are affected, and an option to invert the mask is also available. This node is essential for AI artists looking to manipulate image dimensions and create visually appealing compositions with precise control over the canvas extension process.

LayerUtility: ExtendCanvas Input Parameters:

image

The image parameter is the primary input image that you want to extend. It accepts an image file and serves as the base for the canvas extension process.

invert_mask

The invert_mask parameter is a boolean option that allows you to invert the mask used in the canvas extension process. When set to true, the areas of the mask that are normally excluded will be included, and vice versa. The default value is true.

top

The top parameter specifies the number of pixels to add to the top edge of the image. It is an integer value with a default of 0, a minimum of 0, and a maximum of 99999.

bottom

The bottom parameter specifies the number of pixels to add to the bottom edge of the image. It is an integer value with a default of 0, a minimum of 0, and a maximum of 99999.

left

The left parameter specifies the number of pixels to add to the left edge of the image. It is an integer value with a default of 0, a minimum of 0, and a maximum of 99999.

The right parameter specifies the number of pixels to add to the right edge of the image. It is an integer value with a default of 0, a minimum of 0, and a maximum of 99999.

color

The color parameter determines the color used to fill the extended areas of the canvas. It accepts a color value in hexadecimal format, with a default of "#000000" (black).

mask

The mask parameter is an optional input that allows you to provide a mask image to control which areas of the extended canvas are affected. If no mask is provided, the entire extended area will be filled with the specified color.

LayerUtility: ExtendCanvas Output Parameters:

image

The image output parameter provides the resulting image after the canvas has been extended. This image includes the additional space added to the specified edges, filled with the chosen color.

mask

The mask output parameter returns the mask used in the canvas extension process. If no mask was provided as input, this will be the default mask applied during the operation.

LayerUtility: ExtendCanvas Usage Tips:

  • To create a uniform border around an image, set the same value for the top, bottom, left, and right parameters.
  • Use the color parameter to match the extended canvas with the background or theme of your project.
  • If you want to exclude certain areas from being extended, provide a mask and use the invert_mask option to fine-tune the effect.

LayerUtility: ExtendCanvas Common Errors and Solutions:

"Invalid image input"

  • Explanation: The provided image input is not valid or not recognized by the node.
  • Solution: Ensure that the input is a valid image file and is correctly connected to the node.

"Invalid mask input"

  • Explanation: The provided mask input is not valid or not recognized by the node.
  • Solution: Ensure that the mask is a valid image file and is correctly connected to the node.

"Parameter value out of range"

  • Explanation: One of the integer parameters (top, bottom, left, right) is set to a value outside the allowed range.
  • Solution: Adjust the parameter values to be within the specified range (0 to 99999).

"Invalid color format"

  • Explanation: The color parameter is not in the correct hexadecimal format.
  • Solution: Ensure that the color value is a valid hexadecimal color code, such as "#FFFFFF" for white.

LayerUtility: ExtendCanvas Related Nodes

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