ComfyUI > Nodes > Allor Plugin > ImageDrawLine

ComfyUI Node: ImageDrawLine

Class Name

ImageDrawLine

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

ImageDrawLine Description

Draw straight lines on image canvas with specified start/end points, color, thickness, and transparency for linear design elements.

ImageDrawLine:

The ImageDrawLine node is designed to draw straight lines on an image canvas, providing a simple yet powerful way to add linear elements to your artwork. This node allows you to specify the start and end points of the line, as well as its color, thickness, and transparency. By leveraging this node, you can enhance your images with precise lines, which can be useful for creating borders, dividers, or any other linear design elements. The node also supports Super-Sampling Anti-Aliasing (SSAA) to ensure smooth and high-quality lines, and it allows you to choose the resampling method for resizing the canvas, ensuring that the final output meets your quality standards.

ImageDrawLine Input Parameters:

container

This parameter represents the input image container on which the line will be drawn. It is typically a tensor that holds the image data.

size

This parameter defines the thickness of the line. A larger value results in a thicker line, while a smaller value produces a thinner line. The default value is usually set to 1.

start_x

This parameter specifies the x-coordinate of the starting point of the line. It is a relative value between 0 and 1, where 0 represents the left edge of the image and 1 represents the right edge.

start_y

This parameter specifies the y-coordinate of the starting point of the line. It is a relative value between 0 and 1, where 0 represents the top edge of the image and 1 represents the bottom edge.

end_x

This parameter specifies the x-coordinate of the ending point of the line. It is a relative value between 0 and 1, where 0 represents the left edge of the image and 1 represents the right edge.

end_y

This parameter specifies the y-coordinate of the ending point of the line. It is a relative value between 0 and 1, where 0 represents the top edge of the image and 1 represents the bottom edge.

red

This parameter sets the red component of the line color. It is an integer value between 0 and 255.

green

This parameter sets the green component of the line color. It is an integer value between 0 and 255.

blue

This parameter sets the blue component of the line color. It is an integer value between 0 and 255.

alpha

This parameter sets the transparency of the line. It is a float value between 0 and 1, where 0 is fully transparent and 1 is fully opaque.

SSAA

This parameter enables Super-Sampling Anti-Aliasing (SSAA) to improve the quality of the line. It is an integer value that determines the level of SSAA. Higher values result in smoother lines but require more processing power.

method

This parameter specifies the resampling method used when resizing the canvas. Common methods include "nearest", "bilinear", and "bicubic". The choice of method affects the quality and performance of the resizing operation.

ImageDrawLine Output Parameters:

IMAGE

The output is an image tensor with the drawn line. This tensor can be used for further processing or directly rendered as an image. The line will be drawn according to the specified parameters, and the output image will reflect these changes.

ImageDrawLine Usage Tips:

  • To create smooth and high-quality lines, consider using a higher SSAA value, but be aware that this will increase processing time.
  • Experiment with different resampling methods to find the best balance between quality and performance for your specific use case.
  • Use relative coordinates (start_x, start_y, end_x, end_y) to easily position lines within the image, regardless of its size.

ImageDrawLine Common Errors and Solutions:

"Invalid container shape"

  • Explanation: The input container does not have the expected shape or dimensions.
  • Solution: Ensure that the input container is a valid image tensor with the correct dimensions.

"Invalid color value"

  • Explanation: One of the color parameters (red, green, blue) is outside the valid range of 0 to 255. - Solution: Check and correct the color values to ensure they are within the valid range.

"Invalid alpha value"

  • Explanation: The alpha parameter is outside the valid range of 0 to 1. - Solution: Adjust the alpha value to be within the range of 0 to 1.

"Invalid SSAA value"

  • Explanation: The SSAA parameter is not a valid integer or is set to a value that is too high.
  • Solution: Ensure that the SSAA value is a positive integer and consider lowering it if processing time is too long.

"Invalid resampling method"

  • Explanation: The specified resampling method is not recognized.
  • Solution: Use a valid resampling method such as "nearest", "bilinear", or "bicubic".

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