ComfyUI-KJNodes
Run ComfyUI Easily with InstaSD
Skip the complex setup. InstaSD helps creative professionals build workflows and deploy them to the world:
- One-click deployment
- Any model, any node
- Powerful GPUs for rapid iteration
Available Nodes
AddLabel
AddLabel Node Documentation
Overview
The AddLabel node is part of the KJNodes for ComfyUI, a collection of nodes designed to enhance the functionality of ComfyUI with additional features related to image processing and text labeling. This node allows users to add a textual label to an image. The label can be placed in various positions relative to the image, and users can define text, style, and font properties.
Functionality
The AddLabel node creates a new image by adding a specified textual label to an existing image. The text label can be placed in multiple locations such as at the top, bottom, left, right, or directly overlaying the image. This node is useful for marking images with descriptions, annotations, or any textual information.
Inputs
-
Image: The input image to which the label is to be added. This is a mandatory input.
-
Text Position (text_x, text_y): The coordinates for the text position within the label. Default values are
text_x = 10andtext_y = 2. -
Label Height (height): The height of the label area where the text will appear. The value can range from -1 (for auto height) to 4096. The default is 48.
-
Font Size (font_size): The size of the text font. The default value is 32.
-
Font & Label Colors (font_color, label_color): Colors for the text and label background. Default values are
whitefor the font andblackfor the label. -
Font: The font style for the text. Fonts are loaded from a specific directory within the ComfyUI installation.
-
Text: The text to be displayed in the label. Default text is "Text".
-
Direction: The direction in which the label is added relative to the image. Options are 'up', 'down', 'left', 'right', and 'overlay'. The default is 'up'.
-
Caption (optional): A list of captions corresponding to each batch image. This input is optional and allows for unique text for each image in a batch.
Outputs
- Image: The output is an image with the specified label added according to the chosen options. The image's dimensions will change depending on the label's position and size.
Usage in ComfyUI Workflows
The AddLabel node can be seamlessly integrated into ComfyUI workflows where image annotation or labeling is needed. This functionality is particularly useful for workflows in media production, gallery displays, or data visualization where images need descriptive labeling or annotations.
Here are a few use-case scenarios:
-
Documentation and Explanation: Add informative text to a sequence of images in a presentation or educational content.
-
Watermarking: Add a custom overlay text as a watermark to protect image copyrights.
-
Branding: Apply a consistent and stylish brand-based text on all images within a batch for marketing materials.
-
Captioning: Add descriptive captions to a blog or photo album images to enhance storytelling.
-
Informational Overlay: Show important informational text directly on images for quick reference in data-driven visualizations.
Special Features and Considerations
-
Font and Label Flexibility: Users can customize the font, color, size, and position of the label to fit their specific needs.
-
Batch Processing: The node supports batch processing, allowing for individual captions for each image in a batch by utilizing the caption input.
-
Automatic Height Adjustment: When label height is set to -1, the node automatically adjusts to fit the text, offering a dynamic and adaptive labeling solution.
-
Pre-installed Fonts: Fonts must be located within a specified directory in the ComfyUI setup, ensuring that the desired styles are available for use.
-
Positioning Options: Various positioning options allow for flexibility in how and where the label is displayed on the image, making it adaptable for different use cases.
By using the AddLabel node, users of ComfyUI can significantly enhance their image processing workflows with custom text overlays, improving both functionality and presentation.