lay_text_sum
Drawing styled text onto an image in ComfyUI
- image
- GradientAndStroke
- ShadowAndGlow
- EmbossAndFill
- image
Captions, watermarks, meme text, labels on a diagram - sooner or later you need to burn text directly into an image inside your workflow instead of doing it in an external editor. lay_text_sum is cardenluo's ComfyUI-Apt_Preset node for that, and it's built with more control than the usual "text overlay" node you see in other packs.
What it does
Feed it an image and a text string, and it draws that text at pixel position (x, y) in your chosen font_file (eight bundled fonts), font_size, and text_color (hex), with text_opacity for transparency. Two things push it past a basic overlay: arrangement lets you lay the text out horizontally or vertically (vertical arrangement is the useful one for CJK-style stacked text or narrow sidebars), and text_rotation spins the whole string anywhere from -180° to 180° - diagonal watermarks, angled labels, that kind of thing.
It also exposes three optional typed inputs - GradientAndStroke, ShadowAndGlow, EmbossAndFill - that don't take plain values, they take data objects (GRADIENT_AND_STROKE_DATA, SHADOW_AND_GLOW_DATA, EMBOSS_AND_FILL_DATA). That's a signal this pack has companion nodes elsewhere that build those styling configs - gradient fills with stroke outlines, drop shadows and glows, embossed/filled effects - and feed them in here. This article doesn't cover those config nodes directly, but if you want fancier text treatment than a flat color, look for nodes with matching names in the same imgEffect group.
Inputs and outputs
Required: image, text (multiline), font_file, x / y (0–4096, placement), font_size (0–320), arrangement (horizontal/vertical), text_rotation (-180 to 180), text_color (hex), text_opacity (0–1). Optional: GradientAndStroke, ShadowAndGlow, EmbossAndFill - advanced styling data from companion nodes.
Single image output with the text baked in.
For a beginner, the settings that matter most are text, x/y, font_size, and text_color - get those four right and you have a working caption; everything else is refinement.
Where this fits
Use this any time you need text as part of the final pixels rather than as ComfyUI UI chrome - thumbnails with titles, comparison images with method names burned in, memes, or watermarking output before it leaves your pipeline. If you need to place several different labels at several different coordinates in one pass, its sibling lay_text_sum_mul does that in one node instead of chaining several of these.
Installing it
ComfyUI Manager: search ComfyUI-Apt_Preset. Manually:
cd ComfyUI/custom_nodes
git clone https://github.com/cardenluo/ComfyUI-Apt_Preset.git
Run install.bat (Windows) or install requirements.txt by hand, restart ComfyUI. The font list is bundled with the repo, so make sure you did a full clone rather than a partial download if fonts aren't showing up correctly.
Troubleshooting
Check for a clean pack import first - ComfyUI-Apt_Preset is large, and there's a documented case of the whole pack throwing IMPORT FAILED for a user after install; if lay_text_sum is missing from your node search, look at the ComfyUI startup console for the real missing-dependency error before assuming your workflow file is broken.
Specific to this node: text that runs off the edge of the canvas is a common first mistake - x/y mark where the text starts, not where it's centered, so a long string at a high x value can run straight off the right edge; nudge x down or drop font_size. If a chosen font doesn't render as expected, that's usually a missing bundled font asset rather than a bad choice - same fix as above, reinstall via a fresh git clone.
Inputs (13)
| Name | Type | Default | Description |
|---|---|---|---|
| image | IMAGE | — | |
| text | STRING | — | |
| font_file | COMBO | QuakeLove-Regular.otf | 8 options: QuakeLove-Regular.otf, Autography.otf, Romellast.otf, FlowPerfect.ttf, en-LOLItalic.ttf, Alibaba-PuHuiTi-Heavy.ttf, +2 |
| x | INT | 00–4096 | — |
| y | INT | 00–4096 | — |
| font_size | INT | 120–320 | — |
| arrangement | COMBO | horizontal | 2 options: horizontal, vertical |
| text_rotation | INT | 0-180–180 | — |
| text_color | STRING | #ffffff | — |
| text_opacity | FLOAT | 1.000–1 | — |
| GradientAndStrokeopt | GRADIENT_AND_STROKE_DATA | — | |
| ShadowAndGlowopt | SHADOW_AND_GLOW_DATA | — | |
| EmbossAndFillopt | EMBOSS_AND_FILL_DATA | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| image | IMAGE | — |