🔤 AGSoft Text Overlay
Burn a caption onto your render without ever leaving the graph
- image
- mask
- IMAGE
Every workflow eventually needs a caption burned onto an image - the settings you used, a watermark, subtitles for a video pass - and stock ComfyUI gives you nothing for it. 🔤 AGSoft Text Overlay from comfyui-AGSoft is the closest thing to a full text-layout engine inside the graph: fourteen bundled fonts, stroke, drop shadow, a rounded background box, rotation, and even mask-based positioning. WAS Node Suite has a text overlay too, but it's a toy next to this one.
How it works
Under the hood it's Pillow (ImageDraw) drawing on a temporary RGBA layer, then compositing over your image. The pack ships its fonts in a fonts/ directory inside the repo - everything from impact.ttf to RubikBeastly-Regular.ttf - so you don't download a thing. If a font file can't be loaded it silently falls back to Pillow's default font, which is worth remembering when your text suddenly looks like a terminal window.
The essentials a beginner actually sets:
text- multiline, so drop a whole paragraph in. Newlines become line breaks.font_name/font_size- pick from the bundled list; size up to 1024.font_color- a 30-color dropdown, or pickcustomand fill infont_color_hex(same pattern for stroke, shadow, and box colors).stroke_width/shadow_x/shadow_y- outline and drop-shadow controls. Default 0 means off.box_padding,box_opacity,box_radius- the background box behind the text. Bump opacity and it becomes a caption bar.align(vertical: center/top/bottom),justify(horizontal),text_align(inside the text block),margins,line_spacing,position_x/position_yfor nudging, androtation_anglein degrees.
That's a lot of knobs, but they're all zero-or-sane by default: the node centers your text and you nudge from there.
The mask trick
The killer feature is the optional mask input. Instead of hand-positioning, draw a mask with ComfyUI's built-in mask editor on an image node, feed it in, and the node computes the text area from the mask's bounding box - it centers the text inside whatever region you painted. For watermarking the bottom-right corner of a whole batch, you paint once and it just follows the region. Note that a connected mask overrides your margins, position, justify, and align; the mask defines the box.
Why you'd reach for it
- Stamp the settings/prompt onto a render before posting it.
- Add subtitles or title cards to an image sequence headed into a video workflow.
- Batch-watermark an output directory with your handle and model name.
Installing and troubleshooting
Same as the rest of the pack:
cd ComfyUI/custom_nodes
git clone https://github.com/Art-xmaster/comfyui-AGSoft.git
# restart ComfyUI
Or search comfyui-AGSoft in ComfyUI Manager. The overlay node needs Pillow, which ComfyUI already depends on, so no extra install beyond the pack itself.
The gotchas are all visual: if your "custom" color isn't applied, you probably left the dropdown on a preset instead of custom. If text looks wrong, check you're picking from the pack's bundled fonts rather than expecting your system's. And the mask overrides positioning - if you're fighting placement, disconnect the mask and check whether it's the culprit.
Inputs (28)
| Name | Type | Default | Description |
|---|---|---|---|
| image | IMAGE | The input image to overlay text on. Входное изображение. | |
| text | STRING | text | The text to be overlaid. Текст. |
| font_name | COMBO | The font file to use. Файл шрифта. | |
| font_size | INT | 501–1024 | Font size. Размер шрифта. |
| font_color | COMBO | white | Text color. Цвет текста. |
| text_opacity | FLOAT | 1.000–1 | Text opacity. Прозрачность текста. |
| stroke_width | INT | 00–20 | Stroke width. Ширина обводки. |
| stroke_color | COMBO | black | Stroke color. Цвет обводки. |
| shadow_x | INT | 0-100–100 | Shadow X offset. Смещение тени X. |
| shadow_y | INT | 0-100–100 | Shadow Y offset. Смещение тени Y. |
| shadow_color | COMBO | black | Shadow color. Цвет тени. |
| box_padding | INT | 200–200 | Box padding. Отступ фона. |
| box_color | COMBO | black | Box color. Цвет фона. |
| box_opacity | FLOAT | 0.500–1 | Box opacity. Прозрачность фона. |
| box_radius | INT | 200–100 | Box corner radius. Радиус скругления. |
| align | COMBO | Vertical alignment. Вертикальное выравнивание. | |
| justify | COMBO | Horizontal alignment. Горизонтальное выравнивание. | |
| text_align | COMBO | left | Text alignment inside block. Выравнивание внутри блока. |
| margins | INT | 0-1024–1024 | Margins from edges. Отступы от краев. |
| line_spacing | INT | 10-1024–1024 | Line spacing. Интервал между строк. |
| position_x | INT | 0-4096–4096 | X position offset. Смещение X. |
| position_y | INT | 0-4096–4096 | Y position offset. Смещение Y. |
| rotation_angle | FLOAT | 0.0-360–360 | Rotation angle. Угол поворота. |
| maskopt | MASK | Optional mask to define text area. Draw it using ComfyUI's built-in mask editor on an image node. Опциональная маска для зоны текста. Нарисуйте её через встроенный редактор масок ComfyUI. | |
| font_color_hexopt | STRING | #FFFFFF | Custom font HEX. Кастомный HEX шрифта. |
| stroke_color_hexopt | STRING | #000000 | Custom stroke HEX. Кастомный HEX обводки. |
| shadow_color_hexopt | STRING | #000000 | Custom shadow HEX. Кастомный HEX тени. |
| box_color_hexopt | STRING | #000000 | Custom box HEX. Кастомный HEX фона. |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| IMAGE | IMAGE | — |