Gradient
Free gradient and soft-mask generator, five styles, custom colors
- image
- image
- mask
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.
Inputs (14)
| Name | Type | Default | Description |
|---|---|---|---|
| gradient_type | COMBO | linear | 5 options: linear, radial, angular, diamond, elliptical |
| rotation_angle | FLOAT | 0-360–360 | — |
| start_position | FLOAT | 0.000–1 | — |
| end_position | FLOAT | 1.000–1 | — |
| center_position | FLOAT | 0.500–1 | — |
| start_color | COMBO | custom | 30 options: custom, white, black, red, green, blue, +24 |
| start_color_hex | STRING | #000000 | — |
| end_color | COMBO | custom | 30 options: custom, white, black, red, green, blue, +24 |
| end_color_hex | STRING | #FFFFFF | — |
| start_alpha | FLOAT | 1.000–1 | — |
| end_alpha | FLOAT | 1.000–1 | — |
| image | IMAGE | — | |
| invert_alpha | BOOLEAN | false | — |
| invert_colors | BOOLEAN | false | — |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| image | IMAGE | — |
| mask | MASK | — |