Nodes/ComfyUI-PIL/PIL TITLE (Mexx)
ComfyUI Node

PIL TITLE (Mexx)

Add a comic-style title strip to an image without leaving ComfyUI

By SoftMeng·Created 2 years ago·Updated 2 years ago· 7
PIL TITLE (Mexx)
  • image
  • result_img
image_filter留白
padding_height100
font_size60
font_nameYangRenDongZhuShiTi-Light-2.ttf
write_text画画的Baby

PIL TITLE (Mexx) does one very specific thing: it grows a white band along the top of your image and writes a caption into it. That's it. If you make comics, manga-style pages, posters, or the kind of meme where a picture needs a title bar, this saves you the tab over to an image editor. If you don't, you'll probably never touch it - it's a purpose-built utility, not a general text node.

It's part of the small SoftMeng/ComfyUI-PIL pack (same author as the well-known ComfyUI-DeepCache-Fix, but this is a minor side project with basically no community footprint). The README lists it as "增加留白" - add whitespace - and that's the honest description. It's the sibling of PIL Effects (Mexx), which does the line-art and filter work; this one is strictly the title-strip job.

How it works

Under the hood it's a few lines of Pillow: create a new canvas img_width × img_height + padding_height, paste your image at the bottom, then draw your text centered in the new band at the top, in black, using one of the bundled fonts. Because it's in the same batch-safe wrapper as the rest of the pack, each frame of a batched image gets its own title band.

Inputs that matter

  • image - the IMAGE tensor you're captioning.
  • image_filter - dropdown with just NO and 留白 (whitespace). Leave it on 留白.
  • padding_height - the height of the white band, default 100. This is the dial you'll actually turn: more room for bigger titles.
  • font_size - text size, default 60.
  • font_name - five Chinese fonts shipped inside the pack (the default is YangRenDongZhuShiTi-Light-2). They handle Latin text fine, but the aesthetic is firmly Chinese poster/comic, which is exactly the use case.
  • write_text - your caption. Multiline. The default is the Chinese string "画画的Baby" ("Baby who draws") - if you leave it alone, that's what lands on your image, so change it.

The output is a single result_img IMAGE at the new height, ready to feed a save node or the next step of the graph.

Install

cd ComfyUI/custom_nodes
git clone https://github.com/SoftMeng/ComfyUI-PIL

Then restart ComfyUI. Or search "ComfyUI-PIL" in ComfyUI Manager. No requirements.txt and no models to download - only Pillow and numpy, both already in ComfyUI. The one cost is that the git clone pulls the five .ttf files, roughly 55 MB total.

Gotchas

The band only goes on top - there's no option for a bottom or side caption, so if you want it elsewhere, flip the image first and flip back. The default text and font are Chinese; the bundled fonts render Latin characters but they're display fonts, so long English strings can look off. And the text is always black on white - no color, no outline, no position control. It's a narrow tool, but for manga page titles it's the fastest route from "generated panel" to "looks like a page."

CategoryComfyUI_Mexx

Inputs (6)

NameTypeDefaultDescription
imageIMAGE
image_filterCOMBO留白2 options: NO, 留白
padding_heightINT100
font_sizeINT60
font_nameCOMBOYangRenDongZhuShiTi-Light-2.ttf5 options: YangRenDongZhuShiTi-Light-2.ttf, JinNianYeYaoJiaYouYa-2.ttf, CEFFontsCJKMono-Regular.ttf, 庞门正道粗书体6.0.ttf, 白路飞云手写体.ttf
write_textSTRING画画的Baby

Outputs (1)

NameTypeDescription
result_imgIMAGE