[Book Tools] Image Text Overlay
The original Book Tools node, still the most predictable one
- image
- IMAGE
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#000000for the text.padding- breathing room inside the box;line_height_factorcontrols 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.
Inputs (13)
| Name | Type | Default | Description |
|---|---|---|---|
| image | IMAGE | — | |
| text | STRING | Hello | — |
| textbox_width | INT | 200 | — |
| textbox_height | INT | 200 | — |
| max_font_size | INT | 801–256 | — |
| min_font_size | INT | 121–256 | — |
| font | STRING | /usr/share/fonts/truetype/dejavu/DejaVuSans-Bold.ttf | — |
| alignment | COMBO | center | 3 options: left, right, center |
| color | STRING | #000000 | — |
| start_x | INT | 0 | — |
| start_y | INT | 0 | — |
| padding | INT | 50 | — |
| line_height_factor | FLOAT | 1.20.5–3 | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| IMAGE | IMAGE | — |