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

[Book Tools] Text to Image

The name is a lie, and that's a good thing

By Big-Idea-Technology·Created 2 years ago·Updated 8 months ago· 40
[Book Tools] Text to Image
  • image
  • IMAGE
textHello
max_font_size96
min_font_size32
font/usr/share/fonts/truetype/dejavu/DejaVuSans-Bold.ttf
padding40
line_height_factor1.4
curve_amount0.0
char_spacing0.2
random_positionfalse
position_offset20
shadow_offset4
outline_thickness3
use_gradientfalse
gradient_directionvertical
background_stylenone
background_colorauto
background_padding20
text_justificationleft
vertical_positioncenter
text_colorrandom

"Text to Image" sounds like it's going to generate an image from a prompt. It does not. There's no diffusion model, no API, no GPU required - the node takes an image you already have and renders styled text on top of it. It's the flashy, fully-loaded text renderer of the Book Tools pack, and it's aimed squarely at book covers, title pages, and anything where you want text that looks designed rather than just typed.

That's worth saying plainly, because it means the node is deterministic, instant, and impossible to burn VRAM on. If what you actually wanted was a text-to-image generator, this isn't that - but if you wanted "draw these words over this background with a glow effect and an outline," this is the one.

How it works

It takes an image tensor, converts it to a PIL image, and figures out the largest font size between min_font_size and max_font_size that still fits your text within the padding margins - via binary search, so it's fast. Then it word-wraps and draws, with a surprising amount of styling packed into the inputs:

  • curve_amount bends the text into an arc (negative bends one way, positive the other, clamped at ±30° per character).
  • char_spacing (0–2) spaces characters out.
  • shadow_offset and outline_thickness add depth; use_gradient with gradient_direction gives a vertical or horizontal color fade.
  • background_style picks none, rectangle, ribbon, or glow, and background_color (auto/dark/light) picks a contrasting backdrop automatically.
  • text_justification (left/center/right) and vertical_position (top/center/bottom) place the block.
  • text_color defaults to "random", which draws from a curated 24-color palette - pass a hex like #FF5500 if you want control.
  • random_position plus position_offset scatters the text around with a little jitter instead of the fixed placement.

The output is a single IMAGE you can save, feed into an upscaler, or send back through img2img.

The font gotcha

Every Book Tools text node defaults to the Linux path /usr/share/fonts/truetype/dejavu/DejaVuSans-Bold.ttf. On Windows that path doesn't exist, and the node quietly falls back to PIL's tiny built-in bitmap font - your text renders tiny and ugly with a warning in the console. Don't fight it: use BTDownloadFont (same pack) to fetch a proper font and paste the returned path into the font input.

Installing

Via ComfyUI Manager (Install Custom Nodes → search "ComfyUI-Book-Tools") or:

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

No extra pip dependencies beyond what ComfyUI ships (Pillow, torch, numpy), no model downloads.

Where it fits

The Book Tools family is built around laying out books page by page. Typical flow: BTPromptSchedule → BTPromptSelector to pick the page's prompt, generate a background with your sampler, then BTTextToImage to put the chapter title or page text on top. The loop nodes (BTLoop/BTLoopStart/BTLoopEnd) can drive that per-page. Start with background_style set to rectangle and text_color to a hex - the defaults look like a first draft, but the node earns its keep once you find the combo that matches your book's design.

Categoryimage/text

Inputs (21)

NameTypeDefaultDescription
imageIMAGE
textSTRINGHello
max_font_sizeINT968–256
min_font_sizeINT328–256
fontSTRING/usr/share/fonts/truetype/dejavu/DejaVuSans-Bold.ttf
paddingINT40
line_height_factorFLOAT1.40.5–3
curve_amountFLOAT0.0-0.5–0.5
char_spacingFLOAT0.20–2
random_positionBOOLEANfalse
position_offsetINT20
shadow_offsetINT40–20
outline_thicknessINT31–10
use_gradientBOOLEANfalse
gradient_directionCOMBOvertical2 options: vertical, horizontal
background_styleCOMBOnone4 options: none, rectangle, ribbon, glow
background_colorCOMBOauto3 options: auto, dark, light
background_paddingINT200–100
text_justificationCOMBOleft3 options: left, center, right
vertical_positionCOMBOcenter3 options: top, center, bottom
text_colorSTRINGrandom

Outputs (1)

NameTypeDescription
IMAGEIMAGE