π¨ Fill / Gradient Generator v2
A gradient generator that also hands you the masks
- image
- full_mask
- border_mask
- settings_json
Most ComfyUI nodes need an input image to do anything. The Fill / Gradient Generator v2 is one of the exceptions: give it a width, a height and some colors and it renders a fill or gradient from nothing. It's part of the Orion4D Layer Manager pack, and it earns its keep in layer work three ways - as a background canvas, as a source of gradient mats for compositing, and as a way to mint a border/frame mask without touching a paint app.
How it works
The generator is a pure pixel pass, no neural anything. It builds normalized coordinates across the canvas, computes a distance or projection per pixel depending on the fill mode, and maps that to a 0β1 gradient position that walks your color stops. The six modes - solid, linear, radial, angular, reflected, diamond - are just different ways of computing that position: angle rotates the linear/angular projection, and center_x/center_y (normalized 0β1, both default 0.5) move the radial/diamond center around. invert flips the position so the gradient runs backwards.
The genuinely useful part is that it outputs masks alongside the image. full_mask is a white rectangle of the whole canvas. border_mask is white only along the canvas edges, sized by inner_border_px (0β200). You can wire those masks straight into other nodes - a border mask is exactly what you want for adding a matte frame to a composite, and a full mask is the "paint everything here" token that keeps a mask-based pipeline flowing. There's also a settings_json STRING output that round-trips the whole configuration, so the state is never lost between the node and its editor app.
The inputs that matter
width,height- canvas size, up to 8192. Bigger is slower but it's just numpy math, so even 4K renders in a blink.fill_mode- the shape of the gradient.solidignores the stops and just fills withcolor_1.color_count(1β4) pluscolor_1β¦color_4- how many stops, and their hex colors. Only the active count is used.invert,angle,center_x/center_y- the geometry knobs above.inner_border_px,border_color,border_opacity- an inner border strip drawn inside the canvas edge. Set 0 to skip.
Outputs
image (RGB), full_mask (MASK), border_mask (MASK), and settings_json (STRING). The typical chain: use the gradient as a background layer, feed the border mask into a compositing or blur node to build the frame effect.
Install
Same as the rest of the pack - no models, no extra dependencies, just the NumPy/Pillow/PyTorch a stock ComfyUI already ships:
cd ComfyUI/custom_nodes
git clone https://github.com/orion4d/Orion4D_layer_manager
Restart ComfyUI. Or via ComfyUI Manager β "Install Custom Nodes" β search Orion4D_layer_manager. The pack ships preset gradients in presets_gradients/ (a "Black to White Linear" and "Warm Radial" to start), and the editor app lets you save your own.
Common issues
- Gradient doesn't look like the preview. The editor app is the reference preview, but the Python backend is the final output - hit Run after Apply so the two agree. That's true of every node in this pack.
center_x/center_yfeel inverted or off. They're normalized canvas coordinates (0β1), not pixels - 0.5, 0.5 is dead center. If your radial's heart isn't where you dragged it in the app, it's usually a stale run rather than a wrong value.- Border mask is white everywhere.
inner_border_pxdefaults to 0, which means no border. Set it to something like 20 and the mask flips on.
Inputs (15)
| Name | Type | Default | Description |
|---|---|---|---|
| width | INT | 10241β8192 | β |
| height | INT | 10241β8192 | β |
| fill_mode | COMBO | solid | 6 options: solid, linear, radial, angular, reflected, diamond |
| color_count | COMBO | 1 | 4 options: 1, 2, 3, 4 |
| color_1 | STRING | #FFFFFF | β |
| color_2 | STRING | #FFFFFF | β |
| color_3 | STRING | #FFFFFF | β |
| color_4 | STRING | #FFFFFF | β |
| invert | BOOLEAN | false | β |
| angle | FLOAT | 00β360 | β |
| center_x | FLOAT | 0.500β1 | β |
| center_y | FLOAT | 0.500β1 | β |
| inner_border_px | INT | 00β200 | β |
| border_color | STRING | #FFFFFF | β |
| border_opacity | FLOAT | 1.000β1 | β |
Outputs (4)
| Name | Type | Description |
|---|---|---|
| image | IMAGE | β |
| full_mask | MASK | β |
| border_mask | MASK | β |
| settings_json | STRING | β |