Skip to main content

Create Text Mask

KJNodes/text
CreateTextMask

Creates a text image and mask. Looks for fonts from this folder: ComfyUI/custom_nodes/ComfyUI-KJNodes/fonts If start_rotation and/or end_rotation are different values, creates animation between them.

Example

JSON Example
{
  "class_type": "CreateTextMask",
  "inputs": {
    "invert": false,
    "frames": 1,
    "text_x": 0,
    "text_y": 0,
    "font_size": 32,
    "font_color": "white",
    "text": "HELLO!",
    "font": "FreeMono.ttf",
    "width": 512,
    "height": 512,
    "start_rotation": 0,
    "end_rotation": 0
  }
}

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

Inputs

NameTypeStatusConstraintsDefault
invertBOOLEANrequired-false
framesINTrequiredmin: 1, max: 4096, step: 11
text_xINTrequiredmin: 0, max: 4096, step: 10
text_yINTrequiredmin: 0, max: 4096, step: 10
font_sizeINTrequiredmin: 8, max: 4096, step: 132
font_colorSTRINGrequired-"white"
textSTRINGrequired-"HELLO!"
fontENUM
3 options
  • FreeMono.ttf
  • FreeMonoBoldOblique.otf
  • TTNorms-Black.otf
required--
widthINTrequiredmin: 16, max: 4096, step: 1512
heightINTrequiredmin: 16, max: 4096, step: 1512
start_rotationINTrequiredmin: 0, max: 359, step: 10
end_rotationINTrequiredmin: -359, max: 359, step: 10

Outputs

IndexNameTypeIs ListConnection Reference
0IMAGEIMAGENo["{node_id}", 0]
1MASKMASKNo["{node_id}", 1]
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 CreateTextMask 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]
  • MASK (MASK): ["5", 1]
Was this page helpful?