Skip to main content

Add Label

KJNodes/text
AddLabel

Creates a new with the given text, and concatenates it to either above or below the input image. Note that this changes the input image's height! Fonts are loaded from this folder: ComfyUI/custom_nodes/ComfyUI-KJNodes/fonts

Example

JSON Example
{
  "class_type": "AddLabel",
  "inputs": {
    "image": [
      "node_id",
      0
    ],
    "text_x": 10,
    "text_y": 2,
    "height": 48,
    "font_size": 32,
    "font_color": "white",
    "label_color": "black",
    "font": "FreeMono.ttf",
    "text": "Text",
    "direction": "up"
  }
}

This example shows required inputs only. Connection values like ["node_id", 0] should reference actual node IDs from your workflow.

Inputs

NameTypeStatusConstraintsDefault
imageIMAGErequired--
text_xINTrequiredmin: 0, max: 4096, step: 110
text_yINTrequiredmin: 0, max: 4096, step: 12
heightINTrequiredmin: -1, max: 4096, step: 148
font_sizeINTrequiredmin: 0, max: 4096, step: 132
font_colorSTRINGrequired-"white"
label_colorSTRINGrequired-"black"
fontENUM
3 options
  • FreeMono.ttf
  • FreeMonoBoldOblique.otf
  • TTNorms-Black.otf
required--
textSTRINGrequired-"Text"
directionENUM
5 options
  • up
  • down
  • left
  • right
  • overlay
required-"up"
captionSTRINGoptional-""

Outputs

IndexNameTypeIs ListConnection Reference
0IMAGEIMAGENo["{node_id}", 0]
How to connect to these outputs

To connect another node's input to an output from this node, use the connection reference format:

["node_id", output_index]

Where node_id is the ID of this AddLabel node in your workflow, and output_index is the index from the table above.

Example

If this node has ID "5" in your workflow:

  • IMAGE (IMAGE): ["5", 0]
Was this page helpful?