Visit ComfyUI Online for ready-to-use ComfyUI environment
Draw rectangles on images with ease, adding geometric shapes for visual appeal or complex designs.
The ImageDrawRectangle
node is designed to help you draw rectangles on images with ease. This node is particularly useful for adding geometric shapes to your artwork, which can enhance the visual appeal or serve as a foundation for more complex designs. By using this node, you can specify the position, size, and colors of the rectangle, as well as the thickness of its outline. This flexibility allows you to create a wide range of effects, from simple borders to filled shapes with custom colors. The node is part of the image/draw
category, making it a valuable tool for any AI artist looking to incorporate precise geometric elements into their creations.
This parameter represents the image on which the rectangle will be drawn. It is typically a tensor that contains the image data. The container defines the canvas size and resolution for the drawing operation.
This parameter specifies the x-coordinate of the starting point (top-left corner) of the rectangle. It determines the horizontal position of the rectangle on the image. The value should be a float between 0 and 1, where 0 represents the left edge and 1 represents the right edge of the image.
This parameter specifies the y-coordinate of the starting point (top-left corner) of the rectangle. It determines the vertical position of the rectangle on the image. The value should be a float between 0 and 1, where 0 represents the top edge and 1 represents the bottom edge of the image.
This parameter specifies the x-coordinate of the ending point (bottom-right corner) of the rectangle. It determines the horizontal extent of the rectangle on the image. The value should be a float between 0 and 1, where 0 represents the left edge and 1 represents the right edge of the image.
This parameter specifies the y-coordinate of the ending point (bottom-right corner) of the rectangle. It determines the vertical extent of the rectangle on the image. The value should be a float between 0 and 1, where 0 represents the top edge and 1 represents the bottom edge of the image.
This parameter defines the thickness of the rectangle's outline. It is an integer value that specifies the number of pixels for the outline width. A value of 0 means no outline.
This parameter specifies the red component of the outline color. It is an integer value between 0 and 255, where 0 represents no red and 255 represents full red.
This parameter specifies the green component of the outline color. It is an integer value between 0 and 255, where 0 represents no green and 255 represents full green.
This parameter specifies the blue component of the outline color. It is an integer value between 0 and 255, where 0 represents no blue and 255 represents full blue.
This parameter specifies the alpha (transparency) component of the outline color. It is a float value between 0 and 1, where 0 represents full transparency and 1 represents full opacity.
This parameter specifies the red component of the fill color. It is an integer value between 0 and 255, where 0 represents no red and 255 represents full red.
This parameter specifies the green component of the fill color. It is an integer value between 0 and 255, where 0 represents no green and 255 represents full green.
This parameter specifies the blue component of the fill color. It is an integer value between 0 and 255, where 0 represents no blue and 255 represents full blue.
This parameter specifies the alpha (transparency) component of the fill color. It is a float value between 0 and 1, where 0 represents full transparency and 1 represents full opacity.
This parameter stands for Supersample Anti-Aliasing. It is an integer value that specifies the level of anti-aliasing to be applied. Higher values result in smoother edges but require more computational resources.
This parameter specifies the resampling method to be used when resizing the image after drawing the rectangle. It is a string value that can be one of several predefined methods, such as "nearest", "bilinear", or "bicubic".
The output of this node is an image tensor with the drawn rectangle. This tensor can be used as input for subsequent nodes in your workflow. The output image retains the same dimensions as the input container but includes the newly drawn rectangle.
start_x
and start_y
to 0, and end_x
and end_y
to 1, then adjust the outline_size
to your desired thickness.fill_alpha
parameter to create semi-transparent rectangles, which can be useful for overlay effects.SSAA
values to find the right balance between edge smoothness and performance.start_x
, start_y
, end_x
, and end_y
are within the range of 0 to 1.© Copyright 2024 RunComfy. All Rights Reserved.