Nodes/comfyui-mixlab-nodes/GradientImage ♾️Mixlab
ComfyUI Node Runs on cloud

GradientImage ♾️Mixlab

A two-color gradient, image and mask in one shot

By MixLabPro·Created 3 years ago·Updated 2 months ago· 1,859
GradientImage ♾️Mixlab
    • IMAGE
    • MASK
    width512
    height512
    start_color_hex#FFFFFF
    end_color_hex#000000

    A small generator node that solves a small but recurring problem: sometimes you just need a gradient - a quick backdrop, a vignette base, or a ready-made fade mask - and hand-painting one or reaching for an external image editor is overkill. GradientImage makes a two-color linear gradient at whatever size you want, and hands back both the color image and a mask version of the same gradient, since a black-to-white fade is, pixel for pixel, already a usable mask.

    How it works

    Set a width and height, pick a start color and an end color as hex strings, and it renders the gradient between them. Because the output doubles as a mask (grayscale reading of the same gradient), you get a soft-fade mask for free without needing a separate grayscale-conversion step - genuinely convenient for feathered composites or vignette effects.

    The schema doesn't specify which direction the gradient runs (top-to-bottom, left-to-right, or diagonal) - rather than guess, drop the node down and preview it once before building a workflow around an assumed direction.

    The inputs and outputs that matter

    • width / height (INT, default 512, range 18192, required) - the output size.
    • start_color_hex (STRING, default #FFFFFF, required) - where the gradient begins.
    • end_color_hex (STRING, default #000000, required) - where it ends.

    Two outputs: IMAGE (the rendered gradient) and MASK (the same gradient read as a mask) - wire the IMAGE wherever you want a backdrop or overlay, and the MASK wherever you need a smooth fade without hand-painting one.

    How to install it

    Ships with the Mixlab pack.

    • ComfyUI Manager: search comfyui-mixlab-nodes, install, restart.
    • Manual: cd ComfyUI/custom_nodes && git clone https://github.com/shadowcz007/comfyui-mixlab-nodes.git, install requirements (install.bat on Windows, or ../../../python_embeded/python.exe -s -m pip install -r requirements.txt), restart.

    No models needed - it's a pure procedural generator.

    Common issues & troubleshooting

    Gradient runs the wrong direction for what I needed. Since the direction isn't documented, don't assume - preview the node once with your actual colors and size before wiring the rest of your workflow around it.

    Mask fades too aggressively / not enough. That's controlled entirely by how far apart your two hex colors are, since the mask is just the gradient's brightness. For a subtle edge fade, use two close colors (say, white to near-white) rather than a full white-to-black run; for a strong fade, keep the full-contrast default.

    Colors don't come out as expected. Double-check the hex strings are well-formed (#RRGGBB) - this field is a plain string input, so a malformed hex value is likely to error or fall back rather than silently correcting itself.

    Category♾️Mixlab/Image

    Inputs (4)

    NameTypeDefaultDescription
    widthINT5121–8192
    heightINT5121–8192
    start_color_hexSTRING#FFFFFF
    end_color_hexSTRING#000000

    Outputs (2)

    NameTypeDescription
    IMAGEIMAGE
    MASKMASK