Nodes/Nodes for use with real-time applications of ComfyUI/Text Renderer πŸ•’πŸ…‘πŸ…£πŸ…
ComfyUI Node

Text Renderer πŸ•’πŸ…‘πŸ…£πŸ…

Render Any Value as Text, With a Clean Mask

By ryanontheinsideΒ·Created 2 years agoΒ·Updated about a year agoΒ· 82
Text Renderer πŸ•’πŸ…‘πŸ…£πŸ…
  • any
  • IMAGE
  • MASK
β—„width512β–Ί
β—„height512β–Ί
β—„font_size48β–Ί
β—„font_colorwhiteβ–Ί
β—„background_colorblackβ–Ί
β—„x_offset0β–Ί
β—„y_offset0β–Ί
β—„aligncenterβ–Ί
β—„wrap_width0β–Ί

Real-time ComfyUI is cool until you realize the audience can't tell what's happening. Is that effect at 40% or 90%? Text Renderer fixes that by taking any value in your graph and painting it onto a canvas as text. FPS numbers, denoise values, a counter, a prompt - anything that flows through ComfyUI can become an on-screen label, and it ships both the image and a text-shaped mask so you can composite it cleanly instead of pasting a black box over your stream.

The headline feature is the any input. It's a wildcard typed *, which in ComfyUI terms means it accepts literally any data type - floats, ints, strings, even tensors if you're feeling brave. Whatever you feed it gets stringified and drawn. That's the whole trick, and it's what makes the node genuinely useful: you can render a FLOAT out of a Float Control directly, no string-conversion detour.

Rendering is PIL under the hood, with a real font bundled in the pack (DejaVu Sans in fonts/dejavu-sans/), so it looks like actual typography rather than a 5Γ—7 bitmap. You get font_color and background_color as names ("white", "black", "red"), x_offset/y_offset to nudge it, an align of left/center/right, and wrap_width for wrapping text at a pixel width (0 = no wrap). The mask output matches the text exactly, so compositing is a matter of using the mask as your alpha matte.

Inputs worth setting

  • any - the value to display. This is the one that matters.
  • width / height - canvas size, which should match your output frame.
  • font_size - text size in pixels; 48 is the default and reads well.
  • wrap_width - wrap long strings at this pixel width (0 disables wrapping).

Outputs: IMAGE (text on the background color) and MASK (text as white). If the rendered image ends up RGBA, the alpha channel multiplies into the mask automatically.

Install & troubleshooting

It's in ryanontheinside/ComfyUI_RealtimeNodes - ComfyUI Manager (search "Control Nodes") or:

cd ComfyUI/custom_nodes
git clone https://github.com/ryanontheinside/ComfyUI_RealtimeNodes
cd ComfyUI_RealtimeNodes
pip install -r requirements.txt

A few things to know. Color names come from PIL, so use "white", "black", "red" - hex strings won't parse. Text is vertically centered by default, so the y_offset is for fine-tuning, not positioning from the top. And the font file is looked up relative to the pack; if you moved or symlinked the install, the fallback is PIL's tiny default font, which looks bad - keep the pack in its normal spot. When paired with the control nodes in this pack, though, you've got a live telemetry readout for your stream with about two wires.

Categoryreal-time

Inputs (10)

NameTypeDefaultDescription
any*β€”
widthINT51264–16384β€”
heightINT51264–16384β€”
font_sizeINT481–512β€”
font_colorSTRINGwhiteβ€”
background_colorSTRINGblackβ€”
x_offsetINT0-4096–4096β€”
y_offsetINT0-4096–4096β€”
alignCOMBOcenter3 options: left, center, right
wrap_widthINT00–16384Width to wrap text at (0 = no wrapping)

Outputs (2)

NameTypeDescription
IMAGEIMAGEβ€”
MASKMASKβ€”