Layer Effect: Color Overlay (MEC)
Recolour a subject without touching the rest of the frame
- layer_image
- background_image
- layer_mask
- image
- effect_mask
- report
What it's for
You have a matte and you want to change what's inside it: tint the jacket red, give a prop a corporate colour, push a whole layer toward a mood, flatten a subject into a silhouette for a comp. It's the layer-style equivalent of a colour wash with a mask, and having it as a node means you stop round-tripping through a compositor for what is one solid fill and a blend mode.
One honest caveat up front: this is a flat colour plus a blend mode, not a recolouring model. Change the hue of a red jacket to blue with color mode and you'll get something - you'll get a better something with a proper recolour or an edit model. Where this node earns its place is tinting, flattening, and pushing, which are things a solid fill genuinely does well.
How it works
The node makes a solid fill in color, blends it against a copy of the layer image itself using your blend_mode at opacity, and then composites that blended result onto the plate through the layer matte. So the subject area gets the recoloured version and everything outside the matte is untouched original plate. Nothing is passed through a model and nothing else in the frame moves.
effect_mask is explicitly the resolved layer mask - the matte after the invert and after any resize to match the layer - not a separate halo or a coverage map. The node's own description calls this out, and it's a deliberate design choice in this port: for the footprint-style effects (shadow, glow, stroke) the second output is the effect's own band, and here it's the region you operated on. Worth knowing before you wire it somewhere expecting a difference matte.
The 30 blend modes include normal, multiply, screen, darken/lighten, color burn/color dodge, linear dodge(add) and dissolve. For tinting, color, soft light, overlay and multiply are the useful half; normal at partial opacity is the blunt instrument that actually solves most requests. dissolve is stochastic - the node exposes a dissolve_seed, fixed by default so the dither pattern holds still across a sequence instead of crawling, which is what upstream did.
Inputs
- layer_image - the thing being recoloured. If it's RGBA, the alpha defines the layer when no mask is connected.
- layer_mask (optional) - the matte. One of this and the alpha is required; a 3-channel image with nothing connected raises
needs a layer maskrather than quietly doing nothing. - invert_mask - defaults to true, and it inverts the matte for real. With a normal white-on-subject mask and the default, you are recolouring the background. This is the single most common "why is this node broken" with the whole layer-effect family; check it first.
- color - hex, default
#FFBF30. Our old friend the stock orange. - blend_mode, opacity (0–100) - pick the interaction, then dial the amount.
- background_image (optional) - the plate. Empty means a transparent canvas, which as an RGB output is black outside the subject.
Outputs: image, effect_mask, report.
Recipes
- Tint a subject:
soft light, opacity 30–60, a desaturated colour. You keep the shading, you move the hue. - Flatten to a silhouette:
normal, opacity 100, near-black. Combined withlayer_maskyou've got a solid matte-cropped shape, which is useful for thumbnails and graphic layouts. - Warm a whole frame: no mask needed conceptually, but you still need one - wire the matte and invert the polarity to cover the frame, or feed a full-white matte from
Mask Gradient (MEC)with start and end both at 1. - Match a plate's cast on a pasted subject: a small
multiplywith the plate's average colour at 10–20%. Crude, but it works, andSmart Image Stitchhas a proper colour-match option if you're in that pipeline.
Install
ComfyUI Manager → search "CustomNodePacks", or:
cd ComfyUI/custom_nodes
git clone https://github.com/Code2Collapse/ComfyUI-CustomNodePacks
Restart ComfyUI. Pack dependencies are opencv-python, scipy, safetensors; this effect is tier 1 - no model, no VRAM, torch.no_grad() throughout. This is a standalone torch-native port of upsteam ComfyUI_LayerStyle's colour overlay, so you don't need that (much larger, much heavier) pack installed to use it. Usual README warning: don't blind-run pip install -r requirements.txt.
Common issues
- Nothing changes. Opacity 0, or
invert_maskon its default with a standard matte so the fill is landing outside the subject, or the fill is genuinely invisible against the colours underneath -multiplywith white does nothing, as doesscreenwith black. - The change leaks past the matte. Your mask is soft where you thought it was hard. Feathering is usually good; here it means a visible tint gradient at the boundary. Tighten the matte or run it through
Mask Refine (MEC)first.
Inputs (8)
| Name | Type | Default | Description |
|---|---|---|---|
| layer_image | IMAGE | — | |
| invert_mask | BOOLEAN | true | — |
| blend_mode | COMBO | 30 options: normal, dissolve, darken, multiply, color burn, linear burn, +24 | |
| opacity | INT | 1000–100 | — |
| color | STRING | #FFBF30 | — |
| dissolve_seed | INT | 00–2147483647 | Only used by the 'dissolve' blend mode. Upstream reseeds every frame, so a dissolve flickers through a sequence; a fixed seed here holds still. |
| background_imageopt | IMAGE | — | |
| layer_maskopt | MASK | — |
Outputs (3)
| Name | Type | Description |
|---|---|---|
| image | IMAGE | — |
| effect_mask | MASK | — |
| report | STRING | — |