Nodes/comfyui-mixlab-nodes/Text Image ♾️Mixlab
ComfyUI Node Runs on cloud

Text Image ♾️Mixlab

Render text to an image, CJK and vertical layout included

By MixLabPro·Created 3 years ago·Updated 2 months ago· 1,859
Text Image ♾️Mixlab
    • image
    • mask
    text龍馬精神迎新歲
    font
    font_size100
    spacing12
    line_spacing12
    padding8
    text_color#000000
    verticaltrue
    strokefalse
    max_characters_per_line44
    fixed_width0

    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 .ttf files live in assets/fonts.
    • font_size (INT, default 100) - 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, default true) - 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.bat on 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.

    Category♾️Mixlab/Image

    Inputs (11)

    NameTypeDefaultDescription
    textSTRING龍馬精神迎新歲
    fontCOMBO4 options: 王汉宗颜楷体繁.ttf, 庞门正道粗书体6.0.ttf, 有爱黑体ARHei.ttf, 有爱黑体arheiuhk_bd.ttf
    font_sizeINT1001–10000000
    spacingINT12-2000000000–2000000000
    line_spacingINT12-2000000000–2000000000
    paddingINT80–2000000000
    text_colorSTRING#000000
    verticalBOOLEANtrue
    strokeBOOLEANfalse
    max_characters_per_lineINT441–2000000000
    fixed_widthINT00–2000000000

    Outputs (2)

    NameTypeDescription
    imageIMAGE
    maskMASK