ComfyUI Node

Gradient

Free gradient and soft-mask generator, five styles, custom colors

By LaoMaoBoss·Created about a year ago·Updated 5 days ago· 0
Gradient
  • image
  • image
  • mask
gradient_typelinear
rotation_angle0
start_position0.00
end_position1.00
center_position0.50
start_colorcustom
start_color_hex#000000
end_colorcustom
end_color_hex#FFFFFF
start_alpha1.00
end_alpha1.00
invert_alphafalse
invert_colorsfalse

Gradients are everywhere in compositing - soft backgrounds, fade-to-black vignettes, smooth transitions for blending one image into another. This node generates them in five flavors (linear, radial, angular, diamond, elliptical) with full control over colors, position, and transparency. And because a gradient's ramp is a mask, it also hands you a MASK output that's perfect for fade-in/fade-out compositing without touching an image editor.

The one thing that surprises people on first use: the image input is required. This node doesn't generate a standalone canvas of arbitrary size - it sizes the gradient to match the image you feed in. That's actually convenient (you almost always want the gradient in the same dimensions as what you're compositing over), but it means you can't just drop the node and get a gradient; you need an image to define the canvas.

How it works

You pick a gradient_type and a rotation_angle for direction. Then the position trio controls the layout: start_position and end_position (0–1) set where the ramp begins and ends, and center_position (default 0.5) sets the center for the radial/diamond/elliptical types. Colors come in two layers: a named color (white, black, red, ... 30 presets, custom included) or a raw hex via start_color_hex / end_color_hex - set the preset to custom and type your hex. Then start_alpha and end_alpha (0–1) control transparency at each end of the ramp.

Two toggles worth knowing:

  • invert_alpha - flips the transparency ramp, turning a fade-out into a fade-in.
  • invert_colors - swaps the color endpoints.

Outputs are image (the gradient as an IMAGE, sized to your input) and mask (the alpha ramp as a MASK). The mask output is the sleeper feature - wire it into a blend or a feathering step and you've got a professional soft edge with zero effort.

Install

Ships in ComfyUI-WBLESS:

cd ComfyUI/custom_nodes
git clone https://github.com/LaoMaoBoss/ComfyUI-WBLESS

restart ComfyUI, or use ComfyUI Manager to search "ComfyUI-WBLESS." No models, no dependencies.

Troubleshooting

If your gradient looks like a solid block, check the color values first - a common setup mistake is both endpoints set to the same color, or start_position equal to end_position, which collapses the ramp to a single point. If the alpha seems backwards, that's what invert_alpha is for. And if the gradient has the wrong dimensions, remember the canvas comes from the image input - resize that, not the gradient. For the price of one node, you get both the graphic element and its matching soft mask in a single run, which is exactly the pair you want when you're building a vignette or a transition.

Category🌈WBLESS

Inputs (14)

NameTypeDefaultDescription
gradient_typeCOMBOlinear5 options: linear, radial, angular, diamond, elliptical
rotation_angleFLOAT0-360–360
start_positionFLOAT0.000–1
end_positionFLOAT1.000–1
center_positionFLOAT0.500–1
start_colorCOMBOcustom30 options: custom, white, black, red, green, blue, +24
start_color_hexSTRING#000000
end_colorCOMBOcustom30 options: custom, white, black, red, green, blue, +24
end_color_hexSTRING#FFFFFF
start_alphaFLOAT1.000–1
end_alphaFLOAT1.000–1
imageIMAGE
invert_alphaBOOLEANfalse
invert_colorsBOOLEANfalse

Outputs (2)

NameTypeDescription
imageIMAGE
maskMASK