Nodes/ComfyUI Layer Style/LayerUtility: SimpleTextImage
ComfyUI Node Runs on cloud

LayerUtility: SimpleTextImage

SimpleTextImage — render text straight onto an image, no editor needed

By chflame163·Created 3 years ago·Updated 4 days ago· 3,113
LayerUtility: SimpleTextImage
  • size_as
  • image
  • mask
â—„texttextâ–º
◄font_file▾►
◄align▾►
â—„char_per_line80â–º
â—„leading8â–º
â—„font_size72â–º
â—„text_color#FFFFFFâ–º
â—„stroke_width0â–º
â—„stroke_color#FF8000â–º
â—„x_offset0â–º
â—„y_offset0â–º
â—„width512â–º
â—„height512â–º

This is the quick way to get words onto a canvas without leaving ComfyUI: type text, pick a font and size, and out comes an image (plus a matching mask) you can composite onto anything else in your graph. Watermarks, caption plates, labeled batch outputs, placeholder title cards for a video project - anywhere you'd otherwise open Photoshop just to slap text on something, this node does it inline.

How it works

You give it text, a font_file, and a canvas size (width / height, or feed size_as an existing image to match its dimensions instead of typing numbers). The text wraps automatically based on char_per_line, with leading controlling the gap between wrapped lines, and align deciding whether each line sits left, right, or centered. font_size, text_color, and an optional stroke_width/stroke_color outline handle the look; x_offset/y_offset nudge the whole block around within the canvas if it isn't sitting where you want by default.

The font_file dropdown pulls from the pack's own bundled fonts folder - out of the box it ships with a Chinese font (the author is based in China, and it shows). Drop your own .ttf/.otf files into that folder and restart to get them showing up as options; the README documents support for pointing at extra font directories if you'd rather not touch the pack's own folder directly.

The inputs and outputs that matter

  • text - what gets rendered, multiline.
  • font_file, font_size, align - the basics most people actually touch.
  • text_color / stroke_color + stroke_width - fill color and an optional outline, useful for keeping text legible over a busy background.
  • width / height (or the optional size_as input to match another image instead) - canvas dimensions.

Outputs: image (the rendered text on its canvas) and mask (so you can composite it onto another layer through a mask-based blend instead of baking a solid background color into the result).

How to install it

Ships with LayerStyle. ComfyUI Manager: search ComfyUI Layer Style, install, restart. Manual:

cd ComfyUI/custom_nodes
git clone https://github.com/chflame163/ComfyUI_LayerStyle
pip install -r ComfyUI_LayerStyle/requirements.txt

Restart, find it under 😺dzNodes → LayerUtility. No model downloads for this one - it's font rendering, not AI.

Common issues

If your font_file dropdown only shows one option, that's expected - the pack ships with a single default font, and you need to add your own .ttf/.otf files to its fonts folder (then restart ComfyUI) to see more choices. If non-Latin characters show up as empty boxes, that's a font-coverage issue, not a bug: the font you picked simply doesn't include glyphs for that script, so swap to one that does.

The broader, pack-wide issue is the same one that hits every LayerStyle node: if SimpleTextImage is missing from your node menu entirely, the whole pack failed to import, usually from a transformers/tensorflow version conflict dragged in by another custom node pack sharing your environment - especially common on installs from before LayerStyle split into the base pack and the heavier LayerStyle Advance repo. Reinstall clean, or use Manager's "Try Fix" and actually read the traceback before assuming this specific node is broken.

Category😺dzNodes/LayerUtility

Inputs (14)

NameTypeDefaultDescription
textSTRINGtext—
font_fileCOMBO1 options: Alibaba-PuHuiTi-Heavy.ttf
alignCOMBO3 options: center, left, right
char_per_lineINT801–8096—
leadingINT80–8096—
font_sizeINT721–2500—
text_colorSTRING#FFFFFF—
stroke_widthINT00–8096—
stroke_colorSTRING#FF8000—
x_offsetINT00–8096—
y_offsetINT00–8096—
widthINT5121–8096—
heightINT5121–8096—
size_asopt*—

Outputs (2)

NameTypeDescription
imageIMAGE—
maskMASK—