Nodes/ComfyUI Layer Style/LayerUtility: GradientImage
ComfyUI Node Runs on cloud

LayerUtility: GradientImage

GradientImage — generate a two-color gradient from nothing

By chflame163·Created 3 years ago·Updated 5 days ago· 3,113
LayerUtility: GradientImage
    • image
    â—„width512â–º
    â—„height512â–º
    â—„angle0â–º
    â—„start_color#FFFFFFâ–º
    â—„end_color#000000â–º

    No input image required - this node draws a gradient from scratch, purely from a size, two colors, and an angle. Reach for it when you need a quick backdrop, a base canvas to composite other Layer Style effects onto, a smooth ramp to use as a mask source, or just a fast test pattern instead of hunting down a stock gradient PNG.

    It's a source node, not an editing node, and that's exactly its appeal - there's zero setup cost. Rather than importing a gradient asset or building one out of two flat-color layers and a blend, you drop this node, set two colors, and you've got a ramp you can wire anywhere an IMAGE input is expected.

    How it works

    It paints a straight linear ramp between start_color and end_color across a canvas of width × height, oriented by angle. No curves, no radial option, no extra color stops in between - two colors, one straight line of interpolation, rotated however you tell it to. That simplicity is the point: it's a building block, not a full gradient editor.

    The inputs and outputs that matter

    • width / height (default 512, up to 99999 each) - canvas size. You can go genuinely huge if you need a large flat backdrop.
    • angle (-360 to 360) - direction of the ramp. 0 runs roughly left-to-right; nudge it and watch the preview rather than trying to reason about degrees in your head.
    • start_color / end_color (hex strings, default white-to-black) - swap these for whatever two-color wash you actually want.

    Output is a single image - the finished gradient, ready to feed downstream.

    How to install it

    Search ComfyUI Layer Style in ComfyUI Manager, or:

    cd ComfyUI/custom_nodes
    git clone https://github.com/chflame163/ComfyUI_LayerStyle
    pip install -r ComfyUI_LayerStyle/requirements.txt
    

    Restart ComfyUI; it lives under 😺dzNodes → LayerUtility. Pure generation, no models to download.

    Common issues

    There's not much that goes wrong here since it's not processing anything - the main gotcha is expectation mismatch. People sometimes want a radial gradient, or three-plus color stops, and this node simply doesn't do that; it's strictly a two-color linear ramp at an angle. If you need more stops, you'll want something outside this node (or build one by layering a few of these with blend modes downstream). If you notice visible banding at large canvas sizes, that's standard 8-bit color depth showing through on a smooth ramp, not a defect in the node - dither or add slight noise downstream if the banding actually matters for your output. And a small but real note: there's also a GradientImage V2 in this same pack that adds preset resolution dropdowns (1024×1024, common 16:9/9:16 buckets, etc.) so you don't have to type dimensions by hand - worth reaching for that one if you're targeting a specific generation resolution rather than an arbitrary size.

    Category😺dzNodes/LayerUtility

    Inputs (5)

    NameTypeDefaultDescription
    widthINT5124–99999—
    heightINT5124–99999—
    angleINT0-360–360—
    start_colorSTRING#FFFFFF—
    end_colorSTRING#000000—

    Outputs (1)

    NameTypeDescription
    imageIMAGE—