ComfyUI Node: IMG_unpadder

Class Name

IMG_unpadder

Category
Eden 🌱/Image
Author
aiXander (Account age: 302days)
Extension
Various custom nodes by Eden.art
Latest Updated
2024-07-23
Github Stars
0.04K

How to Install Various custom nodes by Eden.art

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

IMG_unpadder Description

Remove image padding to adjust dimensions precisely and revert to original size after processing.

IMG_unpadder:

The IMG_unpadder node is designed to remove padding from images, allowing you to adjust the dimensions of an image by trimming off specified portions. This node is particularly useful when you need to revert an image to its original size after padding has been added for processing purposes. By specifying the fraction of the image to be unpadded and the location from which to remove the padding, you can precisely control the final dimensions of your image. This functionality is essential for tasks that require exact image dimensions or when preparing images for further processing steps that demand specific size constraints.

IMG_unpadder Input Parameters:

image

This parameter represents the input image that you want to unpad. The image should be in a format that the node can process, typically a multi-dimensional array representing the batch size, height, width, and channels of the image.

unpad_fraction

This parameter specifies the fraction of the image to be unpadded. It is a floating-point value ranging from 0.0 to 1.0, where 0.0 means no unpadding and 1.0 means complete removal of the specified section. The default value is 0.0. Adjusting this value allows you to control how much of the image's padding is removed.

unpad_location

This parameter determines the location from which the padding will be removed. The options are "bottom", "top", "left", and "right". By selecting one of these options, you can specify the edge of the image from which the unpadding will occur. This allows for flexible and targeted unpadding based on your specific needs.

IMG_unpadder Output Parameters:

IMAGE

The output is the unpadded image. This image will have the specified fraction of padding removed from the designated location, and its dimensions will be adjusted accordingly. The node ensures that the resulting image's width and height are divisible by 4, maintaining compatibility with various image processing requirements.

IMG_unpadder Usage Tips:

  • To remove padding from the bottom of an image, set the unpad_location to "bottom" and adjust the unpad_fraction to the desired value.
  • Ensure that the unpad_fraction is set appropriately to avoid removing too much or too little padding, which could affect the image's usability in subsequent processing steps.
  • Use this node in conjunction with padding nodes to manage image dimensions effectively throughout your workflow.

IMG_unpadder Common Errors and Solutions:

"Invalid unpad_fraction value"

  • Explanation: The unpad_fraction value is outside the acceptable range of 0.0 to 1.0.
  • Solution: Ensure that the unpad_fraction is set to a value between 0.0 and 1.0.

"Unsupported unpad_location"

  • Explanation: The unpad_location parameter is set to a value that is not recognized.
  • Solution: Verify that the unpad_location is set to one of the following: "bottom", "top", "left", or "right".

"Image dimensions not divisible by 4"

  • Explanation: The resulting image dimensions are not divisible by 4 after unpadding.
  • Solution: Adjust the unpad_fraction to ensure that the final image dimensions are divisible by 4, or use additional processing steps to correct the dimensions.

IMG_unpadder Related Nodes

Go back to the extension to check out more related nodes.
Various custom nodes by Eden.art
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.