

## Simple Text Overlay Node for ComfyUI
A powerful, clean, and highly flexible custom node designed to overlay customizable text onto your images inside ComfyUI. Perfect for creating memes, cinematic poster layouts, watermarks, or promotional graphics. It outputs both the blended image and a clean text mask for further composition.
---
### 🚀 Features & Parameters Breakdown
* text: Supports multiline inputs (press Enter for new lines).
* font: Dropdown list of automatically discovered fonts.
* font_size: Base size of the text (from 4 to 2000).
* color_preset & custom_color: Choose from 14 built-in color presets or pick any HEX color using the Custom mode.
* stroke_width & stroke_color: Easily add text outlines/borders for high visibility on any background.
* shadow_preset: Quick presets Off, Soft, Medium, Strong, Custom) to control text drop shadows.
* shadow offsets, blur & opacity: Full manual control over the shadow layer shape and transparency.
* anchor: 9-point grid alignment top-left, center, bottom-right, etc.) to snap text precisely.
* offset_x & offset_y: Fine-tune position shifting relative to your selected anchor point.
* margin: Safe padding from the image edges.
* rotation: Rotate text anywhere from -180° to 180° (bounding boxes adjust automatically!).
* skew_x: Create beautiful faux-italic or stylized shear transformations.
* blend_mode: 12 professional blending algorithms normal, multiply, screen, overlay, soft_light, etc.) to seamlessly merge text with image textures.
* opacity: Global transparency slider for the entire text layer.
* line_spacing: Adjust vertical distance between lines for multiline texts.
* letter_spacing: Horizontal tracking control to expand or condense space between characters.
* fit_to_image: Smart feature that automatically shrinks the font size to guarantee the entire text fits within your margins without clipping.
---
### 📦 Installation
1. Download the node archive.
2. Unpack/unzip it and move the ComfyUI-SimpleTextOverlay folder into your ComfyUI directory:
ComfyUI/custom_nodes/
3. Restart ComfyUI.
---
### 🔤 Managing Fonts
The node comes with *14 pre-installed fonts** in various styles inside the internal fonts directory.
* Want to add your own? Just drop any .ttf, .otf, or .ttc font files directly into the fonts folder inside this custom node directory. They will be indexed automatically on the next ComfyUI startup!
Description
Changelog — Simple Text Overlay v2.0
New Features
Text Align (left / center / right / justify) — independent horizontal alignment of text lines within the text block, regardless of anchor position.
Vertical Align (top / middle / bottom) — vertical positioning of text inside its bounding box when fit_to_image is enabled.
Word Wrap (wrap_width) — automatic line breaking when text exceeds a specified pixel width. No more manual \n needed for long paragraphs.
Background Box — optional backdrop behind text with adjustable padding, opacity, corner radius, and color. Perfect for subtitles and readability on complex backgrounds.
Mask Mode (text_and_shadow / text_only / shadow_only) — choose what gets output to the mask channel. Previously mask always included shadow; now you can isolate text or shadow separately.
Supersampling (1x–4x) — renders text at higher resolution then downscales for sharper edges, especially useful for small fonts and thin strokes.
Improvements
Font caching — fonts are now cached once per session instead of rescanned on every batch frame, improving performance.
All stroke, spacing, and offset values are properly scaled when supersampling is active.
Shadow and background compositing — background box now renders correctly behind shadow and text layers.
Bug Fixes
Fixed mask output incorrectly including shadow when user needed text-only mask.
Fixed potential text clipping at canvas edges when stroke width is large.


