Nodes/Allor Plugin/ImageTextMultiline
ComfyUI Node

ImageTextMultiline

Captions and subtitle blocks that wrap in the graph

By Nourepide·Created 3 years ago·Updated 2 years ago· 295
ImageTextMultiline
    • IMAGE
    text
    font
    align
    size28
    red255
    green255
    blue255
    alpha1.00
    margin_x0
    margin_y0

    The moment your text has a second line, Allor's plain ImageText node is the wrong tool. ImageTextMultiline is the one that takes a real multi-line string, renders it onto a transparent canvas sized to the whole block, and - the part people actually care about - gives you an align control so your caption is left-aligned, centered, or right-aligned. Subtitles, title cards, quote blocks, label dumps: this is the node.

    It's part of the Allor Plugin (Nourepide/ComfyUI-Allor), the pack that keeps everything in RGBA. The output is a transparent text layer you composite over an image or video frame, which makes it the workhorse for burned-in captions in frame-by-frame work.

    How it works

    Like the rest of the text family it's PIL drawing, but with the multiline path: it measures the whole block with multiline_textbbox so the canvas is sized to all the lines (plus margins), then draws with the alignment you chose. align is a three-way toggle - left, center, right - applied per line within the block, which is what you don't get from the single-line nodes. Implementation-wise, ImageTextMultiline is a wrapper that calls ImageTextMultilineOutlined with outline_size 0, same pattern as the single-line pair.

    Text is a genuine multiline field (toggle the input), so you type your lines directly with Enter between them. Fonts come from the pack's fonts folder (default ComfyUI/comfy_extras/fonts, plus optional system/user folders via config.json).

    Inputs and outputs

    • text (STRING, multiline) - your lines, Enter-separated.
    • font - dropdown of fonts in the fonts folder.
    • align - left / center / right, the block alignment.
    • size (INT, default 28) - font size.
    • red/green/blue (default 255) - text color, white by default.
    • alpha (FLOAT, default 1.0) - layer opacity.
    • margin_x/margin_y (INT, default 0) - padding around the whole block.

    Output is a single RGBA IMAGE sized to the text block. Composite it over your image to finish - it will not be image-sized on its own.

    Installing it

    ComfyUI Manager → search "Allor Plugin" → install → restart. Manual route:

    cd ComfyUI/custom_nodes
    git clone https://github.com/Nourepide/ComfyUI-Allor
    

    Then drop a .ttf/.otf into ComfyUI/comfy_extras/fonts and reload so the font dropdown has anything in it.

    Where people get burned

    The two usual surprises: an empty font dropdown (nothing in the fonts folder yet), and expecting the output to match your image dimensions - it matches your text dimensions, so always composite rather than save directly. Also, alignment only applies within the block: there's no "center this block on a 1024-wide image" option here, so if you want the whole block centered on a canvas, center it yourself in the composite step. And since this has no outline, on bright images the text can vanish - if that happens, swap to the ImageTextMultilineOutlined variant.

    Categoryimage/draw

    Inputs (10)

    NameTypeDefaultDescription
    textSTRING
    fontCOMBO0 options:
    alignCOMBO3 options: left, center, right
    sizeINT28
    redINT255
    greenINT255
    blueINT255
    alphaFLOAT1.00
    margin_xINT0
    margin_yINT0

    Outputs (1)

    NameTypeDescription
    IMAGEIMAGE