Nodes/ComfyUI-Book-Tools Nodes for ComfyUI/[Book Tools] Image Text Overlay
ComfyUI Node

[Book Tools] Image Text Overlay

The original Book Tools node, still the most predictable one

By Big-Idea-Technology·Created 2 years ago·Updated 8 months ago· 40
[Book Tools] Image Text Overlay
  • image
  • IMAGE
textHello
textbox_width200
textbox_height200
max_font_size80
min_font_size12
font/usr/share/fonts/truetype/dejavu/DejaVuSans-Bold.ttf
alignmentcenter
color#000000
start_x0
start_y0
padding50
line_height_factor1.2

BTImageTextOverlay is where Book Tools started. The author's own announcement thread for the pack (r/comfyui, "New Noodes", April 2024) explains that this node was moved out of an older project into Book Tools - and it's still the workhorse. It puts text onto an image inside a fixed textbox, auto-sizing the font so the words always fit. No outlines, no shadows, no glowing backgrounds. It's the "just draw the words and make them fit" node, and for most book-layout jobs that's exactly what you want before you reach for the fancier renderer.

How it works

You give it an image, the text, and a textbox region defined by textbox_width and textbox_height positioned at start_x / start_y. The node then binary-searches the largest font size between min_font_size and max_font_size that fits the text inside the box (minus padding on each side), wraps the words to width, and draws them.

The inputs that actually matter for a beginner:

  • text - multiline; the node word-wraps it for you.
  • textbox_width / textbox_height - the region the text must fit inside. Bigger box, bigger text.
  • min_font_size / max_font_size - the range it's allowed to pick from. If your text doesn't fit even at the minimum, it draws overflow rather than shrinking forever.
  • alignment (left/center/right), start_x / start_y - where the block sits.
  • color - a hex string like #000000 for the text.
  • padding - breathing room inside the box; line_height_factor controls line spacing (1.2 is the sensible default).

The single output is an IMAGE - the input image with text drawn on it - ready to save, upscale, or pipe into img2img.

The font problem, again

Like every text node in this pack, the font field defaults to /usr/share/fonts/truetype/dejavu/DejaVuSans-Bold.ttf. On Windows that path doesn't exist and the node falls back to PIL's tiny built-in font, which makes your carefully fitted text render as a cramped strip. Either point font at a font file you know exists, or run BTDownloadFont (same pack) and paste its output path in.

Installing

cd ComfyUI/custom_nodes
git clone https://github.com/Big-Idea-Technology/ComfyUI-Book-Tools
# restart ComfyUI

Or search "ComfyUI-Book-Tools" in ComfyUI Manager. Pure Python, Pillow-based, no models, no extra pip installs beyond what ComfyUI ships.

Where it fits

This node pairs with the rest of the pack the way you'd hope: BTPromptSchedule + BTPromptSelector pick the page's prompt, you generate the artwork, and BTImageTextOverlay stamps the page number or caption into a defined corner. Because its text placement is fixed and deterministic - unlike the random overlay node, which scatters text - it's the one to reach for when a book's layout demands consistency page after page.

Categoryimage/text

Inputs (13)

NameTypeDefaultDescription
imageIMAGE
textSTRINGHello
textbox_widthINT200
textbox_heightINT200
max_font_sizeINT801–256
min_font_sizeINT121–256
fontSTRING/usr/share/fonts/truetype/dejavu/DejaVuSans-Bold.ttf
alignmentCOMBOcenter3 options: left, right, center
colorSTRING#000000
start_xINT0
start_yINT0
paddingINT50
line_height_factorFLOAT1.20.5–3

Outputs (1)

NameTypeDescription
IMAGEIMAGE