ComfyUI Node

string2Image _O

Render text to an image, the old way

By omar92·Created 3 years ago·Updated 5 months ago· 181
string2Image _O
  • string
  • IMAGE
fontCALIBRI.TTF
size36
font_R0
font_G0
font_B0
background_R255
background_G255
background_B255

string2Image _O turns a piece of text into an image - it renders your string onto a canvas with a chosen font, size, and colours, and outputs it as an IMAGE you can wire into the rest of the graph. The trick that makes that interesting: an image of text can feed ControlNet (like a depth or line-art preprocessor) to place styled text into a generated image. Text-to-image, but with the text as pixels first.

Before you get excited, the honest headline: this is the deprecated version. It's the pre-merge implementation, tucked in O/deprecated/string of the Quality of Life Suit pack, using the legacy STR input type and a fixed, text-mask-sized canvas. The pack's modern replacement - Text2Image _O under O/text - takes native STRING, gives you a proper canvas (width, height, expand, x, y) plus RGBA control over font and background. If you're building anything new, use that one.

How it works

The source does the straightforward Pillow thing: it loads a font from the pack's fonts/ folder, measures your text, creates an RGBA image sized to the text's bounding box, fills it with the background colour, and pastes the glyphs in the font colour. Output is an IMAGE tensor.

Inputs:

  • string (STR) - the text, in the deprecated dict-wrapped type (so it must come from a legacy String _O node, not a modern one).
  • font (STRING) - the font file name from the pack's fonts/ folder, default CALIBRI.TTF.
  • size (INT) - font size, default 36.
  • font_R / font_G / font_B - font colour, each 0–255 (defaults: black).
  • background_R / background_G / background_B - background colour, 0–255 (defaults: white).

One output: IMAGE.

Notice what's not there: no width, height, or position controls. The image is exactly as big as the rendered text - fine for a ControlNet text pass, awkward if you wanted a specific canvas.

Where it fits

The one genuinely good use is the ControlNet route: render your text to an image, run it through a preprocessor, and condition a generation on it so the model writes the text into the scene the way you asked. That workflow is still valid with this node. But given the STR input requirement and the missing canvas controls, Text2Image _O is strictly better for the same job - and it's the one the README actually documents. Consider this node only for keeping an old workflow alive.

Installing it

Part of the Quality of Life Suit pack (omar92/ComfyUI-QualityOfLifeSuit_Omar92). Install via ComfyUI Manager (search "Quality of Life Suit") or clone:

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

Restart ComfyUI properly. No models to download - the fonts ship with the pack (Calibri, Comic Sans, Alkatra, and friends; drop extra .ttf/.otf/.ttc files into the fonts/ folder and restart to add more).

Common issues

  • "The wire won't connect from a normal text node." STR vs STRING again. Feed it from the legacy String _O, or switch to Text2Image _O.
  • "The image is the wrong size." There's no canvas control - it's text-sized by design. The modern node fixes this.
  • "My custom font isn't in the dropdown." This node takes a font name string; make sure the file is in fonts/ and matches exactly (case included). The modern node has a proper dropdown.
  • "It's deprecated, will it vanish?" The whole deprecated folder is marked for removal. Migrating to Text2Image _O now saves you a headache later.

Good idea, outdated implementation. Use Text2Image _O - this one is only here for backward compatibility.

CategoryO/deprecated/string

Inputs (9)

NameTypeDefaultDescription
stringSTR
fontSTRINGCALIBRI.TTF
sizeINT360–255
font_RINT00–255
font_GINT00–255
font_BINT00–255
background_RINT2550–255
background_GINT2550–255
background_BINT2550–255

Outputs (1)

NameTypeDescription
IMAGEIMAGE