ComfyUI-KJNodes
Run ComfyUI Easily with InstaSD
Skip the complex setup. InstaSD helps creative professionals build workflows and deploy them to the world:
- One-click deployment
- Any model, any node
- Powerful GPUs for rapid iteration
Available Nodes
ImagePadKJ
ComfyUI Node Documentation: ImagePadKJ
Overview
The ImagePadKJ node is a utility node designed for image processing within the ComfyUI framework. This node allows users to pad an image and optionally a mask with specified padding values, colors, and methods. It is particularly useful for adjusting images in preparation for further image processing tasks, such as ensuring consistent image dimensions or applying special visual effects with padding.
Functionality
The primary purpose of the ImagePadKJ node is to extend the borders of an image by adding padding in specified directions. It can fill the padded areas with a specified color or by repeating the edge pixels of the original image.
Inputs
The ImagePadKJ node accepts the following inputs:
-
Image: The primary image to be padded. This input is required.
-
Padding Dimensions:
- Left: The amount of padding to add to the left side of the image.
- Right: The amount of padding to add to the right side of the image.
- Top: The amount of padding to add to the top side of the image.
- Bottom: The amount of padding to add to the bottom side of the image.
-
Extra Padding: Additional padding to add uniformly on all sides.
-
Pad Mode: Determines the method used to fill the padded area. Options include:
- Edge: Uses the edge color of the image to fill the padding.
- Color: Uses a specified RGB color to fill the padding.
-
Color (required with
Colorpad mode): The RGB color values used to fill the padding (when the pad mode is set to "color"). This is represented as a string of comma-separated values. -
Mask (optional): A mask to be padded alongside the image. This is an optional input, allowing for specific areas of the image to be highlighted or processed differently if desired.
Outputs
The ImagePadKJ node produces the following outputs:
- Images: The padded image or batch of images.
- Masks: The padded mask or batch of masks, if provided; otherwise, this output defaults to fully opaque masks indicating the original image areas.
Usage in ComfyUI Workflows
The ImagePadKJ node can be integrated into ComfyUI workflows in the following ways:
-
Dimension Adjustment: Ensure that input images meet size requirements for specific image processing nodes or models by uniformly padding the image.
-
Visual Effects: Create aesthetic effects by adding colored borders around images. This can be used for design-oriented workflows within ComfyUI.
-
Mask Handling: When working with masks, the node can pad the masks in parallel, thus maintaining alignment with the adjusted image for subsequent processing tasks.
Special Features and Considerations
-
Flexible Padding Options: The node provides flexibility in padding by allowing users to specify directional padding as well as uniform padding through the "extra padding" feature.
-
Edge-Repeating Option: The edge padding mode is particularly useful for maintaining seamless image transitions without introducing harsh color discrepancies or unnatural borders.
-
Color Specification: When using the color padding mode, it's important to provide color values in the proper format.
-
Batch Processing: The node supports batch processing, allowing multiple images and masks to be padded simultaneously, making it efficient for larger image datasets.
By including the ImagePadKJ node in a ComfyUI workflow, users can ensure their images are consistent in size and appearance and primed for further manipulation or analysis.