Nodes/AAA Metadata System/Text Overlay Node v04
ComfyUI Node

Text Overlay Node v04

Watermarks, captions and neon text, without leaving the graph

By EricRollei·Created 11 months ago·Updated 10 months ago· 14
Text Overlay Node v04
  • reference_image
  • image
  • preview
◄textYour text here►
◄width512►
◄height512►
◄fontC059 BdIta►
◄font_size32►
◄color#FFFFFF►
◄aligncenter►
◄v_alignmiddle►
◄transparent_backgroundtrue►
◄background_color#000000►
◄background_opacity100►
◄x_offset_pct0.0►
◄y_offset_pct0.0►
◄line_spacing1.2►
◄padding20►
◄wrap_width0►
◄outline_color►
◄outline_width1►
◄text_file►
◄boldfalse►
◄italicfalse►
◄shadowfalse►
◄shadow_color#000000►
◄shadow_offset2►
◄layer_blend_modenormal►
◄text_effectnone►
◄gradient_color#0000FF►
◄show_font_previewfalse►
◄preview_textThe quick brown fox jumps over the lazy dog►
◄fonts_per_page30►
◄preview_page1►

Every serious ComfyUI setup eventually needs to slap text on an image - a watermark before you post, a caption under a test grid, a title card for a video, or a timestamp on a batch. The usual answer is to drop out to Photoshop or PIL for every single one, which gets old fast. Text Overlay Node v04 exists so the text stays in the graph.

It's a PIL-based text renderer that can either draw on top of a reference image or generate a text-on-background image from scratch. It supports full font selection from your system's installed fonts, bold/italic, drop shadows, outlines, and four flashy effects - gradient, metal, neon and emboss - plus standard blend modes if you want the text to interact with the layer beneath.

How it works

The node renders text with PIL's ImageDraw/ImageFont stack. If you connect reference_image, it uses that as the canvas; leave it disconnected and it creates a blank canvas at width × height. Then it runs the text through line wrapping (wrap_width, or auto-wrap based on the canvas), positions it with x_offset_pct/y_offset_pct plus align and v_align, and applies whatever effects, shadow, outline and blend mode you've asked for.

The fun bit: it parses Markdown (via the markdown library plus BeautifulSoup), so a line like **bold** or *italic* actually renders bold or italic instead of showing asterisks. Feed it a text file via text_file and it'll style a whole caption document. That's a surprisingly useful trick for recipe cards and metadata overlays.

The inputs that matter

For a beginner, you mostly touch these:

  • text - what gets drawn. text_file (optional) loads from a file instead.
  • font - dropdown of your installed system fonts (it scans the OS font directory), with font_size, bold, italic.
  • color + background_color/background_opacity - text color and the canvas/backing color. transparent_background on gives you a transparent PNG for stamping.
  • align/v_align and the *_offset_pct fields - where the text sits.
  • text_effect - none default; gradient, metal, neon, emboss are the party tricks. Try neon once, then go back to normal.

There are preview knobs too - show_font_preview, preview_text, fonts_per_page, preview_page - which dump a browsable gallery of fonts to the preview output. Handy when you can't remember which of your 400 fonts is the one you actually like.

Outputs

  • image - the finished composite.
  • preview - the font gallery image when preview mode is on.

Installing it

It's part of the AAA Metadata System pack:

cd ComfyUI/custom_nodes
git clone https://github.com/EricRollei/AAA_Metadata_System.git
cd AAA_Metadata_System
pip install -r requirements.txt

Restart ComfyUI, or grab "AAA Metadata System" via ComfyUI Manager. The markdown and beautifulsoup4 dependencies it needs are in the pack's requirements, so a normal install covers it. License note: CC BY-NC for non-commercial; commercial use needs a paid license from the author.

Common issues

  • Font shows as a tiny default - the font dropdown lists names derived from filenames; if your font isn't found it falls back to defaults like Arial. Check that the font is actually in your OS font directory.
  • Text renders literally like **bold** - you're seeing a Markdown parse failure. Make sure you're not feeding it a file with malformed markup; the parser is permissive but not psychic.
  • Preview looks huge/empty - preview_page and fonts_per_page control the gallery; bump the page number if you have hundreds of fonts.

It's not going to replace a real design tool for fancy typography, and the font management is a little clunky. But for watermarking and captioning inside a workflow, it's more capable than you'd expect from a node you found in a metadata pack - and it saves you a lot of tabbing out.

Categoryimage/text

Inputs (32)

NameTypeDefaultDescription
textSTRINGYour text here—
widthINT51216–8192—
heightINT51216–8192—
fontCOMBOC059 BdIta45 options: C059 BdIta, C059 Bold, C059 Italic, C059 Roman, D050000L, DejaVuSans, +39
font_sizeINT328–256—
colorSTRING#FFFFFF—
alignCOMBOcenter3 options: left, center, right
v_alignCOMBOmiddle3 options: top, middle, bottom
transparent_backgroundBOOLEANtrueUse a transparent background (if false, uses background color)
background_colorSTRING#000000Background color when not using transparent background
background_opacityINT1000–100Background opacity percentage (0-100%)
x_offset_pctFLOAT0.0-100–100Horizontal offset as percentage of image width (-100% to 100%)
y_offset_pctFLOAT0.0-100–100Vertical offset as percentage of image height (-100% to 100%)
line_spacingFLOAT1.20.5–3—
paddingINT200–500—
wrap_widthINT00–8192Max characters per line (0 = auto based on width)
reference_imageoptIMAGEOptional image to get dimensions from
outline_coloroptSTRING—
outline_widthoptINT11–10—
text_fileoptSTRING—
boldoptBOOLEANfalse—
italicoptBOOLEANfalse—
shadowoptBOOLEANfalse—
shadow_coloroptSTRING#000000—
shadow_offsetoptINT21–10—
layer_blend_modeoptCOMBOnormalHow the text layer should blend with background when composited
text_effectoptCOMBOnoneSpecial effect to apply to text
gradient_coloroptSTRING#0000FF—
show_font_previewoptBOOLEANfalseGenerate a preview image showing all available fonts
preview_textoptSTRINGThe quick brown fox jumps over the lazy dogSample text to use for font preview
fonts_per_pageoptINT305–100Number of fonts to show per page in font preview
preview_pageoptINT1Current page to show in font preview

Outputs (2)

NameTypeDescription
imageIMAGE—
previewIMAGE—