Create Text Mask
KJNodes/text
CreateTextMaskCreates 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
| Name | Type | Status | Constraints | Default |
|---|---|---|---|---|
invert | BOOLEAN | required | - | false |
frames | INT | required | min: 1, max: 4096, step: 1 | 1 |
text_x | INT | required | min: 0, max: 4096, step: 1 | 0 |
text_y | INT | required | min: 0, max: 4096, step: 1 | 0 |
font_size | INT | required | min: 8, max: 4096, step: 1 | 32 |
font_color | STRING | required | - | "white" |
text | STRING | required | - | "HELLO!" |
font | ENUM3 options
| required | - | - |
width | INT | required | min: 16, max: 4096, step: 1 | 512 |
height | INT | required | min: 16, max: 4096, step: 1 | 512 |
start_rotation | INT | required | min: 0, max: 359, step: 1 | 0 |
end_rotation | INT | required | min: -359, max: 359, step: 1 | 0 |
Outputs
| Index | Name | Type | Is List | Connection Reference |
|---|---|---|---|---|
0 | IMAGE | IMAGE | No | ["{node_id}", 0] |
1 | MASK | MASK | No | ["{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?