Image Mask Composite πΌοΈ
Darken, blur, or tint a region β with a real mask you control
- image
- mask
- image
- mask_out
Sometimes you don't want to change a whole image - you want to darken one corner, blur one region, tint a shape. That's a masked edit, and doing it properly means building a mask and compositing. Image Mask Composite folds that whole two-step into one node: it draws a mask region (geometric or from an external mask) and applies an effect inside it, in a single pass.
Start with mask_shape:
rectangle/ellipse- positioned withx/yand sized withwidth/height(all fractions of the image, 0β1, so a 0.25/0.25 rectangle at 0.5Γ0.5 sits in the middle-left quadrant).gradient_h/gradient_v- horizontal or vertical soft gradients, for the "fade this side" look.external- connect aMASKsocket and it uses that instead of drawing anything. This is the powerful one: any mask from a segmenter, a face detector, a manual paint-in node.
Then pick the effect, applied only inside the mask: darken (multiply by darken_amount), brighten (add brighten_amount), desaturate (to grayscale), solid_color (fill with color_r/color_g/color_b - the default red is fine for testing, useless for real work), invert (photographic negative), or blur (Gaussian, blur_radius). feather softens the mask edge so edits don't look cut out with scissors, and invert_mask flips which side the effect applies to - effectively "everywhere except this region."
Outputs: the edited image, and mask_out - the mask that was actually used, which is genuinely useful because you can feed it onward (e.g. into an inpaint step, or as the region for another node). The fact that the node tells you the mask it used instead of hiding it is the kind of design detail that makes a pipeline debuggable.
Where it earns its keep: localized fixes without leaving ComfyUI - darkening a blown-out window region, blurring a background area before a compositing pass, desaturating a background so the subject pops, or tinting a shape for a graphic. For "darken the edges" specifically, the pack also has Image Vignette & Glow, which does a radial falloff in one knob instead; this node is for arbitrary regions, which is a strictly bigger job.
One honest boundary: the geometric shapes are axis-aligned boxes and ellipses - no arbitrary polygon drawing here. If you need a freeform region, that's what the external mask path is for. And it applies effects to one image; for blending two images together you want the pack's Image Blend, not this node. The docstring says exactly that, and it's worth respecting - mixing them up is the beginner failure mode.
Install
Part of OmniNodes:
cd ComfyUI/custom_nodes
git clone https://github.com/TensorVizion/OmniNodes
Restart ComfyUI, or install "OmniNodes" via ComfyUI Manager. No extra dependencies - PyTorch and NumPy.
Troubleshooting
- Effect applied everywhere -
invert_maskis on, or the feather is so large it bled past the region. Check both. - External mask does nothing -
mask_shapemust be set toexternal; connecting a mask whilemask_shapeis stillrectangleignores it. - Edges look harsh - raise
feather. 0.05 default is subtle.
Inputs (16)
| Name | Type | Default | Description |
|---|---|---|---|
| image | IMAGE | β | |
| mask_shape | COMBO | 5 options: rectangle, ellipse, gradient_h, gradient_v, external | |
| effect | COMBO | 6 options: darken, brighten, desaturate, solid_color, invert, blur | |
| x | FLOAT | 0.250β1 | β |
| y | FLOAT | 0.250β1 | β |
| width | FLOAT | 0.500β1 | β |
| height | FLOAT | 0.500β1 | β |
| feather | FLOAT | 0.050β0.5 | β |
| invert_mask | BOOLEAN | false | β |
| darken_amount | FLOAT | 0.500β1 | β |
| brighten_amount | FLOAT | 0.300β1 | β |
| blur_radius | INT | 91β51 | β |
| color_r | INT | 2550β255 | β |
| color_g | INT | 00β255 | β |
| color_b | INT | 00β255 | β |
| maskopt | MASK | β |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| image | IMAGE | β |
| mask_out | MASK | β |