ComfyUI Node

Text2Image _O

Render real text into an image for ControlNet

By omar92·Created 4 years ago·Updated 6 months ago· 179
Text2Image _O
    • IMAGE
    ◄text—►
    ◄fontCALIBRI.TTF►
    ◄size36►
    ◄font_R0►
    ◄font_G0►
    ◄font_B0►
    ◄font_A255►
    ◄background_R255►
    ◄background_G255►
    ◄background_B255►
    ◄background_A255►
    ◄width128►
    ◄height128►
    ◄expandtrue►
    ◄x0►
    ◄y0►

    Diffusion models are famously bad at spelling. The trick that actually works is to stop asking the model to write text and instead give it text to look at: render the word on a canvas, feed that as a ControlNet condition, and let the model regenerate the scene while honoring the letter shapes. Text2Image _O is the renderer half of that trick - it takes a string and draws it onto a canvas, outputting a proper IMAGE tensor.

    It's under O/text in the Quality of Life Suit. The ControlNet knowledge base essay calls out this exact pattern - embedding patterns like text, logos, and barcodes via spatial conditioning - and this node is one of the easiest ways to produce the text plate for it. Beyond ControlNet, it's handy for quick watermarks, title cards, or feeding a text mask into an inpainting workflow.

    How it works

    Under the hood it's PIL: the text is drawn with ImageFont.truetype and ImageDraw, then converted to a normalized float tensor (/255) and shaped into an IMAGE. The canvas dimensions are enforced to a multiple of 8, which keeps the output latent-friendly if you route it toward a sampler.

    The inputs that matter

    • text - the string to draw (multiline).
    • font - a dropdown of the fonts in the pack's fonts/ folder. Ships with Calibri, Comic Sans (regular/italic/bold), and Alkatra. To add your own, drop a .ttf, .otf, or .ttc into custom_nodes/ComfyUI-QualityOfLifeSuit_Omar92/fonts/ and restart ComfyUI - it appears in the dropdown automatically.
    • size - font size in points (0–255, default 36).
    • font_R/G/B/A and background_R/G/B/A - RGBA colors, each channel 0–255. Default black text on white.
    • width / height - canvas size in pixels (defaults 128×128).
    • expand - true (default) auto-grows the canvas to fit the text; false keeps your canvas and clips.
    • x / y - where the text lands. The node centers the text on (x, y) and clamps it to stay on-canvas, so these behave like a "focus point" rather than a raw top-left coordinate.

    Output: one IMAGE.

    Installing

    cd ComfyUI/custom_nodes
    git clone https://github.com/omar92/ComfyUI-QualityOfLifeSuit_Omar92.git
    

    or ComfyUI Manager → search ComfyUI-QualityOfLifeSuit_Omar92, then restart. The fonts ship with the pack; no model downloads.

    Gotchas and honest advice

    • Keep expand on unless you have a specific canvas in mind; a text string longer than the canvas silently gets clamped (the draw position is pushed back on-canvas, so the tail can get cut off).
    • The output is a flat text plate - it works best as a ControlNet/inpaint seed, not as "generated text." For truly embedded text in a scene, pair it with a ControlNet and let img2img/denoise do the blending. If you skip ControlNet and just feed the plate to a sampler at high denoise, the model will mostly ignore it. That's the one mistake people make here: they expect the plate itself to be the final image, and it isn't.
    CategoryO/text

    Inputs (16)

    NameTypeDefaultDescription
    textSTRING—
    fontCOMBOCALIBRI.TTF5 options: CALIBRI.TTF, COMICZ.TTF, Alkatra.ttf, COMICI.TTF, COMIC.TTF
    sizeINT360–255—
    font_RINT00–255—
    font_GINT00–255—
    font_BINT00–255—
    font_AINT2550–255—
    background_RINT2550–255—
    background_GINT2550–255—
    background_BINT2550–255—
    background_AINT2550–255—
    widthINT128—
    heightINT128—
    expandCOMBOtrue2 options: true, false
    xINT0—
    yINT0—

    Outputs (1)

    NameTypeDescription
    IMAGEIMAGE—