Nodes/ComfyUI Layer Style/LayerUtility: TextImage V2
ComfyUI Node Runs on cloud

LayerUtility: TextImage V2

TextImage V2 — the full-featured text renderer, vertical layout included

By chflame163·Created 3 years ago·Updated 4 days ago· 3,113
LayerUtility: TextImage V2
  • size_as
  • image
  • mask
â—„textTextâ–º
◄font_file▾►
â—„spacing0â–º
â—„leading0â–º
â—„horizontal_border5.0â–º
â—„vertical_border5.0â–º
â—„scale80.00â–º
â—„variation_range0â–º
â—„variation_seed123â–º
◄layout▾►
â—„width512â–º
â—„height512â–º
â—„text_color#FFA000â–º
â—„background_color#FFFFFFâ–º

This is the grown-up sibling of SimpleTextImage - same basic idea (turn a string into a rendered image plus a mask) but with actual typography controls: letter spacing, line leading, padding as a percentage of the canvas rather than fixed pixels, and - the one SimpleTextImage doesn't have at all - vertical text layout, which matters if you're setting Chinese or Japanese text the traditional top-to-bottom way. If SimpleTextImage felt too basic for what you're building, this is the one to reach for.

How it works

text goes in, font_file picks the typeface, and layout chooses between horizontal and vertical rendering. spacing and leading control letter and line gaps respectively, while horizontal_border/vertical_border set padding as a percentage of the canvas rather than a raw pixel count - so the padding scales sensibly if you change width/height (or feed size_as another image to match its dimensions) instead of staying a fixed number of pixels that looks wrong at a different size. scale sizes the whole text block within that canvas.

variation_range and variation_seed add a bit of controlled jitter to the rendering - crank variation_range up for a looser, more organic-looking layout instead of perfectly uniform type, and lock variation_seed once you land on a look you like so it stops reshuffling on every regenerate.

The inputs and outputs that matter

  • text, font_file, layout - the core: what to render, in what font, horizontal or vertical.
  • text_color / background_color - fill and canvas color.
  • width / height (or the optional size_as input) - canvas size.

Outputs: image (the rendered text) and mask, exactly like SimpleTextImage - wire the mask into a compositing/blend node if you want to drop this text onto another layer cleanly rather than pasting a solid rectangle over it.

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 - this is font rendering, not an AI model.

Common issues

Vertical layout is the thing most people trip over simply because they don't know it's there - if your text is coming out sideways or cramped when you expected a normal horizontal line, check the layout dropdown before assuming something's broken. If the padding looks off after you resize the canvas, remember horizontal_border/vertical_border are percentages, not pixels, so they should actually scale with you - if they don't seem to be scaling as expected, double check you're not also manually offsetting position elsewhere in the graph.

As with every node in this pack: if TextImage V2 is missing from your node menu entirely, LayerStyle failed to import as a whole, not this node specifically. The usual culprit is a transformers/tensorflow conflict dragged in by another custom node pack, and it's 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 read the traceback before assuming this specific node is the problem.

Category😺dzNodes/LayerUtility

Inputs (15)

NameTypeDefaultDescription
textSTRINGText—
font_fileCOMBO1 options: Alibaba-PuHuiTi-Heavy.ttf
spacingINT0-9999–9999—
leadingINT0-9999–9999—
horizontal_borderFLOAT5.0-100–100—
vertical_borderFLOAT5.0-100–100—
scaleFLOAT80.000.1–999—
variation_rangeINT00–100—
variation_seedINT1230–999999999999—
layoutCOMBO2 options: horizontal, vertical
widthINT5124–999999—
heightINT5124–999999—
text_colorSTRING#FFA000—
background_colorSTRING#FFFFFF—
size_asopt*—

Outputs (2)

NameTypeDescription
imageIMAGE—
maskMASK—