ComfyUI Node

Text Shadow

Drop shadows as a reusable object, not fifty buried sliders

By drmbt·Created 2 years ago·Updated 7 months ago· 6
Text Shadow
    • SHADOW
    colorblack
    opacity1.00
    distance10
    angle45.0
    blur4
    color_hex#000000

    Text without a drop shadow looks flat. Text with one looks like it belongs on the image. The problem is that every ComfyUI text-rendering node that supports shadows buries the settings inside the giant node - and then you've got three text blocks each with their own shadow sliders, and they drift out of sync the moment you tweak one. Text Shadow fixes that the same way the rest of this pack's "DreamBait/Text" category does: it's a small node that packages shadow settings into a single SHADOW object you wire into the pack's Draw Text node. Configure once, reuse everywhere.

    It sits right next to Text Margins in the category, and they follow the identical pattern - a config-struct node feeding the big renderer. If you've used one, you already know how the other works.

    How it works

    It takes five settings and packages them into a dict that travels out as the custom SHADOW type: {"color": "black", "opacity": 1.0, "distance": 10, "angle": 45, "blur": 4, "color_hex": "#000000"}. Draw Text consumes that via its optional shadow input and renders the shadow during text layout - the shadow is drawn behind the glyphs, offset by distance at angle, blurred by blur, tinted by the color.

    The color handling is worth reading twice: the color dropdown has 31 presets, and opacity (0–1) controls alpha - unless you use an 8-digit hex in color_hex, in which case the hex's own alpha channel overrides the opacity slider entirely. That's a genuinely useful escape hatch: you can do one shadow at 50% and another at 80% by each carrying its own hex, while leaving the shared opacity slider alone.

    distance has a handy special value: 0 disables the shadow entirely. So a single node can act as an on/off switch for the effect across every Draw Text node wired to it - flip one number, shadows vanish everywhere.

    The inputs that matter

    • color - the 31-color dropdown (black default) or custom for the hex route.
    • opacity - 0–1 alpha, default 1. Ignored if you use 8-digit hex.
    • distance - pixels, 0–100, default 10. 0 = no shadow.
    • angle - degrees, -360 to 360, default 45 (down-right). Negative angles flip the shadow direction.
    • blur - blur radius, 0–100, default 4.
    • color_hex - optional, #RRGGBB or #RRGGBBAA. 8-digit overrides opacity.

    The only output is SHADOW.

    Installing

    Text Shadow ships in the drmbt/comfyui-dreambait-nodes pack. Install via ComfyUI Manager (search comfyui-dreambait-nodes) or:

    cd ComfyUI/custom_nodes
    git clone https://github.com/drmbt/comfyui-dreambait-nodes
    # restart ComfyUI
    

    No model downloads, no dependencies - the rendering happens in Draw Text, and this pack's requirements cover Pillow for that.

    Where it fits

    The classic win: a video title card with six text elements all sharing one consistent shadow. Build one Text Shadow, wire it into all six Draw Text nodes, and a single edit restyles the whole card. Same for a logo treatment where you want an identical shadow behind both the wordmark and the tagline. Combine it with Text Margins and the box-style node and you can rebuild the entire text layout of a workflow from five tiny boxes instead of reopening the big node.

    The limitation, same as its sibling: the SHADOW type only speaks to this pack's Draw Text node, so it won't help with other text packs. And a design caveat rather than a bug - a big blur with a low opacity is the tasteful look; cranking both to max is how you get 1998-style embossed text. The tool's honest, it'll do either.

    CategoryDreamBait/Text

    Inputs (6)

    NameTypeDefaultDescription
    colorCOMBOblackShadow color. Alpha controlled by opacity unless using 8-digit hex
    opacityFLOAT1.000–1Shadow opacity (ignored if using 8-digit hex color)
    distanceINT100–100Shadow distance in pixels. 0 disables shadow
    angleFLOAT45.0-360–360Shadow angle in degrees
    blurINT40–100Shadow blur radius in pixels
    color_hexoptSTRING#000000Custom hex color (6 or 8 digits). 8-digit hex overrides opacity

    Outputs (1)

    NameTypeDescription
    SHADOWSHADOW