RM Add Label
Stamp a label on your batch without installing a whole other pack
- image
- image
Ever built a contact sheet and wished each row said which seed, CFG, or checkpoint it was? That's what this node is for. It's a text-label node: it renders a caption and either attaches it as a bar above, below, left, or right of your image, or draws it straight onto the pixels. Unremarkable on paper, genuinely handy in practice - and it exists because the author got tired of installing an entire node suite for one label node.
This is a KJNodes replacement. The source comments say so outright: RM Add Label replaces the single label node the author used from KJNodes so that pack no longer has to be installed. Widget names even match the original (text, direction, height, font_size, text_x, text_y, …) so an old workflow rewires without you redoing anything.
What you actually set
The inputs that matter are few:
- text (multiline) - the caption.
- direction -
up,down,left,right, oroverlay. Anything exceptoverlaygrows the image by the label bar;overlaydraws on top and keeps your dimensions. That bit surprises people: connect it in the middle of a pipeline and your output gets taller or wider. - height - bar thickness in pixels. The trick:
-1auto-sizes the bar to fit the wrapped text, which is what you want when the caption length varies. - font, font_size, font_color, label_color, text_x, text_y - cosmetics. Colors accept CSS names (
white,black), hex (#RRGGBB), or comma-separated channels. - caption (optional) - the one worth wiring up. Connect a string source and every image in a batch gets its own caption, one per image. Leave it empty and the
textwidget applies to the whole batch. That's the killer feature: label a 20-image batch of CFG sweep results and know which is which at a glance.
Output is a single image - the annotated tensor, ready to feed a save or preview node.
How it works under the hood
It's PIL drawing with a tensor shuffle. Text is word-wrapped to the image width (or height, for side bars), rendered on a solid bar, and concatenated with torch.cat. The author's source notes one deliberate fix over the original: left/right actually work here. The old KJNodes version rendered the bar at the image's width and then rotated on the wrong tensor axes, which only produced correct vertical labels on square images. This one renders the bar along the image height and rotates on the right axes, so side labels are correct at any aspect ratio.
Fonts come from the pack's fonts/ folder first, then your system font directory. The pack ships none, so a clean install just uses whatever's on your OS - on Linux that means the /usr/share/fonts names show up in the dropdown.
Installing it
Same as any node in this pack:
cd ComfyUI/custom_nodes
git clone https://github.com/Moser9815/ComfyUI-RMAutomation
Then restart ComfyUI. Or use ComfyUI Manager: search for RMAutomation and hit install. No model downloads - this node needs nothing beyond the Pillow/torch that ComfyUI already ships. (The pack's requirements.txt does list opencv-python, ultralytics, and friends, but those are lazy-imported by other nodes in the suite - face detection, video encoding - so a plain label node never touches them.)
Where people get burned
The most likely hiccup is the font dropdown showing <no fonts found>. That's the pack's fallback when neither its own fonts/ folder nor the OS font directories yield anything it can list. Drop a .ttf into ComfyUI/custom_nodes/ComfyUI-RMAutomation/fonts/ and it appears. If you ignore it, text still renders - it falls back to PIL's built-in bitmap font, which is legible but not pretty.
Second: if you wire caption with a batch, the count must match - one caption per image. A mismatch throws a clear error telling you exactly that. And remember, side/up/down bars change output dimensions; if you're feeding the result into something downstream that expects the original size, use overlay.
It's a small node with a small job, but once you've got a workflow that churns out 50 labeled previews a day, it quietly becomes one of the most-used things in the pack. The self-contained replacement angle is the real win: one less heavyweight pack in your custom_nodes folder.
Inputs (11)
| Name | Type | Default | Description |
|---|---|---|---|
| image | IMAGE | — | |
| text | STRING | Text | — |
| direction | COMBO | up | 5 options: up, down, left, right, overlay |
| height | INT | 48-1–4096 | — |
| font | COMBO | 1 options: <no fonts found> | |
| font_size | INT | 321–4096 | — |
| font_color | STRING | white | — |
| label_color | STRING | black | — |
| text_x | INT | 100–4096 | — |
| text_y | INT | 20–4096 | — |
| captionopt | STRING | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| image | IMAGE | — |