💀Text Style
Stroke, shadow, and gradient fill that don't look like trash
- style
- IMAGE
- MASK
Rendered text on a transparent canvas is the start of a poster, not the end. Flat glyphs vanish against a busy background - which is why every video editor and meme tool ships stroke, shadow, and gradient options. S4Tools Text Style is that layer for ComfyUI: it takes the raw text render from S4Tools Text Basic and makes it look like it belongs on a title card.
The honest pitch: if your text just needs to be on the image, you don't need this node. If you want text you can actually read over a noisy background, or text that looks designed, this is the second half of the pack's whole reason to exist.
How it works
Text Style consumes the STYLE_DATA output from Text Basic (the same RGBA canvas, passed through as a custom type - only this pack's nodes speak it). It builds up the result in layers, bottom to top:
- Drop shadow - the text's alpha, offset by
outer_shadow_x/y, blurred with a Gaussian, colored withouter_shadow_color. - Stroke - the outline around each glyph. This is where the pack does something clever: if
opencv-pythonis installed, it uses an SDF-like approach (dilate the alpha, run a distance transform, and use the distance field to anti-alias the ring) so the stroke stays smooth at any thickness. Without OpenCV it falls back to a PILMaxFilterring that gets visibly jagged asstroke_sizeclimbs. - Gradient fill - a gradient drawn across the whole canvas at
gradient_angle, then masked to the glyph alpha and laid over everything.
Because it builds layers from the alpha channel rather than re-rasterizing, the stroke and shadow follow the glyph shape exactly - including on that vertical CJK typesetting, which most text post-processors mangle.
Inputs that matter
- style - the required
STYLE_DATAinput from Text Basic. There's no other source. - stroke_size (0–100, default 0) and stroke_color (hex, default
#000000). 0 = no stroke. - outer_shadow_x/y (-100–100) and outer_shadow_blur (0–20, default 2.0). Shadow only appears once you offset x or y from zero.
- gradient_start / gradient_end (hex) and gradient_angle (0–360, default 0). Defaults are
#FFFFFF→#00FF00, which is a choice - see below. - alpha (0–1, default 1.0) - global opacity, but applied to the fill layer only.
Outputs
- IMAGE - the fully composited RGBA result.
- MASK - the final alpha, so you can composite the styled text onto a background with whatever mask-compositing node you already use.
Install
Same as the rest of the pack - ComfyUI Manager, search "ComfyUI S4Tool Text", install, restart. Or:
cd ComfyUI/custom_nodes
git clone https://github.com/S4MUEL-404/ComfyUI-S4Tool-Text
The one install decision that matters here: install opencv-python (pip install opencv-python in your ComfyUI environment) or the stroke quality drops off hard past a few pixels. There's no requirements.txt in the repo, so neither Manager nor the clone will fetch it for you - you have to do it yourself. The node prints a message at runtime telling you whether OpenCV was detected, so you'll know which path you're on.
Gotchas
- The gradient replaces your text color. The fill layer covers whatever color you set in Text Basic. Want solid text? Set
gradient_startandgradient_endto the same hex. Forgetting that and leaving the defaults is how you get white-to-green text. alphafades the fill, not the stroke or shadow. If you want the whole thing semi-transparent, you'll need a compositing node after this one.- The canvas grows. Style adds a margin around the glyphs (sized off your stroke and shadow amounts), so the output is bigger than the input. Composite by alignment, not by assuming the origin.
- Watch the shadow defaults: blur is 2.0 but offsets are 0, so nothing appears until you move it - which is correct, just surprising the first time.
Pair it with Text Basic, set stroke to ~2-4 with a dark color for legibility over anything, and you've got a subtitle/poster pipeline in three nodes.
Inputs (11)
| Name | Type | Default | Description |
|---|---|---|---|
| style | STYLE_DATA | — | |
| stroke_size | INT | 00–100 | — |
| stroke_color | STRING | #000000 | — |
| outer_shadow_x | INT | 0-100–100 | — |
| outer_shadow_y | INT | 0-100–100 | — |
| outer_shadow_color | STRING | #000000 | — |
| outer_shadow_blur | FLOAT | 2.00–20 | — |
| gradient_start | STRING | #FFFFFF | — |
| gradient_end | STRING | #00FF00 | — |
| gradient_angle | FLOAT | 0.000–360 | — |
| alpha | FLOAT | 1.000–1 | — |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| IMAGE | IMAGE | — |
| MASK | MASK | — |