ComfyUI  >  Nodes  >  Allor Plugin >  ImageDrawRectangleRounded

ComfyUI Node: ImageDrawRectangleRounded

Class Name

ImageDrawRectangleRounded

Category
image/draw
Author
Nourepide (Account age: 2900 days)
Extension
Allor Plugin
Latest Updated
5/22/2024
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

ImageDrawRectangleRounded Description

Draw smooth rounded rectangles on image canvas with customizable dimensions, colors, and anti-aliasing for visual appeal.

ImageDrawRectangleRounded:

The ImageDrawRectangleRounded node is designed to draw a rounded rectangle on an image canvas. This node is particularly useful for creating smooth, aesthetically pleasing shapes with rounded corners, which can be used in various design and artistic applications. By allowing you to specify the dimensions, corner radii, and colors for both the outline and fill, this node provides a high degree of customization. Additionally, it supports anti-aliasing to ensure that the edges of the shapes are smooth and visually appealing. This node is ideal for adding graphical elements to images, such as buttons, frames, or decorative shapes, enhancing the overall visual quality of your artwork.

ImageDrawRectangleRounded Input Parameters:

container

This parameter represents the image canvas on which the rounded rectangle will be drawn. It is typically a tensor that defines the dimensions and color channels of the image. The container's shape determines the size of the canvas.

start_x

The x-coordinate of the starting point (top-left corner) of the rectangle. This value determines the horizontal position of the rectangle on the canvas. Minimum value is 0, and the maximum value is the width of the canvas.

start_y

The y-coordinate of the starting point (top-left corner) of the rectangle. This value determines the vertical position of the rectangle on the canvas. Minimum value is 0, and the maximum value is the height of the canvas.

end_x

The x-coordinate of the ending point (bottom-right corner) of the rectangle. This value determines the horizontal extent of the rectangle. Minimum value is 0, and the maximum value is the width of the canvas.

end_y

The y-coordinate of the ending point (bottom-right corner) of the rectangle. This value determines the vertical extent of the rectangle. Minimum value is 0, and the maximum value is the height of the canvas.

radius

The radius of the rounded corners. This value determines how rounded the corners of the rectangle will be. Minimum value is 0 (no rounding), and the maximum value is half the smaller dimension of the rectangle.

outline_size

The thickness of the rectangle's outline. This value determines how thick the border of the rectangle will be. Minimum value is 0 (no outline), and there is no strict maximum value, but it should be reasonable relative to the rectangle's size.

outline_red

The red component of the outline color. This value ranges from 0 to 255, where 0 is no red and 255 is full red.

outline_green

The green component of the outline color. This value ranges from 0 to 255, where 0 is no green and 255 is full green.

outline_blue

The blue component of the outline color. This value ranges from 0 to 255, where 0 is no blue and 255 is full blue.

outline_alpha

The alpha (transparency) component of the outline color. This value ranges from 0 to 1, where 0 is fully transparent and 1 is fully opaque.

fill_red

The red component of the fill color. This value ranges from 0 to 255, where 0 is no red and 255 is full red.

fill_green

The green component of the fill color. This value ranges from 0 to 255, where 0 is no green and 255 is full green.

fill_blue

The blue component of the fill color. This value ranges from 0 to 255, where 0 is no blue and 255 is full blue.

fill_alpha

The alpha (transparency) component of the fill color. This value ranges from 0 to 1, where 0 is fully transparent and 1 is fully opaque.

top_left_corner

A boolean value that determines whether the top-left corner of the rectangle is rounded. If true, the corner is rounded; if false, it is square.

top_right_corner

A boolean value that determines whether the top-right corner of the rectangle is rounded. If true, the corner is rounded; if false, it is square.

bottom_right_corner

A boolean value that determines whether the bottom-right corner of the rectangle is rounded. If true, the corner is rounded; if false, it is square.

bottom_left_corner

A boolean value that determines whether the bottom-left corner of the rectangle is rounded. If true, the corner is rounded; if false, it is square.

SSAA

Supersample Anti-Aliasing factor. This value determines the level of anti-aliasing applied to the rectangle to smooth out the edges. Higher values result in smoother edges but require more processing power.

method

The resampling method used when resizing the image. This parameter determines the quality of the resizing operation. Common methods include "nearest", "bilinear", and "bicubic".

ImageDrawRectangleRounded Output Parameters:

IMAGE

The output is an image tensor with the drawn rounded rectangle. This tensor can be used in subsequent nodes for further image processing or rendering. The output image retains the dimensions and color channels of the input container, with the added graphical element.

ImageDrawRectangleRounded Usage Tips:

  • To create a button-like shape, set the radius parameter to a value that rounds the corners significantly, and use a contrasting outline and fill color.
  • For a subtle shadow effect, use a slightly transparent fill color by adjusting the fill_alpha parameter.
  • Experiment with the SSAA parameter to find a balance between smooth edges and processing time, especially for high-resolution images.

ImageDrawRectangleRounded Common Errors and Solutions:

"IndexError: index out of range"

  • Explanation: This error occurs when the specified coordinates are outside the bounds of the image container.
  • Solution: Ensure that the start_x, start_y, end_x, and end_y parameters are within the dimensions of the container.

"ValueError: invalid color value"

  • Explanation: This error occurs when the color component values are outside the acceptable range.
  • Solution: Verify that the outline_red, outline_green, outline_blue, outline_alpha, fill_red, fill_green, fill_blue, and fill_alpha parameters are within their respective ranges.

"TypeError: boolean value expected"

  • Explanation: This error occurs when the corner parameters are not boolean values.
  • Solution: Ensure that top_left_corner, top_right_corner, bottom_right_corner, and bottom_left_corner are set to either true or false.

"ValueError: invalid SSAA value"

  • Explanation: This error occurs when the SSAA parameter is set to an invalid value.
  • Solution: Ensure that the SSAA parameter is a positive integer that represents the level of anti-aliasing.

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