Add text to image
Burn captions onto your images without hand-positioning text
- image
- image
Need to slap labels onto generated images - dataset captions, batch row names, "before/after", timestamps on a video pass? Add text to image is the node that does it in-workflow, with the one feature that actually matters: auto_adapt. It wraps long text and shrinks the font until everything fits the frame, so a paragraph that would've spilled off the bottom instead renders cleanly. Turn that off and it goes the other way - truncates with an ellipsis for fixed-size rendering.
This is the pack's image node that makes its "Text Processor" name honest. It's aimed at the boring-but-endless job of annotating outputs, which is exactly the kind of thing people used to do in a separate image editor between runs.
How it works
It's Pillow under the hood. You feed an image, give it label_text (multi-line), pick an anchor (bottom_center, top_left, center_center, and so on - seven positions), and choose background_mode:
text_box- a background rectangle sized to the text, padded bybackground_padding.full_width_strip- a bar across the whole image edge, the classic caption look.
Colors are hex strings. text_color_hex is straightforward (#ffffff); background_color_hex is where it gets clever - it accepts 8-digit hex, so #00000080 is black at 50% alpha. That's the difference between a caption that dominates the image and one that sits politely on it.
Fonts come from a collection the pack scans at load - drop .ttf/.otf files into ComfyUI/custom_nodes/ComfyUI_Text_Processor/fonts/. The default "Aileron Regular" is Pillow's built-in font, so the node works with zero font files out of the box, and if a workflow references a font your environment doesn't have, it tries to resolve a compatible one instead of just crashing.
It handles batches: one image gets the label, and if your text list is shorter than the image count, the labels loop. Output is always standard RGB so downstream video/image nodes don't choke on surprise alpha.
Inputs and outputs
The set you'll actually set: image, label_text, text_position, background_mode, font_size, and auto_adapt. min_font_size (default 8) caps how small auto-adapt is allowed to shrink before it gives up. Margin, line spacing, and padding are there when the default look isn't quite right.
One output: image - the batch with text rendered on.
Install
It ships inside ComfyUI Text Processor. Fastest path is ComfyUI Manager → search "ComfyUI Text Processor" → Install → restart. Or by hand:
cd ComfyUI/custom_nodes
git clone https://github.com/rookiestar28/ComfyUI_Text_Processor.git
pip install -r requirements.txt
No models to download; the only optional asset is fonts, and the default is fine to start.
Gotchas
If your text renders as tofu boxes (□□□), your font doesn't contain those glyphs - CJK text on the Latin default is the classic case. Drop a font that covers them into the fonts/ folder and pick it in the dropdown.
And don't fight auto_adapt when you want exact control - for a fixed badge size with precise text, disable it and let the ellipsis truncation do its thing. For everything else, leave it on; it's the reason the node exists.
Inputs (13)
| Name | Type | Default | Description |
|---|---|---|---|
| image | IMAGE | Image batch on which labels are rendered. | |
| font_name | COMBO | Aileron Regular | Font family used to render every label in the batch. |
| text_position | COMBO | bottom_center | Anchor position for the text and its background. |
| background_mode | COMBO | text_box | Draw a box around the text or a strip spanning the image width. |
| font_size | INT | 484–1024 | Initial label font size in pixels. |
| margin | INT | 240–256 | Distance in pixels between the anchored text block and image edge. |
| line_spacing | INT | 50–128 | Additional pixel spacing between wrapped text lines. |
| text_color_hex | STRING | #ffffff | Text color as #RRGGBB or #RRGGBBAA. |
| background_color_hex | STRING | #00000080 | Background color as #RRGGBB or #RRGGBBAA. |
| background_padding | INT | 100–50 | Padding in pixels between text and its background boundary. |
| auto_adapt | BOOLEAN | true | Wrap and shrink labels to fit; when disabled, truncate overflowing text. |
| min_font_size | INT | 84–128 | Minimum font size used while auto_adapt shrinks text. |
| label_textopt | STRING | Label 1 Label 2 | Labels separated by newlines; labels are assigned across the image batch. |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| image | IMAGE | Image batch with rendered text overlays. |