ComfyUI Node: Add Label

Class Name

AddLabel

Category
KJNodes/text
Author
kijai (Account age: 2192days)
Extension
KJNodes for ComfyUI
Latest Updated
2024-06-25
Github Stars
0.35K

How to Install KJNodes for ComfyUI

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

Add Label Description

Enhance images with custom text labels, flexible positioning, font, and color settings for annotations and captions.

Add Label:

The AddLabel node is designed to enhance your images by adding custom text labels. This node allows you to overlay text onto an image or create a new image with the text label positioned above, below, or to the sides of the original image. It provides flexibility in terms of text positioning, font customization, and color settings, making it a powerful tool for annotating images, creating captions, or adding any textual information directly onto your visuals. The node supports various directions for text placement and offers options to adjust the font size, color, and background label color, ensuring that the text is both readable and aesthetically pleasing. This functionality is particularly useful for AI artists who need to add descriptive labels or annotations to their generated images.

Add Label Input Parameters:

image

This parameter expects an image input that you want to annotate with a text label. The image serves as the base onto which the text will be added.

text_x

This integer parameter specifies the x-coordinate for the text's starting position. It determines the horizontal placement of the text on the image. The default value is 10, with a minimum of 0 and a maximum of 4096.

text_y

This integer parameter specifies the y-coordinate for the text's starting position. It determines the vertical placement of the text on the image. The default value is 2, with a minimum of 0 and a maximum of 4096.

height

This integer parameter defines the height of the label area where the text will be placed. It affects the overall size of the label. The default value is 48, with a minimum of 0 and a maximum of 4096.

font_size

This integer parameter sets the size of the font used for the text label. It controls how large or small the text appears. The default value is 32, with a minimum of 0 and a maximum of 4096.

font_color

This string parameter specifies the color of the text. You can use color names or hexadecimal color codes to define the font color. The default value is "white".

label_color

This string parameter specifies the background color of the label area. You can use color names or hexadecimal color codes to define the label color. The default value is "black".

font

This parameter allows you to select the font used for the text label. Fonts are loaded from the folder ComfyUI/custom_nodes/ComfyUI-KJNodes/fonts.

text

This string parameter contains the text that you want to add as a label to the image. The default value is "Text".

direction

This parameter defines the direction in which the label will be added relative to the image. The available options are 'up', 'down', 'left', 'right', and 'overlay'. The default value is 'up'.

caption (optional)

This optional string parameter allows you to add a caption to the label. It provides additional text that can be included in the label area. The default value is an empty string.

Add Label Output Parameters:

image

The output is an image with the added text label. This image is either the original image with an overlay text or a new image with the text label positioned according to the specified direction.

Add Label Usage Tips:

  • To ensure the text is readable, choose contrasting colors for the font_color and label_color.
  • Adjust the font_size and height parameters to fit the text properly within the label area.
  • Use the direction parameter to position the label in a way that complements the composition of your image.
  • Load custom fonts into the specified folder to use unique typography for your labels.

Add Label Common Errors and Solutions:

"Font file not found"

  • Explanation: The specified font file could not be located in the fonts directory.
  • Solution: Ensure that the font file is correctly placed in the ComfyUI/custom_nodes/ComfyUI-KJNodes/fonts directory and that the filename is correctly specified.

"Invalid color value"

  • Explanation: The provided color value for font_color or label_color is not recognized.
  • Solution: Use valid color names or hexadecimal color codes for the color parameters.

"Text exceeds label area"

  • Explanation: The text is too long to fit within the specified label area.
  • Solution: Increase the height of the label area or reduce the font_size to ensure the text fits properly.

"Invalid direction value"

  • Explanation: The provided value for the direction parameter is not one of the accepted options.
  • Solution: Use one of the following valid options for the direction parameter: 'up', 'down', 'left', 'right', 'overlay'.

Add Label Related Nodes

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