Gradient Border Mask
A vignette you can wire straight into an image β made from pure math, no models
- image
Gradient Border Mask generates a black-to-white gradient that's black at the image edges and fades to white in the middle. Sounds like a niche utility, and it kind of is - but it's the quiet workhorse behind vignettes, soft-edge blending, and "draw attention to the center" tricks, and it does it with zero model downloads and zero inference time.
How it works
The whole thing is numpy math. For every pixel it computes the distance to the nearest image edge, then maps that distance into a 0β255 ramp controlled by border_fraction. Pixels right at the edge land near black; pixels far enough inside land at white. The result is written to all three RGB channels and returned as a standard ComfyUI IMAGE - note the type, it's an image, not a MASK, even though the name says mask. If a downstream node genuinely needs a MASK you'll convert, but most blend and composite nodes in this pack accept the image form happily.
Inputs
- width (default 1200, 8β8192) and height (default 800, 8β8192) - output resolution, stepped in multiples of 8.
- border_fraction (default 0.03, 0.001β0.5) - how much of the frame counts as "edge." A small value like 0.03 makes a thin dark rim; larger values push the black deep into the frame and shrink the white center. This is the knob you'll actually fiddle with.
Output is a single IMAGE.
Where it earns its keep
The classic use is blending. Multiply your render by this image (or an inverted variant) to darken the frame edges before compositing - that softens seams when you paste two images together, a trick that pairs well with the mask-based compositing patterns from the inpainting playbook. It's also the cheap way to fake a vignette on a final image, and it makes a perfectly fine starting mask for a masking pipeline if you want generation to fall off at the borders.
Installing it
This node ships in the Eden.art nodesuite (edenartlab/eden_comfy_pipelines). Install via ComfyUI Manager - search "Eden.art nodesuite" - or manually:
cd ComfyUI/custom_nodes
git clone https://github.com/edenartlab/eden_comfy_pipelines
cd eden_comfy_pipelines && pip install -r requirements.txt
Restart ComfyUI afterward. Fair warning: the pack pins a lot of dependencies (clip-interrogator, open_clip_torch, transformers, opencv-pythonβ¦) even though this node only needs numpy and torch, so the install is heavier than the node.
Common issues
There isn't much to break here. The main confusion is expecting a MASK output and finding an IMAGE - check what your consumer actually accepts. And remember the gradient is always dark at all four edges regardless of aspect ratio; border_fraction is computed against the larger dimension, so a tall image gets a proportionally bigger border on its long sides. If that's not what you want, resize before you generate.
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| width | INT | 12008β8192 | β |
| height | INT | 8008β8192 | β |
| border_fraction | FLOAT | 0.0300.001β0.5 | β |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| image | IMAGE | β |