ComfyUI  >  Nodes  >  Allor Plugin >  ImageTransformPaddingRelative

ComfyUI Node: ImageTransformPaddingRelative

Class Name

ImageTransformPaddingRelative

Category
image/transform
Author
Nourepide (Account age: 2900 days)
Extension
Allor Plugin
Latest Updated
5/22/2024
Github Stars
0.2K

How to Install Allor Plugin

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

ImageTransformPaddingRelative Description

Add padding to images based on relative scale for uniform canvas expansion while maintaining aspect ratio, supporting various padding methods.

ImageTransformPaddingRelative:

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.

ImageTransformPaddingRelative Input Parameters:

images

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.

scale_width

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.

scale_height

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.

method

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.

ImageTransformPaddingRelative Output Parameters:

IMAGE

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.

ImageTransformPaddingRelative Usage Tips:

  • To maintain the aspect ratio while adding padding, ensure that scale_width and scale_height are set to the same value.
  • Use the reflect method for a seamless extension of the image, which can be particularly useful for creating mirror effects.
  • The edge method is ideal for extending the background of an image without introducing new colors or patterns.
  • If you need a solid border around your image, use the constant method and specify the desired padding color in the ImageTransformPaddingAbsolute node.

ImageTransformPaddingRelative Common Errors and Solutions:

"Invalid image format"

  • Explanation: The input images are not in the expected tensor format.
  • Solution: Ensure that the images are correctly formatted as tensors before passing them to the node.

"Scale values must be non-negative"

  • Explanation: The scale_width or scale_height parameters have been set to negative values.
  • Solution: Adjust the scale_width and scale_height parameters to be zero or positive values.

"Unsupported padding method"

  • Explanation: The method parameter has been set to a value that is not supported.
  • Solution: Choose one of the supported methods: reflect, edge, or constant.

ImageTransformPaddingRelative Related Nodes

Go back to the extension to check out more related nodes.
Allor Plugin
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.