LayerUtility: TextImage V2
TextImage V2 — the full-featured text renderer, vertical layout included
- size_as
- image
- mask
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 optionalsize_asinput) - 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.
Inputs (15)
| Name | Type | Default | Description |
|---|---|---|---|
| text | STRING | Text | — |
| font_file | COMBO | 1 options: Alibaba-PuHuiTi-Heavy.ttf | |
| spacing | INT | 0-9999–9999 | — |
| leading | INT | 0-9999–9999 | — |
| horizontal_border | FLOAT | 5.0-100–100 | — |
| vertical_border | FLOAT | 5.0-100–100 | — |
| scale | FLOAT | 80.000.1–999 | — |
| variation_range | INT | 00–100 | — |
| variation_seed | INT | 1230–999999999999 | — |
| layout | COMBO | 2 options: horizontal, vertical | |
| width | INT | 5124–999999 | — |
| height | INT | 5124–999999 | — |
| text_color | STRING | #FFA000 | — |
| background_color | STRING | #FFFFFF | — |
| size_asopt | * | — |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| image | IMAGE | — |
| mask | MASK | — |