Create Text Mask
Rendering (and animating) text as a mask
- IMAGE
- MASK
Create Text Mask does exactly what it says: it renders a string of text at a fixed position on a canvas and gives you back both an image and a mask shaped like that text. Where Create Text On Path moves text along a coordinate list, this one is simpler and more direct - one text block, one position, and an optional rotation animation if you want it moving.
Why you'd want this
Text-shaped masks are useful anywhere you want to place or reveal content in the exact shape of a word - inpainting a caption into a scene, generating a watermark region, driving a "text reveal" transition where an image appears through the letters, or building a rotating title-card animation for a video intro. Because you get both the raw rendered image and a mask, you can use it purely as a mask (feeding a downstream inpaint or compositing step) or as visible text content on its own.
The rotation feature is the thing that separates this from a plain "draw text" utility: set start_rotation and end_rotation to different values and the node interpolates between them across your requested frame count, giving you a spinning-text animation without any extra nodes.
How it works
The text is rendered at (text_x, text_y) on a canvas of width × height, using whatever font and size you pick. If start_rotation and end_rotation match, you get frames copies of the same static text image. If they differ, the node interpolates the rotation angle linearly across the requested frame count, so frame 1 starts at start_rotation and the last frame lands at end_rotation.
One detail worth knowing up front: the node looks for fonts specifically in ComfyUI/custom_nodes/ComfyUI-KJNodes/fonts - that's straight from the node's own description, not a guess, and it's the first place to check if a font you expect isn't showing up.
The inputs and outputs that matter
text(multiline, default"HELLO!") andfont(an enum of what the node finds in that fonts folder - expect choices likeFreeMono.ttfor a bold display face).text_x/text_y- placement on the canvas (both default 0, meaning top-left corner - you'll usually want to set these).font_size(default 32) andfont_color.width/height- canvas size, default 512×512.frames(default 1) - how many frames to render; only matters if you're animating rotation.start_rotation(0–359, default 0) andend_rotation(-359–359, default 0) - set these apart to get a rotation animation acrossframes.invert(boolean) - flips the mask polarity.
Two outputs: IMAGE (the rendered text) and MASK (the text shape as a mask).
How to install it
- ComfyUI Manager - search KJNodes for ComfyUI, install, restart.
- Manual -
cd ComfyUI/custom_nodes && git clone https://github.com/kijai/ComfyUI-KJNodes, thenpip install -r ComfyUI-KJNodes/requirements.txt(portable:python_embeded\python.exe -m pip install -r ComfyUI\custom_nodes\ComfyUI-KJNodes\requirements.txt), then restart.
No model downloads - plain text rendering, no ML.
Common issues & troubleshooting
Custom font doesn't appear in the dropdown. This is the one real gotcha with this node: fonts have to live in ComfyUI/custom_nodes/ComfyUI-KJNodes/fonts specifically, not just anywhere on your system. Drop your .ttf/.otf file in there and restart ComfyUI if it's not showing up.
Text is cut off or lands off-canvas. text_x/text_y default to 0,0, which is the corner, not centered - combined with a large font_size, that can push text partly or fully off the visible canvas. Reposition and check width/height are large enough for what you typed.
Rotation animation looks like nothing's happening. Make sure frames is set higher than 1 - with frames at the default of 1, start_rotation and end_rotation have nothing to interpolate across, so you'll only ever see the starting angle.
Inputs (12)
| Name | Type | Default | Description |
|---|---|---|---|
| invert | BOOLEAN | false | — |
| frames | INT | 11–4096 | — |
| text_x | INT | 00–4096 | — |
| text_y | INT | 00–4096 | — |
| font_size | INT | 328–4096 | — |
| font_color | STRING | white | — |
| text | STRING | HELLO! | — |
| font | COMBO | 3 options: FreeMono.ttf, FreeMonoBoldOblique.otf, TTNorms-Black.otf | |
| width | INT | 51216–4096 | — |
| height | INT | 51216–4096 | — |
| start_rotation | INT | 00–359 | — |
| end_rotation | INT | 0-359–359 | — |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| IMAGE | IMAGE | — |
| MASK | MASK | — |