Text Image ♾️Mixlab
Render text to an image, CJK and vertical layout included
- image
- mask
Text Image renders a block of text into an actual image - with a chosen font, size, color, spacing, the works - and hands you both the rendered image and a mask of the letterforms. It's the node you reach for when you need real, legible type in your output: a caption, a title card, a watermark, a poster layout, or text you'll composite over a generated scene. Diffusion models are famously bad at spelling; this sidesteps that entirely by drawing the text with an actual font engine instead of hoping the model gets the letters right.
The standout feature, and the reason it shows up in a lot of Chinese-community workflows, is proper CJK and vertical text support. The defaults are Chinese (the sample text and the bundled fonts are), and vertical is on by default - so it does traditional top-to-bottom column layout out of the box, which most Western text nodes can't do. If you're doing anything with Chinese/Japanese typography or a vertical-text poster, this is genuinely one of the better options in ComfyUI.
How it works
It's a PIL/Pillow text renderer wrapped as a node. You supply the string and a pile of typography controls, it lays the text out on a canvas and rasterizes it with the selected TrueType font. The letterforms also come out as a mask, so you can use the text as a stencil - tint it, fill it with an image, feather it, or composite it precisely.
The one thing you must do first: fonts. The node draws with .ttf files it finds in the pack's assets/fonts folder, and you pick from those in the font dropdown.
Inputs and outputs
There are a lot of knobs, but the ones a beginner actually touches:
text(STRING, multiline) - what to render.font(enum) - which bundled TrueType font to use. The choices are whatever.ttffiles live inassets/fonts.font_size(INT, default100) - size in points.text_color(STRING, default#000000) - hex color of the text. Pair it with a Color node if you want a picker.vertical(BOOLEAN, defaulttrue) - column (vertical) layout on, or flip it off for normal horizontal lines.
The rest fine-tune the layout: spacing, line_spacing, padding, stroke (outline the glyphs), max_characters_per_line (wrap width), and fixed_width (force a canvas width).
Outputs: image (IMAGE, the rendered text) and mask (MASK, the glyph shapes). Composite the image, or use the mask as a stencil over something else.
How to install it
Ships with the Mixlab pack.
- ComfyUI Manager: search
comfyui-mixlab-nodes, install, restart. - Manual:
cd ComfyUI/custom_nodes && git clone https://github.com/shadowcz007/comfyui-mixlab-nodes.git, install requirements (install.baton Windows or../../../python_embeded/python.exe -s -m pip install -r requirements.txt), restart.
Common issues
Tofu boxes / missing glyphs / empty font list: this is the big one. The node can only draw with fonts present in custom_nodes/comfyui-mixlab-nodes/assets/fonts. If the dropdown is empty or your characters render as squares, the font that covers them isn't installed. The maintainer links a font source to download from; drop the .ttf files into that fonts folder and restart. For Latin text you'll want a Latin font there; for CJK, a font with the right glyph coverage.
Text renders horizontally when I wanted vertical (or vice-versa): vertical defaults to true (columns). Flip it for normal left-to-right lines.
Text overflows or wraps weirdly: tune max_characters_per_line for wrap width and fixed_width if you need a specific canvas size. Increase padding if letters are getting clipped at the edges.
Color didn't apply: text_color wants a hex string like #FF0000. A bare name or malformed value won't parse cleanly.
Inputs (11)
| Name | Type | Default | Description |
|---|---|---|---|
| text | STRING | 龍馬精神迎新歲 | — |
| font | COMBO | 4 options: 王汉宗颜楷体繁.ttf, 庞门正道粗书体6.0.ttf, 有爱黑体ARHei.ttf, 有爱黑体arheiuhk_bd.ttf | |
| font_size | INT | 1001–10000000 | — |
| spacing | INT | 12-2000000000–2000000000 | — |
| line_spacing | INT | 12-2000000000–2000000000 | — |
| padding | INT | 80–2000000000 | — |
| text_color | STRING | #000000 | — |
| vertical | BOOLEAN | true | — |
| stroke | BOOLEAN | false | — |
| max_characters_per_line | INT | 441–2000000000 | — |
| fixed_width | INT | 00–2000000000 | — |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| image | IMAGE | — |
| mask | MASK | — |