ComfyUI Node

DP Words

Render a proper line of text as an image, kerning and all

By DesertPixelAi·Created 2 years ago·Updated about a year ago· 25
DP Words
    • image
    • font_name
    • info
    font_selection_modeOff
    image_width1024
    image_height256
    font_name
    font_weight
    kerning0
    leading0
    padding_top20
    padding_bottom20
    padding_left20
    padding_right20
    alignCenter
    textWELCOME

    No diffusion here - this is a straight typography node. Give it a line (or a block) of text and it draws it onto a canvas with a real font, real letter- and line-spacing controls, and proper alignment, then hands you back an IMAGE. Useful for title cards, lower-thirds, overlay text on a render, or bumper graphics you're compositing into a video reel, without needing a separate image editor for something this simple.

    It's in the pack's text tools, and its default text - "WELCOME" - is a good hint at what it's built for: short, clean, deliberate text, not paragraphs.

    How it works

    image_width/image_height (64–2048 by 32–1024) set the canvas, and align (Left/Center/Right) positions the text within it, with padding_top/bottom/left/right (0–200 each) keeping it off the edges. font_name picks from a fixed set of 17 system fonts baked into the node - DejaVu Sans, Nimbus Roman, Noto Sans Mono, and the rest of that familiar Linux/GhostScript font family set - so there's nothing to download; font_weight narrows it to bold, light, medium, or regular where the chosen font supports it.

    kerning (−10 to 20) and leading (−100 to 100) are the actual typesetting controls: kerning nudges letter-spacing, leading nudges line-spacing for multi-line text. font_selection_mode is worth knowing about before you fight it - leave it Off and font_name is exactly what you picked; set it to Cycle or Random and the node ignores your literal font choice, instead stepping through or randomly picking from its font list on every run. That's genuinely useful if you're batch-generating a set of title cards and want visual variety without manually swapping the font each time - just don't set it expecting your chosen font to stick.

    Three outputs: image (the rendered text), font_name (STRING - which font actually got used, which matters once you're on Cycle/Random and want to log or label the result), and info (STRING - a summary, handy if the layout doesn't look right and you want to see what the node thinks it did).

    The inputs and outputs that matter

    text is obviously the one you're here for. image_width/image_height set your canvas up front. If you're just dropping in a single word or short title, align and kerning are usually the only styling beyond the font you'll actually touch. Wire image into a compositor, a save node, or a video assembler.

    How to install it

    ComfyUI Manager: search Desert Pixel, install, restart. Manual:

    cd ComfyUI/custom_nodes
    git clone https://github.com/DesertPixelAi/ComfyUI-Desert-Pixel-Nodes
    

    Restart ComfyUI. It renders with fonts bundled in the node itself, so nothing to download. Under the DP category.

    Common issues & troubleshooting

    Text is getting cut off or running past the canvas edge. This isn't auto-fit - image_width/image_height is a fixed canvas, and a long string at a big size on a small canvas will overflow. Either trim the text, drop to a slimmer font weight, or size the canvas for what you're actually going to type.

    The font isn't the brand/custom font I wanted. This draws only from its own bundled 17-font list, not anything else installed on your system. If you need a specific external font, this node can't reach it - you'd need a different text-rendering approach for that.

    font_name output doesn't match what I set in the widget. Expected if font_selection_mode is Cycle or Random - those override your literal font_name pick each run, and the output tells you which font actually landed, not what the widget still shows.

    Not sure this is the right DP text node. This pack also has DP Big Letters, which does a related but different job - Big Letters is built around single-word, letter-by-letter reveal animations (a cycler mode driven by an index), while Words is the more conventional, kerning/leading-aware static text block. Want an animated per-letter reveal, use Big Letters; want a properly laid-out still text image, use this one.

    CategoryDP/Text

    Inputs (13)

    NameTypeDefaultDescription
    font_selection_modeCOMBOOff3 options: Off, Cycle, Random
    image_widthINT102464–2048
    image_heightINT25632–1024
    font_nameCOMBO17 options: C059, D050000L, DejaVu Sans, DejaVu Sans Mono, DejaVu Serif, Droid Sans Fallback, +11
    font_weightCOMBO4 options: bold, light, medium, regular
    kerningINT0-10–20
    leadingINT0-100–100
    padding_topINT200–200
    padding_bottomINT200–200
    padding_leftINT200–200
    padding_rightINT200–200
    alignCOMBOCenter3 options: Left, Center, Right
    textSTRINGWELCOME

    Outputs (3)

    NameTypeDescription
    imageIMAGE
    font_nameSTRING
    infoSTRING