Nodes/ComfyUI S4Tool Text/💀Text Style
ComfyUI Node

💀Text Style

Stroke, shadow, and gradient fill that don't look like trash

By S4MUEL-404·Created about a year ago·Updated about a year ago· 4
💀Text Style
  • style
  • IMAGE
  • MASK
â—„stroke_size0â–º
â—„stroke_color#000000â–º
â—„outer_shadow_x0â–º
â—„outer_shadow_y0â–º
â—„outer_shadow_color#000000â–º
â—„outer_shadow_blur2.0â–º
â—„gradient_start#FFFFFFâ–º
â—„gradient_end#00FF00â–º
â—„gradient_angle0.00â–º
â—„alpha1.00â–º

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:

  1. Drop shadow - the text's alpha, offset by outer_shadow_x/y, blurred with a Gaussian, colored with outer_shadow_color.
  2. Stroke - the outline around each glyph. This is where the pack does something clever: if opencv-python is 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 PIL MaxFilter ring that gets visibly jagged as stroke_size climbs.
  3. 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_DATA input 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_start and gradient_end to the same hex. Forgetting that and leaving the defaults is how you get white-to-green text.
  • alpha fades 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.

Category💀S4Tool

Inputs (11)

NameTypeDefaultDescription
styleSTYLE_DATA—
stroke_sizeINT00–100—
stroke_colorSTRING#000000—
outer_shadow_xINT0-100–100—
outer_shadow_yINT0-100–100—
outer_shadow_colorSTRING#000000—
outer_shadow_blurFLOAT2.00–20—
gradient_startSTRING#FFFFFF—
gradient_endSTRING#00FF00—
gradient_angleFLOAT0.000–360—
alphaFLOAT1.000–1—

Outputs (2)

NameTypeDescription
IMAGEIMAGE—
MASKMASK—