ComfyUI > Nodes > ComfyUI-Addoor > 🌻 Draw Simple Rectangle

ComfyUI Node: 🌻 Draw Simple Rectangle

Class Name

AD_ImageDrawRectangleSimple

Category
🌻 Addoor/Utilities
Author
ADDOOR (Account age: 2884days)
Extension
ComfyUI-Addoor
Latest Updated
2025-01-24
Github Stars
0.03K

How to Install ComfyUI-Addoor

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

🌻 Draw Simple Rectangle Description

Facilitates creation of customizable rectangles on image canvas for AI artists, with options for dimensions, position, appearance, and anti-aliasing.

🌻 Draw Simple Rectangle:

The AD_ImageDrawRectangleSimple node is designed to facilitate the creation of simple, customizable rectangles on an image canvas. This node is particularly useful for AI artists who want to add geometric shapes to their digital artwork with ease. It allows you to define the dimensions and position of the rectangle, as well as customize its appearance with rounded corners and color fills. The node supports anti-aliasing through Super-Sampling Anti-Aliasing (SSAA) to ensure smooth edges, and it provides flexibility in choosing the resampling method for resizing operations. By leveraging this node, you can efficiently incorporate rectangles into your compositions, enhancing the visual structure and design of your images.

🌻 Draw Simple Rectangle Input Parameters:

width

The width parameter specifies the width of the canvas on which the rectangle will be drawn. It determines the horizontal size of the image and indirectly affects the rectangle's position and size. The default value is 512, with a minimum of 1, ensuring that the canvas is always visible.

height

The height parameter defines the height of the canvas. Similar to the width, it sets the vertical size of the image, influencing the rectangle's placement and dimensions. The default value is 512, with a minimum of 1.

left

The left parameter indicates the inward offset from the left edge of the canvas to the rectangle's left side. It allows you to position the rectangle horizontally within the canvas. The default value is 50, with a minimum of 0.

top

The top parameter specifies the inward offset from the top edge of the canvas to the rectangle's top side. This parameter helps in vertically positioning the rectangle. The default value is 50, with a minimum of 0.

The right parameter represents the inward offset from the right edge of the canvas to the rectangle's right side. It is used to adjust the rectangle's horizontal size and position. The default value is 50, with a minimum of 0.

bottom

The bottom parameter defines the inward offset from the bottom edge of the canvas to the rectangle's bottom side. It helps in controlling the rectangle's vertical size and position. The default value is 50, with a minimum of 0.

radius

The radius parameter determines the curvature of the rectangle's corners, allowing you to create rounded rectangles. A higher value results in more rounded corners. The default value is 20, with a minimum of 0.

fill_red

The fill_red parameter sets the red component of the rectangle's fill color. It ranges from 0 to 255, with a default value of 255, allowing you to adjust the intensity of the red color in the rectangle.

fill_green

The fill_green parameter controls the green component of the rectangle's fill color. It also ranges from 0 to 255, with a default value of 255, enabling you to modify the green intensity in the rectangle.

fill_blue

The fill_blue parameter specifies the blue component of the rectangle's fill color. Like the other color parameters, it ranges from 0 to 255, with a default value of 255, allowing you to adjust the blue intensity.

fill_alpha

The fill_alpha parameter determines the transparency level of the rectangle's fill color. It ranges from 0 (completely transparent) to 1 (completely opaque), providing control over the rectangle's visibility.

SSAA

The SSAA parameter stands for Super-Sampling Anti-Aliasing, which is used to smooth the edges of the rectangle. It is a multiplier that enhances the quality of the rendered rectangle by reducing jagged edges.

method

The method parameter specifies the resampling method used when resizing the canvas back to its original dimensions after applying SSAA. It affects the final quality of the image and can be chosen based on the desired output.

🌻 Draw Simple Rectangle Output Parameters:

tensor

The tensor output is a representation of the image with the drawn rectangle, converted into a format suitable for further processing or analysis. It includes the color and transparency information of the rectangle.

mask_tensor

The mask_tensor output provides a mask of the rectangle, indicating the areas covered by the rectangle in the image. This mask can be used for various purposes, such as blending or compositing with other images.

🌻 Draw Simple Rectangle Usage Tips:

  • To achieve smoother edges on your rectangles, increase the SSAA value, which will apply more anti-aliasing and result in a higher-quality image.
  • Experiment with different method values to find the resampling technique that best suits your artistic style and the specific requirements of your project.

🌻 Draw Simple Rectangle Common Errors and Solutions:

"Invalid canvas dimensions"

  • Explanation: This error occurs when the width or height parameters are set to values less than the minimum allowed.
  • Solution: Ensure that both width and height are set to values greater than or equal to 1.

"Color value out of range"

  • Explanation: This error is triggered when any of the color parameters (fill_red, fill_green, fill_blue) are set outside the range of 0 to 255. - Solution: Adjust the color parameters to be within the valid range of 0 to 255.

"Alpha value out of range"

  • Explanation: This error occurs if the fill_alpha parameter is set outside the range of 0 to 1.
  • Solution: Set the fill_alpha parameter to a value between 0 and 1 to ensure proper transparency settings.

🌻 Draw Simple Rectangle Related Nodes

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