Visit ComfyUI Online for ready-to-use ComfyUI environment
Add padding to images based on relative scale for uniform canvas expansion while maintaining aspect ratio, supporting various padding methods.
The ImageTransformPaddingRelative
node is designed to add padding to images based on a relative scale of their dimensions. This node is particularly useful when you need to uniformly expand the canvas size of an image while maintaining the aspect ratio. By specifying the padding as a fraction of the image's width and height, you can ensure that the padding scales appropriately with different image sizes. This node supports various padding methods, including reflecting the image edges, extending the edge pixels, or using a constant value, providing flexibility in how the padding is applied.
This parameter expects a list of images to which the padding will be applied. The images should be in a format that the node can process, typically a tensor format.
This parameter defines the fraction of the image's width to be added as padding on each side. For example, a value of 0.25 means that 25% of the image's width will be added as padding. The default value is 0.25, and the step size for adjustments is 0.1.
This parameter specifies the fraction of the image's height to be added as padding on each side. Similar to scale_width
, a value of 0.25 means that 25% of the image's height will be added as padding. The default value is 0.25, and the step size for adjustments is 0.1.
This parameter determines the method used to fill the padding area. The available options are:
reflect
: The padding area is filled by reflecting the image edges.edge
: The padding area is filled by extending the edge pixels of the image.constant
: The padding area is filled with a constant value.The output is a list of images with the specified padding applied. The padded images will have increased dimensions based on the scale_width
and scale_height
parameters, and the padding will be filled according to the selected method
.
scale_width
and scale_height
are set to the same value.reflect
method for a seamless extension of the image, which can be particularly useful for creating mirror effects.edge
method is ideal for extending the background of an image without introducing new colors or patterns.constant
method and specify the desired padding color in the ImageTransformPaddingAbsolute
node.scale_width
or scale_height
parameters have been set to negative values.scale_width
and scale_height
parameters to be zero or positive values.method
parameter has been set to a value that is not supported.reflect
, edge
, or constant
.© Copyright 2024 RunComfy. All Rights Reserved.