Shima Add Font Text
Burn text onto your renders without ever leaving ComfyUI
- images
- IMAGE
Sooner or later you want words on an image - a watermark, a title card, a label under a character sheet - and dragging it into GIMP breaks your momentum. Shima Add Font Text renders text straight onto a batch of images inside the graph, using only PIL and a TrueType font. No model, no API key, no VRAM. It's one of those little nodes you forget about until the moment you need it, and then you're glad it's there.
How it works
Under the hood it's embarrassingly simple, and that's the point. It takes your IMAGE tensor, converts each frame to a PIL image, draws your text with the font file you point it at, and converts back to a tensor. The hard work is done by the standard font rendering stack - no diffusion involved, so it's instant and deterministic.
The one thing worth knowing is how the color input behaves. You can pass a hex string like #ff0000 or an rgba(255, 255, 255, 255) string, and the node parses whichever you hand it. That's handy when you're piping a color in from another node rather than typing it.
The inputs that matter
- images - the required input, an IMAGE batch. Every image in the batch gets the text.
- text - multiline, so you can drop several lines. Defaults to "Hello World".
- font_ttf - full path to a
.ttffile. The default is picked per-platform (arial on Windows, SFNS on macOS, DejaVuSans on Linux), and it exists on all three, so it usually just works. - size - font size in pixels (2–1000).
- x / y - where the text goes. The catch: the anchor changes what x/y mean. With "Bottom Left Corner" they're the bottom-left of the text; with "Center" they're the center point. The
anchordropdown (Bottom Left Corner/Center) is the one to set before you fiddle with coordinates, or you'll chase your own tail. - rotate - 0–360 degrees, in case you want a diagonal watermark.
- color_mode - RGB or RGBA. Keep RGB unless you specifically need an alpha channel out.
The single output is IMAGE, so you can chain this before a preview, a save, or anything else downstream.
Installing it
This ships in the Shima pack. Easiest route is ComfyUI Manager - search for Shima and install. Or, in a terminal:
cd ComfyUI/custom_nodes
git clone https://github.com/KDB-USJP/shima_wf.git Shima
Restart ComfyUI. On first launch the pack auto-installs a few Python deps (openpyxl, psutil, huggingface_hub) and clones its two companion packs, ComfyUI-Impact-Pack and cg-use-everywhere - let it finish before you panic.
Common issues
The classic gotcha is a dead font path. If font_ttf points at a file that doesn't exist, text rendering fails, so always use an absolute path. Shima ships a fonts/ folder inside the extension - drop your .ttf there and reference it by full path for portability across machines.
Also remember this draws onto the existing image at full resolution, so a size of 50 on a 1024px canvas is genuinely small - it's not a percentage. For watermarks, people typically run this as the last step before save, and run the alpha-heavy configs only when they actually need a transparent PNG out. Otherwise RGB keeps things simple.
Inputs (10)
| Name | Type | Default | Description |
|---|---|---|---|
| images | IMAGE | — | |
| font_ttfopt | STRING | /usr/share/fonts/truetype/dejavu/DejaVuSans.ttf | — |
| sizeopt | INT | 502–1000 | — |
| xopt | INT | 502–10000 | — |
| yopt | INT | 502–10000 | — |
| textopt | STRING | Hello World | — |
| coloropt | STRING | rgba(255, 255, 255, 255) | — |
| anchoropt | COMBO | 2 options: Bottom Left Corner, Center | |
| rotateopt | FLOAT | 0.00–360 | — |
| color_modeopt | COMBO | 2 options: RGB, RGBA |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| IMAGE | IMAGE | — |