Visit ComfyUI Online for ready-to-use ComfyUI environment
Custom ComfyUI node for adding letterboxing or pillarboxing to images, optimizing aspect ratio without cropping.
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.
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.
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.
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.
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.
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.
bar_size
to add horizontal bars that mimic the aspect ratio of widescreen films.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.bar_size
parameter is set outside the allowed range of 0 to 500.bar_size
parameter to a value within the specified range to ensure proper execution of the node.box_mode
parameter.box_mode
parameter is set to either "letterbox" or "pillarbox" to match the available options.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.