[Book Tools] Text to Image
The name is a lie, and that's a good thing
- image
- IMAGE
"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_amountbends 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_offsetandoutline_thicknessadd depth;use_gradientwithgradient_directiongives a vertical or horizontal color fade.background_stylepicksnone,rectangle,ribbon, orglow, andbackground_color(auto/dark/light) picks a contrasting backdrop automatically.text_justification(left/center/right) andvertical_position(top/center/bottom) place the block.text_colordefaults to"random", which draws from a curated 24-color palette - pass a hex like#FF5500if you want control.random_positionplusposition_offsetscatters 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.
Inputs (21)
| Name | Type | Default | Description |
|---|---|---|---|
| image | IMAGE | — | |
| text | STRING | Hello | — |
| max_font_size | INT | 968–256 | — |
| min_font_size | INT | 328–256 | — |
| font | STRING | /usr/share/fonts/truetype/dejavu/DejaVuSans-Bold.ttf | — |
| padding | INT | 40 | — |
| line_height_factor | FLOAT | 1.40.5–3 | — |
| curve_amount | FLOAT | 0.0-0.5–0.5 | — |
| char_spacing | FLOAT | 0.20–2 | — |
| random_position | BOOLEAN | false | — |
| position_offset | INT | 20 | — |
| shadow_offset | INT | 40–20 | — |
| outline_thickness | INT | 31–10 | — |
| use_gradient | BOOLEAN | false | — |
| gradient_direction | COMBO | vertical | 2 options: vertical, horizontal |
| background_style | COMBO | none | 4 options: none, rectangle, ribbon, glow |
| background_color | COMBO | auto | 3 options: auto, dark, light |
| background_padding | INT | 200–100 | — |
| text_justification | COMBO | left | 3 options: left, center, right |
| vertical_position | COMBO | center | 3 options: top, center, bottom |
| text_color | STRING | random | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| IMAGE | IMAGE | — |