Nodes/ComfyUI-Apt_Preset/Stack_GradientAndStroke
ComfyUI Node

Stack_GradientAndStroke

Gradient Fills and Double Outlines for Apt_Preset's Graphic Tools

By cardenluo·Created 2 years ago·Updated 18 days ago· 309
Stack_GradientAndStroke
    • GradientAndStroke
    use_gradientfalse
    start_color#ff0000
    end_color#0000ff
    angle0
    opacity_gradient_typenone
    opacity_start1.00
    opacity_end0.50
    stroke_width0
    stroke_color#000000
    stroke_opacity1.00
    stroke_typenormal
    second_stroke_color#ffff00
    second_stroke_width0

    The sibling to Stack_EmbossAndFill, and part of the same March 2026 "image editing and visualization" addition to Apt_Preset. Where that node handles texture fills and embossing, Stack_GradientAndStroke handles color gradients and outline strokes - the kind of settings you'd expect from a vector or text design tool rather than a diffusion pipeline. This is another config bundle, not a generation node: it packages a set of choices into a GRADIENT_AND_STROKE_DATA object for some other node in the pack to apply.

    Gradient settings

    • use_gradient (BOOLEAN, default false) - turns on a two-color gradient fill instead of a flat color.
    • start_color (default #ff0000, red) and end_color (default #0000ff, blue) - the two ends of the gradient.
    • angle (INT, -180 to 180, default 0) - the gradient's direction.
    • opacity_gradient_type (enum: none / linear / radial, default none) - whether opacity itself also fades independently of color, and in what shape.
    • opacity_start / opacity_end (0–1, default 1 and 0.5) - the opacity fade's two endpoints, only relevant if opacity_gradient_type isn't none.

    Stroke settings

    • stroke_width (INT, 0–100, default 0) and stroke_color (default #000000, black) - a basic outline. Width 0 means no visible stroke regardless of color.
    • stroke_opacity (0–1, default 1).
    • stroke_type (enum: normal / smooth / double, default normal).
    • second_stroke_color (default #ffff00, yellow) and second_stroke_width (0–50, default 0) - a second, independent outline layer, which is what stroke_type = double is presumably drawing on to produce a two-tone double-outline look.

    Output: GradientAndStroke, a GRADIENT_AND_STROKE_DATA bundle.

    Setting it up

    Both halves - gradient and stroke - are independently toggleable, so turn on only what you need. If you're after a two-color gradient, start_color/end_color/angle are the three that matter; leave opacity_gradient_type at none unless you specifically want the transparency itself to fade separately from the color. For strokes, stroke_width at 0 is effectively off no matter what color you've set, so that's the first thing to check if a stroke isn't showing up. The double-stroke setup (stroke_type = double plus the second_stroke_* fields) is for a layered outline look - set the two stroke colors to contrast for it to actually read as two distinct rings rather than one blended one.

    What's not documented here

    As with Stack_EmbossAndFill, this node's GRADIENT_AND_STROKE_DATA output doesn't correspond to an input type on any of the other 20 Apt_Preset nodes covered on comfy.icu, so the consuming node lives elsewhere in the pack. Check Apt_Preset's own example workflows if you're unsure what to plug it into.

    Install

    ComfyUI Manager: search "ComfyUI-Apt_Preset," install, restart. Manually: cd ComfyUI/custom_nodes && git clone https://github.com/cardenluo/ComfyUI-Apt_Preset.git, then restart ComfyUI. Its install.bat dependency installer is a Windows batch file - on Linux or a cloud box, check what it installs and pip-install those packages directly, or let ComfyUI Manager's "install missing nodes" flow handle it.

    Troubleshooting

    Nothing changing after you add this node is expected until you flip use_gradient on, or set a stroke_width above 0 - both effects default to off.

    This pack has real, reported import failures - a comfyui subreddit thread shows a console error reading (IMPORT FAILED): ...ComfyUI-Apt_Preset for someone loading a workflow that used it. ComfyUI Manager's "install missing custom nodes" resolved it, as did manually re-cloning the repository and restarting.

    CategoryApt_Preset/stack/😺backup

    Inputs (13)

    NameTypeDefaultDescription
    use_gradientBOOLEANfalse
    start_colorSTRING#ff0000
    end_colorSTRING#0000ff
    angleINT0-180–180
    opacity_gradient_typeCOMBOnone3 options: none, linear, radial
    opacity_startFLOAT1.000–1
    opacity_endFLOAT0.500–1
    stroke_widthINT00–100
    stroke_colorSTRING#000000
    stroke_opacityFLOAT1.000–1
    stroke_typeCOMBOnormal3 options: normal, smooth, double
    second_stroke_colorSTRING#ffff00
    second_stroke_widthINT00–50

    Outputs (1)

    NameTypeDescription
    GradientAndStrokeGRADIENT_AND_STROKE_DATA