ComfyUI > Nodes > Bmad Nodes > CopyMakeBorder

ComfyUI Node: CopyMakeBorder

Class Name

CopyMakeBorder

Category
Bmad/CV/Misc
Author
bmad4ever (Account age: 3591days)
Extension
Bmad Nodes
Latest Updated
2024-08-02
Github Stars
0.05K

How to Install Bmad Nodes

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

CopyMakeBorder Description

Add customizable borders to images using OpenCV's `copyMakeBorder` function for artistic and practical purposes.

CopyMakeBorder:

The CopyMakeBorder node is designed to add a border around an image, which can be useful for various artistic and practical purposes such as framing, padding, or creating a specific visual effect. This node leverages OpenCV's copyMakeBorder function to extend the edges of an image by a specified number of pixels, using different border types to determine how the new pixels are filled. By using this node, you can easily enhance your images with consistent and customizable borders, making it a valuable tool for AI artists looking to refine their visual outputs.

CopyMakeBorder Input Parameters:

image

This parameter represents the input image to which the border will be added. The image should be in a compatible format that the node can process, typically a tensor representation of the image.

border_size

This parameter specifies the size of the border to be added around the image. It is an integer value that determines the number of pixels to add to each side of the image. The default value is 64, but you can adjust it according to your needs. Increasing the border size will result in a thicker border, while decreasing it will create a thinner border.

border_type

This parameter defines the type of border to be applied. It offers several options, such as BORDER_CONSTANT, BORDER_REPLICATE, BORDER_REFLECT, BORDER_REFLECT101, and BORDER_WRAP. Each type determines how the new border pixels are filled. For example, BORDER_CONSTANT fills the border with a constant value, while BORDER_REFLECT mirrors the edge pixels. The default border type is BORDER_CONSTANT.

CopyMakeBorder Output Parameters:

image

The output parameter is the image with the added border. This image retains the original content but now includes the specified border around it. The output format is the same as the input format, ensuring compatibility with subsequent processing steps.

CopyMakeBorder Usage Tips:

  • Experiment with different border_type options to achieve various visual effects. For instance, BORDER_REFLECT can create a mirror-like border, while BORDER_CONSTANT allows you to specify a solid color.
  • Adjust the border_size parameter to control the thickness of the border. Larger values will create more prominent borders, which can be useful for framing or highlighting specific parts of the image.
  • Use this node in combination with other image processing nodes to create complex compositions and enhance your artwork.

CopyMakeBorder Common Errors and Solutions:

Invalid border type

  • Explanation: This error occurs when an unsupported border type is specified.
  • Solution: Ensure that the border_type parameter is set to one of the supported values: BORDER_CONSTANT, BORDER_REPLICATE, BORDER_REFLECT, BORDER_REFLECT101, or BORDER_WRAP.

Image format not supported

  • Explanation: This error happens when the input image is not in a compatible format.
  • Solution: Verify that the input image is in a tensor format that the node can process. Convert the image to the appropriate format if necessary.

Border size too large

  • Explanation: This error occurs when the specified border_size is excessively large, potentially causing memory issues.
  • Solution: Reduce the border_size parameter to a more reasonable value to avoid memory overflow and ensure smooth processing.

CopyMakeBorder Related Nodes

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