ComfyUI > Nodes > DJZ-Nodes > Black Bars V1

ComfyUI Node: Black Bars V1

Class Name

BlackBarsV1

Category
image/format
Author
DriftJohnson (Account age: 4052days)
Extension
DJZ-Nodes
Latest Updated
2025-04-25
Github Stars
0.04K

How to Install DJZ-Nodes

Install this extension via the ComfyUI Manager by searching for DJZ-Nodes
  • 1. Click the Manager button in the main menu
  • 2. Select Custom Nodes Manager button
  • 3. Enter DJZ-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
  • 16GB VRAM to 80GB VRAM GPU machines
  • 400+ preloaded models/nodes
  • Freedom to upload custom models/nodes
  • 200+ ready-to-run workflows
  • 100% private workspace with up to 200GB storage
  • Dedicated Support

Run ComfyUI Online

Black Bars V1 Description

Custom ComfyUI node for adding letterboxing or pillarboxing to images, optimizing aspect ratio without cropping.

Black Bars V1:

The BlackBarsV1 node is a custom component designed for the ComfyUI framework, which allows you to apply letterboxing or pillarboxing to a sequence of images. This process involves adding black bars either horizontally (letterbox) or vertically (pillarbox) to adjust the aspect ratio of images without cropping or distorting the original content. This is particularly useful for preparing images for display on screens with different aspect ratios, ensuring that the entire image is visible without any loss of detail. The node is optimized to run on either a CUDA-enabled GPU or a CPU, depending on the available hardware, which enhances its performance and efficiency. By using this node, you can maintain the visual integrity of your images while adapting them to various display formats.

Black Bars V1 Input Parameters:

images

This parameter represents the sequence of images to which the black bars will be applied. The images are processed as a tensor, allowing for efficient manipulation and transformation within the node.

box_mode

The box_mode parameter determines the orientation of the black bars applied to the images. It offers two options: "letterbox" for horizontal bars and "pillarbox" for vertical bars. This choice affects how the aspect ratio of the images is adjusted, ensuring compatibility with different display formats.

bar_size

The bar_size parameter specifies the thickness of the black bars added to the images. It is an integer value with a default of 100, a minimum of 0, and a maximum of 500. This parameter allows you to control the prominence of the bars, with larger values resulting in thicker bars.

bar_feather

The bar_feather parameter controls the softness of the edges of the black bars. It is an integer value with a default of 0, a minimum of 0, and a maximum of 50. By adjusting this parameter, you can create a more gradual transition between the bars and the image, enhancing the visual appeal.

Black Bars V1 Output Parameters:

IMAGE

The output of the BlackBarsV1 node is a sequence of images with the specified black bars applied. This output maintains the original content of the images while adjusting their aspect ratio to fit different display formats. The resulting images are ready for use in various applications, ensuring compatibility and visual consistency.

Black Bars V1 Usage Tips:

  • To achieve a cinematic look, use the "letterbox" mode with a moderate bar_size to add horizontal bars that mimic the aspect ratio of widescreen films.
  • For social media posts, consider using the "pillarbox" mode to adapt landscape images to portrait-oriented platforms without cropping important content.
  • Adjust the bar_feather parameter to create a smooth transition between the image and the black bars, which can enhance the overall aesthetic of the final output.

Black Bars V1 Common Errors and Solutions:

"CUDA device not available"

  • Explanation: This error occurs when the node attempts to use a CUDA-enabled GPU, but none is available on the system.
  • Solution: Ensure that your system has a compatible GPU and that the necessary CUDA drivers are installed. Alternatively, configure the node to run on the CPU if a GPU is not available.

"Invalid bar_size value"

  • Explanation: This error arises when the bar_size parameter is set outside the allowed range of 0 to 500.
  • Solution: Adjust the bar_size parameter to a value within the specified range to ensure proper execution of the node.

"Invalid box_mode option"

  • Explanation: This error occurs when an unsupported value is provided for the box_mode parameter.
  • Solution: Ensure that the box_mode parameter is set to either "letterbox" or "pillarbox" to match the available options.

Black Bars V1 Related Nodes

Go back to the extension to check out more related nodes.
DJZ-Nodes
RunComfy
Copyright 2025 RunComfy. All Rights Reserved.

RunComfy is the premier ComfyUI platform, offering ComfyUI online environment and services, along with ComfyUI workflows featuring stunning visuals. RunComfy also provides AI Playground, enabling artists to harness the latest AI tools to create incredible art.