Nodes/Comfyui_PDuse/PD_Add Label
ComfyUI Node

PD_Add Label

A caption bar that never touches a single pixel of your image

By 7BEII·Created 2 years ago·Updated 15 days ago· 53
PD_Add Label
  • image
  • IMAGE
enable_resizefalse
longer_size1024
text_x50
text_y50
height90
font_size40
font
textText
colorlight
directiondown
caption

PD_Add Label (class CustomAddLabel) appends a solid-color label strip to any edge of an image and types your text into it. The selling point is in the node's own description: the original pixels stay 100% intact. It doesn't composite over your render, it doesn't burn a caption into a corner of the art - it stitches a fresh band of canvas onto the side and leaves the picture alone. That's why I reach for it when I want labels that don't fight the image: before/after pairs, batch outputs with the prompt baked under them, version tags on a contact sheet.

How it works

The mechanism is blunt and reliable. The node builds an RGB canvas the width of your image (or the height, if you're labeling left/right), sized by height (1–1000, default 90), draws your text on it with a TrueType font, and concatenates it to the image tensor. No alpha blending over the art, no in-place drawing - literally torch.cat on the edge. The image's own pixels are never read back into the label, which is the whole trick and why "keeps original pixels 100% intact" isn't marketing.

Text placement inside the band uses text_x and text_y, both 1–100 percentages where 50 is centered. The direction dropdown (up/down/left/right) picks the edge, and color flips between light (white band, black text) and dark (black band, white text). enable_resize + longer_size optionally cap the longest edge before labeling, which is handy if you're building a uniform sheet from mixed-size inputs.

The inputs that matter

  • direction - where the band goes. The one you'll actually flip.
  • text - what gets drawn. Single string; if you're processing a batch and want a different label per image, the optional caption input takes one line per frame, which is a genuinely thoughtful touch for batch labeling.
  • font_size (8–200) and height - the band's thickness and how big the type is. They interact, so expect to tune both.
  • font - picked from whatever .ttf/.otf files sit in the pack's fonts/ folder.

Output is a single IMAGE, straight into Save Image or a Preview node.

Installing

This is one node from the 7BEII/Comfyui_PDuse pack. Easiest path is ComfyUI Manager → Custom Nodes Manager → search "Comfyui_PDuse" → Install → restart. Or, by hand:

cd ComfyUI/custom_nodes
git clone https://github.com/7BEII/Comfyui_PDuse
cd Comfyui_PDuse
pip install -r requirements.txt

No models to download. The pack's requirements.txt is light (Pillow, numpy, opencv-python and friends - torch comes from ComfyUI itself), and its loader imports each node module defensively, so a bad module prints an error instead of taking down ComfyUI.

Where people get burned

Almost every "my label looks like garbage" report traces back to the font. The shipped font list is half CJK faces (Source Han Sans, Alibaba PuHuiTi, HYQiHei) for a reason - if your text has Chinese characters and the selected font can't render them, or the font file is missing, the node falls back to PIL's tiny default bitmap font and you get a cramped, aliased strip. Drop your own .ttf/.otf into Comfyui_PDuse/fonts/ and pick it in the dropdown. Also: text_x/text_y are percentages, not pixels - a value like text_y=100 pushes the text to the far edge of the band, which is easy to misread as "off-screen" the first time.

CategoryPDuse/Image

Inputs (12)

NameTypeDefaultDescription
imageIMAGE
enable_resizeBOOLEANfalse
longer_sizeINT10241–99999
text_xINT501–100
text_yINT501–100
heightINT901–1000
font_sizeINT408–200
fontCOMBO9 options: Oswald-Bold.ttf, Caveat-VariableFont_wght.ttf, HYQiHei-105JF.otf, Alibaba-PuHuiTi-Heavy.ttf, SOURCEHANSANSCN-MEDIUM.OTF, sign_Caveat-VariableFont_wght.ttf, +3
textSTRINGText
colorCOMBOlight2 options: light, dark
directionCOMBOdown4 options: up, down, left, right
captionoptSTRING

Outputs (1)

NameTypeDescription
IMAGEIMAGE