Google Font Text Image
Turn any Google Font into a ComfyUI image with a real alpha mask
- IMAGE
- MASK
Most of ComfyUI treats text as a string that goes into a CLIP or LLM encoder. This node does the opposite: it turns text into pixels. Give it a font and some words, and it renders them to an actual image tensor with a proper alpha mask, ready to composite over anything.
That sounds niche until you hit the workflows that need it. Watermarks on generated images. Titles and subtitles layered over video or stills. Typography experiments where you want a text image you can run through img2img or ControlNet. And the use case the author clearly cares about: generating font specimens - a sheet of every letter, digit and symbol in a typeface - to feed a multimodal model that's learning to recognize typography. There's even a "Standard Character Set" output mode built for exactly that.
How it works
Under the hood this is a headless browser, not a PIL renderer. On startup the node calls Google's webfonts API and loads the entire 1,500+ font catalog into the dropdown, cached for the session. When you queue, it builds an HTML page that loads your chosen family from fonts.googleapis.com via CSS, opens it in Playwright's Chromium, waits a second for the font to arrive, measures the text, and screenshots the page. That's the mechanism behind everything you'll notice: text wrapping, line-height, uppercase/lowercase transforms - they're all just CSS, so they behave like real typography instead of a crude raster.
The variant handling is smarter than most text nodes too. Each font only ships certain weights and styles, so the node checks whether your requested font_weight / font_style combo actually exists and falls back to the closest available variant with a console warning rather than silently faking a bold.
The inputs that matter
You'll actually touch a handful:
font_family- dropdown of the full Google Fonts catalog, loaded at startup. If that fetch fails, it collapses to just "Arial".text- your content, multiline;\nbecomes a line break. Ignored in "Standard Character Set" mode, which renders A–Z, a–z, 0–9 and symbols instead - the specimen mode.dimension_mode- Auto measures the rendered text and sizes the image to fit (plus padding); Define Manually useswidth/heightand wraps text to fit. Auto is the one to start with.transparent_background- on by default, and keep it on: it makes the background genuinely transparent and puts the text shape in theMASKoutput.text_color,background_color- plain hex strings, which is why wiring an external color-picker node intotext_colorworks so cleanly.
The two outputs are the point: IMAGE (RGB tensor) and MASK (the alpha channel, a 1×H×W float tensor). Composite them over a base image and you get crisp edges instead of a white box - the alpha is real from the start, no background removal in sight. One caveat: the MASK is only meaningful with transparent_background on; with it off the alpha channel is fully opaque and the mask is just a white rectangle.
Installing it
Easiest path is ComfyUI Manager - search "Google Font" - or the manual route:
cd ComfyUI/custom_nodes
git clone https://github.com/ru4ls/ComfyUI_Google-Fonts
cd ComfyUI_Google-Fonts
pip install -r requirements.txt
playwright install # run inside your ComfyUI venv
Then restart ComfyUI and the node appears under Add Node → Ru4ls/Google Fonts. Two things to know going in: playwright install is mandatory - without the Chromium binary the node errors out immediately - and the README's own clone command is missing the final "s" (ComfyUI_Google-Font, a repo that doesn't exist). Use the URL above. A Google Fonts API key is optional; drop one in the .env file (the pack copies .env.example to .env for you on first load) to dodge rate-limit weirdness with the font list.
Where people get burned
The classic failure mode is text getting cut off, which is the bug the Playwright migration was built to kill. If it still bites, switch to Auto dimension mode first, then shrink font_size or raise the per-side paddings. The quieter gotchas: rendering needs internet at queue time, because the actual font files download from Google on every render - an offline ComfyUI silently falls back to a generic sans-serif. And this is a slow node. Each render boots a browser and waits a full second for fonts, so batch jobs of hundreds of titles take a while. It's a compositing tool, not a text factory. For that price you get real typography and a real mask, which is more than the lightweight text-image nodes offer.
Inputs (19)
| Name | Type | Default | Description |
|---|---|---|---|
| font_family | COMBO | 1 options: Arial | |
| font_size | INT | 481–1024 | — |
| font_weight | COMBO | 400 | 9 options: 100, 200, 300, 400, 500, 600, +3 |
| font_style | COMBO | 2 options: normal, italic | |
| output_mode | COMBO | 2 options: Custom Text, Standard Character Set | |
| text | STRING | Sample Text | — |
| text_align | COMBO | 3 options: center, left, right | |
| line_height | FLOAT | 1.20.1–5 | — |
| text_transform | COMBO | 4 options: none, uppercase, lowercase, capitalize | |
| text_color | STRING | #000000 | — |
| dimension_mode | COMBO | Auto | 2 options: Auto, Define Manually |
| width | INT | 51264–8192 | — |
| height | INT | 51264–8192 | — |
| padding_top | INT | 200–200 | — |
| padding_right | INT | 200–200 | — |
| padding_bottom | INT | 200–200 | — |
| padding_left | INT | 200–200 | — |
| background_color | STRING | #FFFFFF | — |
| transparent_background | BOOLEAN | true | — |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| IMAGE | IMAGE | — |
| MASK | MASK | — |