Visit ComfyUI Online for ready-to-use ComfyUI environment
Extend image canvas with borders, padding, and color fill; control extension areas with mask and inversion option.
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.
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.
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.
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.
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.
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.
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).
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.
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.
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.
© Copyright 2024 RunComfy. All Rights Reserved.