ComfyUI > Nodes > Allor Plugin > ImageDrawRectangleRoundedByContainer

ComfyUI Node: ImageDrawRectangleRoundedByContainer

Class Name

ImageDrawRectangleRoundedByContainer

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

ImageDrawRectangleRoundedByContainer Description

Draw smooth rounded rectangles within containers for visually appealing graphics with customizable features and advanced configurations.

ImageDrawRectangleRoundedByContainer:

The ImageDrawRectangleRoundedByContainer node is designed to draw a rounded rectangle within a specified container. This node is particularly useful for creating visually appealing graphics with smooth, rounded corners, which can enhance the aesthetic quality of your images. By leveraging this node, you can easily define the position, size, and curvature of the rectangle, as well as customize its outline and fill colors. The node also allows for advanced configurations such as anti-aliasing and corner-specific rounding, providing you with a high degree of control over the final output. This makes it an excellent tool for AI artists looking to add sophisticated shapes to their digital artwork.

ImageDrawRectangleRoundedByContainer Input Parameters:

container

The container parameter specifies the image or canvas within which the rounded rectangle will be drawn. It is essential as it defines the boundaries and context for the drawing operation. The container should be a multi-dimensional array representing the image data.

start_x

This parameter sets the x-coordinate for the starting point of the rectangle. It determines the horizontal position of the top-left corner of the rectangle. The value should be within the width of the container.

start_y

This parameter sets the y-coordinate for the starting point of the rectangle. It determines the vertical position of the top-left corner of the rectangle. The value should be within the height of the container.

end_x

This parameter sets the x-coordinate for the ending point of the rectangle. It determines the horizontal position of the bottom-right corner of the rectangle. The value should be within the width of the container.

end_y

This parameter sets the y-coordinate for the ending point of the rectangle. It determines the vertical position of the bottom-right corner of the rectangle. The value should be within the height of the container.

radius

The radius parameter defines the curvature of the rectangle's corners. A larger radius results in more rounded corners, while a smaller radius results in sharper corners. The value should be a positive number.

outline_size

This parameter specifies the thickness of the rectangle's outline. A larger value results in a thicker outline, while a smaller value results in a thinner outline. The value should be a positive number.

outline_red

This parameter sets the red component of the outline color. The value should be between 0 and 255.

outline_green

This parameter sets the green component of the outline color. The value should be between 0 and 255.

outline_blue

This parameter sets the blue component of the outline color. The value should be between 0 and 255.

outline_alpha

This parameter sets the alpha (transparency) component of the outline color. The value should be between 0 and 255, where 0 is fully transparent and 255 is fully opaque.

fill_red

This parameter sets the red component of the fill color. The value should be between 0 and 255.

fill_green

This parameter sets the green component of the fill color. The value should be between 0 and 255.

fill_blue

This parameter sets the blue component of the fill color. The value should be between 0 and 255.

fill_alpha

This parameter sets the alpha (transparency) component of the fill color. The value should be between 0 and 255, where 0 is fully transparent and 255 is fully opaque.

top_left_corner

This boolean parameter determines whether the top-left corner of the rectangle should be rounded. Set to True to round the corner, or False to keep it sharp.

top_right_corner

This boolean parameter determines whether the top-right corner of the rectangle should be rounded. Set to True to round the corner, or False to keep it sharp.

bottom_right_corner

This boolean parameter determines whether the bottom-right corner of the rectangle should be rounded. Set to True to round the corner, or False to keep it sharp.

bottom_left_corner

This boolean parameter determines whether the bottom-left corner of the rectangle should be rounded. Set to True to round the corner, or False to keep it sharp.

SSAA

This parameter enables or disables Super-Sample Anti-Aliasing (SSAA) for the rectangle. SSAA can improve the visual quality of the rectangle by reducing aliasing effects. Set to True to enable SSAA, or False to disable it.

method

This parameter specifies the drawing method to be used. Different methods may offer various optimizations or visual effects. The exact options available for this parameter depend on the implementation details.

ImageDrawRectangleRoundedByContainer Output Parameters:

IMAGE

The output is an image with the newly drawn rounded rectangle. This image retains the original content of the container but includes the added rectangle, allowing you to seamlessly integrate the shape into your existing artwork.

ImageDrawRectangleRoundedByContainer Usage Tips:

  • To achieve the best visual quality, enable the SSAA parameter, especially when working with high-resolution images.
  • Experiment with different radius values to find the perfect curvature for your design.
  • Use the corner-specific parameters to create unique shapes by rounding only selected corners.
  • Adjust the outline and fill colors to match the overall color scheme of your artwork for a cohesive look.

ImageDrawRectangleRoundedByContainer Common Errors and Solutions:

"IndexError: index out of bounds"

  • Explanation: This error occurs when the specified coordinates (start_x, start_y, end_x, end_y) are outside the dimensions of the container.
  • Solution: Ensure that all coordinate values are within the width and height of the container.

"ValueError: invalid color value"

  • Explanation: This error occurs when the color component values (red, green, blue, alpha) are outside the range of 0 to 255. - Solution: Verify that all color component values are within the valid range.

"TypeError: expected boolean value"

  • Explanation: This error occurs when the corner-specific parameters (top_left_corner, top_right_corner, bottom_right_corner, bottom_left_corner) are not set to boolean values.
  • Solution: Ensure that these parameters are set to either True or False.

"AttributeError: 'NoneType' object has no attribute 'shape'"

  • Explanation: This error occurs when the container is not properly initialized or is None.
  • Solution: Make sure the container is a valid image array before passing it to the node.

ImageDrawRectangleRoundedByContainer 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.