Text Mask Node β‘π ‘π π £π
Render text straight into a mask, no external image editor needed
- MASK
- IMAGE
If you need a mask shaped like text - for compositing lettering into a frame, inpainting a title region, or building a stylized-typography effect - this node renders it directly instead of you round-tripping through Photoshop or GIMP to make one. It's a plain Pillow-based text renderer under the hood, outputting both the mask itself and a preview image so you can see what you're getting.
Inputs and outputs that matter
The core ones: text (default "Hello World"), width/height (canvas size, 1-8192 px), font_size (1-1000), and font - a dropdown of whatever fonts are installed on the machine actually rendering the node (this pack ships an enum with dozens of system fonts, DejaVu Sans and friends among them). Position and shape controls: x_position/y_position (0.0-1.0, normalized placement within the frame), rotation (0-360Β°), and max_width_ratio (0.1-1.0, caps how wide the text can get relative to the frame before it wraps or shrinks). Color is set via font_color and background_color, both plain RGB strings like (255,255,255). batch_size (1-10000) repeats the identical static mask across a batch - it does not animate the text moving or appearing; every frame in that batch gets the same mask.
Outputs: MASK and IMAGE.
Worth knowing if you're running this on a shared or cloud instance
The font list is populated from whatever's actually installed on the machine rendering the workflow - locally that might be a huge list including fonts you've personally installed; on a shared/cloud runtime it's whatever fonts ship with that image. A workflow saved with one font name might silently fall back or fail to find that exact font on a different machine. If you're sharing a workflow across environments, don't assume a specific display font you picked locally is guaranteed to be present elsewhere - stick to common system fonts (DejaVu Sans and similar) for anything you expect to run reliably in more than one place.
Installing it
ComfyUI Manager: search RyanOnTheInside, install, restart. Manual:
cd ComfyUI/custom_nodes
git clone https://github.com/ryanontheinside/ComfyUI_RyanOnTheInside
cd ComfyUI_RyanOnTheInside
pip install -r requirements.txt
pillow is already in this pack's requirements.txt, which is what handles the text rendering - a standard install covers it.
Where people get burned
The font dropdown is long (over 80 entries) and includes multiple weight/style variants of the same family name, which makes it easy to pick the wrong variant by accident - double-check the rendered preview IMAGE output rather than trusting the name alone. And remember batch_size is a repeat count, not an animation control: if you're expecting text that appears letter-by-letter or moves across frames, you won't get that from this node by itself - you'd need to drive position or a reveal mask per-frame some other way, this node just stamps out N identical copies of one static text render.
Inputs (12)
| Name | Type | Default | Description |
|---|---|---|---|
| width | INT | 5121β8192 | Width of the output image in pixels (1 to 8192) |
| height | INT | 5121β8192 | Height of the output image in pixels (1 to 8192) |
| text | STRING | Hello World | Text content to render |
| font | COMBO | Font family to use for rendering (from system fonts) | |
| font_size | INT | 321β1000 | Size of the font in pixels (1 to 1000) |
| font_color | STRING | (255,255,255) | Color of the text in RGB format (e.g., '(255,255,255)') |
| background_color | STRING | (0,0,0) | Color of the background in RGB format (e.g., '(0,0,0)') |
| x_position | FLOAT | 0.500β1 | Horizontal position of text relative to frame width (0.0 to 1.0) |
| y_position | FLOAT | 0.500β1 | Vertical position of text relative to frame height (0.0 to 1.0) |
| rotation | FLOAT | 0.000β360 | Rotation angle of the text in degrees (0 to 360) |
| max_width_ratio | FLOAT | 0.900.1β1 | Maximum text width as ratio of frame width (0.1 to 1.0) |
| batch_size | INT | 11β10000 | Number of identical text masks to generate (1 to 10000) |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| MASK | MASK | β |
| IMAGE | IMAGE | β |