Nodes/ComfyUI_EmojiOverlay/Image Emoji Overlay
ComfyUI Node

Image Emoji Overlay

Stamping emoji onto ComfyUI images (and the two bugs hiding in this tiny node)

By chandlergis·Created 2 years ago·Updated 2 years ago· 0
Image Emoji Overlay
  • image
  • IMAGE
textHello 😊
font_size16
x0
y0
fontarial.ttf
alignmentleft
color0

ComfyUI_EmojiOverlay is about as small a custom node as you'll find: one class, one file, one job. It takes an image and stamps an emoji - or really, any text - onto it, all inside the graph. No model downloads, no API keys, no GPU load. You feed it an image, type Hello 😊, pick a spot, and you get the same image back with a little message on it. That's the whole pitch.

Honestly, for most people the fastest way to put text on an image is still an editor. Where this node earns its keep is determinism: if you want every output of a batch render watermarked, or every frame of a video pass stamped with a label, doing it inside the workflow means it happens automatically, every time, without you touching Photoshop. It lives in the image/text category, so you wire it between your VAE decode (or Load Image) and your Preview/Save node.

How it works

The mechanism is refreshingly un-magical. The node converts your IMAGE tensor to a PIL image, splits your text on spaces, and handles each chunk two ways:

  • If a chunk contains one of the hardcoded emoji characters - and the source only recognizes 😊😂❤️👍 - it renders that chunk as an SVG and rasterizes it with cairosvg, then pastes the result onto the image.
  • Everything else gets drawn directly with Pillow's ImageDraw in your chosen color.

The alignment input just shifts the starting x-coordinate: center subtracts half the text width, right subtracts the full width, so your block ends up anchored where you expect. Output is a single IMAGE tensor, same dimensions as what went in - pipe it to a Save Image or Preview node and you're done.

The inputs that matter

  • text - multiline string, defaults to "Hello 😊". What gets stamped.
  • x / y - top-left position in pixels. The two you'll fiddle with the most.
  • color - an integer 0–16777215 rendered as a color picker. Heads up: it only colors the plain-text parts.
  • font_size - 1 to 256, default 16. Emojis render at roughly this size too.
  • font - a path to a .ttf/.otf file, default arial.ttf. More on this below.
  • alignment - left / center / right.

Installing it

The README is literally one line of Chinese: "A node for inserting emoji in ComfyUI." That's it - no install instructions, no license, no requirements.txt, and only one commit since June 2024. So:

cd ComfyUI/custom_nodes
git clone https://github.com/chandlergis/ComfyUI_EmojiOverlay

ComfyUI Manager can find it too (search "EmojiOverlay"), but Manager won't install its dependencies because the pack doesn't ship a requirements.txt. The node imports cairosvg at the top of the file, so until that package is in your Python environment the whole pack fails to load.

pip install cairosvg

Make sure that lands in the same Python that runs ComfyUI - if you use a venv or a portable build, install into that one, not your system Python.

Where it bites

This is a hobby-project node, and it shows. Three things will trip you up:

  • It's broken on modern ComfyUI. The source calls draw.textsize(), which Pillow removed in version 10. Current ComfyUI installs ship Pillow 10+, so the node loads fine and then crashes on run with AttributeError: 'ImageDraw' object has no attribute 'textsize'. This is not you doing something wrong. The fix, if you want it, is to edit the two textsize calls in image_emoji_overlay.py to use textbbox instead - or just accept that a one-line-README node from 2024 needs a patch to run in 2026.
  • Emoji coverage is tiny. Only 😊😂❤️👍 trigger the special emoji path. Anything else - say, 🎉 or 🔥 - falls through to the text renderer and shows up as a monochrome outline or a tofu box, depending on your font. And the color picker doesn't apply to emojis at all; they come out in whatever the font draws.
  • arial.ttf is Windows-centric. On Linux or macOS that path won't exist. Give the node a real font file path, e.g. /usr/share/fonts/truetype/dejavu/DejaVuSans.ttf.

One more footnote: the node squeezes the batch down to its first frame, so if you feed it a batch of images, only the first one gets the overlay. Feed it single images and it behaves.

Worth installing? If you just need emoji on a picture, no - edit it and move on. If you want reproducible in-graph watermark stamping and don't mind patching one file, it's a fun little 60-liner. Just go in knowing the dependency story and the Pillow issue are on you.

Categoryimage/text

Inputs (8)

NameTypeDefaultDescription
imageIMAGE
textSTRINGHello 😊
font_sizeINT161–256
xINT0
yINT0
fontSTRINGarial.ttf
alignmentCOMBOleft3 options: left, right, center
colorINT00–16777215

Outputs (1)

NameTypeDescription
IMAGEIMAGE