ComfyUI > Nodes > Allor Plugin > ImageDrawRectangleByContainer

ComfyUI Node: ImageDrawRectangleByContainer

Class Name

ImageDrawRectangleByContainer

Category
image/draw
Author
Nourepide (Account age: 2900days)
Extension
Allor Plugin
Latest Updated
2024-05-22
Github Stars
0.2K

How to Install Allor Plugin

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

ImageDrawRectangleByContainer Description

Facilitates drawing customizable rectangles within containers for AI artists to enhance image compositions.

ImageDrawRectangleByContainer:

The ImageDrawRectangleByContainer node is designed to facilitate the drawing of rectangles within a specified container, making it an essential tool for AI artists looking to add geometric shapes to their images. This node allows you to define the position, size, and appearance of the rectangle, including its outline and fill colors, as well as the transparency levels. By leveraging this node, you can create precise and customizable rectangular shapes, enhancing the visual composition of your artwork. The node's functionality is particularly useful for tasks that require the addition of structured elements to an image, such as framing, highlighting specific areas, or creating complex designs.

ImageDrawRectangleByContainer Input Parameters:

container

The container parameter specifies the image or canvas where the rectangle will be drawn. It is essential as it defines the context in which the rectangle will appear. The container should be a valid image object that the node can manipulate.

start_x

The start_x parameter defines the x-coordinate of the rectangle's starting point (top-left corner). This value determines the horizontal position of the rectangle within the container. The minimum value is 0, and the maximum value is the width of the container.

start_y

The start_y parameter defines the y-coordinate of the rectangle's starting point (top-left corner). This value determines the vertical position of the rectangle within the container. The minimum value is 0, and the maximum value is the height of the container.

end_x

The end_x parameter defines the x-coordinate of the rectangle's ending point (bottom-right corner). This value determines the horizontal extent of the rectangle. The minimum value is start_x, and the maximum value is the width of the container.

end_y

The end_y parameter defines the y-coordinate of the rectangle's ending point (bottom-right corner). This value determines the vertical extent of the rectangle. The minimum value is start_y, and the maximum value is the height of the container.

radius

The radius parameter specifies the radius of the corners if you want to create a rounded rectangle. A value of 0 means the corners will be sharp, while higher values will make the corners more rounded. The minimum value is 0.

outline_size

The outline_size parameter determines the thickness of the rectangle's outline. A value of 0 means no outline, while higher values increase the outline's thickness. The minimum value is 0.

outline_red

The outline_red parameter sets the red component of the outline color. The value ranges from 0 to 255, where 0 means no red and 255 means full red.

outline_green

The outline_green parameter sets the green component of the outline color. The value ranges from 0 to 255, where 0 means no green and 255 means full green.

outline_blue

The outline_blue parameter sets the blue component of the outline color. The value ranges from 0 to 255, where 0 means no blue and 255 means full blue.

outline_alpha

The outline_alpha parameter sets the transparency level of the outline. The value ranges from 0 to 255, where 0 means fully transparent and 255 means fully opaque.

fill_red

The fill_red parameter sets the red component of the fill color. The value ranges from 0 to 255, where 0 means no red and 255 means full red.

fill_green

The fill_green parameter sets the green component of the fill color. The value ranges from 0 to 255, where 0 means no green and 255 means full green.

fill_blue

The fill_blue parameter sets the blue component of the fill color. The value ranges from 0 to 255, where 0 means no blue and 255 means full blue.

fill_alpha

The fill_alpha parameter sets the transparency level of the fill. The value ranges from 0 to 255, where 0 means fully transparent and 255 means fully opaque.

top_left_corner

The top_left_corner parameter determines whether the top-left corner of the rectangle is rounded. A value of True means the corner is rounded, while False means it is sharp.

top_right_corner

The top_right_corner parameter determines whether the top-right corner of the rectangle is rounded. A value of True means the corner is rounded, while False means it is sharp.

bottom_right_corner

The bottom_right_corner parameter determines whether the bottom-right corner of the rectangle is rounded. A value of True means the corner is rounded, while False means it is sharp.

bottom_left_corner

The bottom_left_corner parameter determines whether the bottom-left corner of the rectangle is rounded. A value of True means the corner is rounded, while False means it is sharp.

SSAA

The SSAA parameter stands for Supersample Anti-Aliasing, which helps in smoothing the edges of the rectangle. A value of True enables SSAA, while False disables it.

method

The method parameter specifies the drawing method to be used. This can affect the performance and quality of the drawing process. The exact options for this parameter depend on the implementation details of the node.

ImageDrawRectangleByContainer Output Parameters:

IMAGE

The IMAGE output parameter is the resulting image with the drawn rectangle. This output is crucial as it provides the final visual result of the node's operation, which can be used for further processing or as a final artwork.

ImageDrawRectangleByContainer Usage Tips:

  • To create a rectangle with sharp corners, set the radius parameter to 0.
  • Use the outline_size parameter to add a border to your rectangle, which can help in highlighting or framing specific areas.
  • Adjust the fill_alpha parameter to create semi-transparent rectangles, which can be useful for overlay effects.
  • Enable the SSAA parameter to smooth the edges of the rectangle, especially when working with high-resolution images.

ImageDrawRectangleByContainer Common Errors and Solutions:

"Invalid container format"

  • Explanation: The container provided is not a valid image object.
  • Solution: Ensure that the container parameter is a valid image object that the node can manipulate.

"Coordinates out of bounds"

  • Explanation: The specified coordinates for the rectangle are outside the dimensions of the container.
  • Solution: Check that the start_x, start_y, end_x, and end_y parameters are within the bounds of the container's dimensions.

"Invalid color value"

  • Explanation: One of the color parameters (red, green, blue, alpha) is outside the valid range of 0 to 255. - Solution: Ensure that all color parameters are within the range of 0 to 255.

"Invalid SSAA value"

  • Explanation: The SSAA parameter is not a boolean value.
  • Solution: Set the SSAA parameter to either True or False.

"Invalid method"

  • Explanation: The method parameter is not recognized.
  • Solution: Verify that the method parameter is set to a valid option as per the node's implementation details.

ImageDrawRectangleByContainer Related Nodes

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