Nodes/WAS Node Suite v3/Layer Overlay
ComfyUI Node Runs on cloud

Layer Overlay

Fill a cut-out with flat colour or a gradient, clipped to its shape

By WASasquatch·Created 3 years ago·Updated 4 days ago· 1,844
Layer Overlay
  • layers
  • layers
layer_index-1
layer_name
fillflat
color#ff8800
color_b#0088ff
angle90
opacity1.00
blend_modenormal

Recolouring a cut-out subject, tinting a title, or grading one element of a composite without touching the rest - that's Layer Overlay's job. It paints one layer in a stack with a flat colour or a two-stop linear gradient, held inside whatever that layer already covers. The shape, size and placement are left exactly as they were. Think of it as a clipped fill layer in an image editor: the colour only lands where the layer's own pixels are, not across its whole rectangle.

What the fill does

The fill dropdown switches between two modes. flat uses color everywhere. gradient runs from color to color_b across the layer at whatever angle you set - 0 puts the first stop on the left, 90 runs bottom-to-top, counted counter-clockwise. Three-digit hex like #f80 works alongside full six-digit codes.

Two controls shape how the fill lands:

  • opacity - 1.0 replaces the layer's own colours outright (great for turning a cut-out into a flat silhouette or a solid-colour badge), 0.4 sits on top as a tint, 0.0 is a no-op.
  • blend_mode - how the fill mixes with what's underneath. color keeps the layer's light and takes the fill's hue, which is the one you want when recolouring a subject you want to still look dimensional. multiply darkens, overlay keeps contrast, normal just replaces.

Because the fill is clipped to the layer's coverage, it respects whatever mask the layer carries. So a text layer gets its letters painted, a cut-out gets its silhouette recoloured, and the empty space around them stays empty.

The workflow shape

You feed it a LAYERS document and pick the target layer with layer_index (0 = bottom, -1 = top) or layer_name; an empty name reads the index. Output is the stack with the fill baked into that layer's picture - chain it into another effect or flatten with Create Layered Image. A common pattern is to keep the natural subject, duplicate it underneath with Layer Duplicate, paint the copy flat (opacity 1.0) and offset it as a duotone shadow, or to grade a background layer cool and a foreground subject warm by running two Overlay nodes on different named layers.

It's worth knowing where this fits versus Layer Replace Image: Overlay repaints within the layer's existing shape and placement; Replace Image swaps the whole picture in. If you want a new picture but want to keep where it sits, that's Replace Image. If you want the picture you've got but recoloured, this is the node.

Installing it

Layer Overlay ships in WAS Node Suite. Manager → "WAS Node Suite v3", or clone it once:

cd ComfyUI/custom_nodes
git clone https://github.com/WASasquatch/was-node-suite-comfyui.git

Restart and it's there. Requires ComfyUI 0.14.0+ and Python 3.10+; no extra pip packages in v3.

Where people trip

The most common surprise is expecting the fill to respect the visual edge of a semi-transparent subject when it actually replaces colour everywhere the layer has any coverage - feather fades to nothing because the fill is multiplied by the layer's alpha too. If you want a solid fill that ignores a soft edge, raise the mask or trim first. And a flat fill at full opacity destroys all shading by design - if the result looks like a sticker, drop the opacity and switch to color blend mode, which keeps the layer's own light while borrowing the fill's hue. That one control is the difference between "painted over" and "recoloured properly."

CategoryWAS Suite/Image/Layers

Inputs (9)

NameTypeDefaultDescription
layersLAYERSThe stack holding the layer to paint. Wire in Add Layer, Layers From Bounding Boxes, or another layer effect to stack effects up.
layer_indexINT-1-1000–1000Which layer to paint when layer_name is empty. -1 = the top of the stack, -2 = the one below it, 0 = the bottom, 1 = the next one up.
layer_nameSTRINGName of the layer to paint, matched ignoring case and spare space. Empty reads layer_index instead. 'subject' picks the layer Add Layer was given that name.
fillCOMBOflatWhat the layer is painted with. `flat` uses color everywhere, `gradient` runs from color to color_b across the layer at the angle set below.
colorSTRING#ff8800The flat colour, or the first stop of a gradient, as hexadecimal digits. #ff8800 = orange, #ffffff = white. Three digits such as #f80 work too.
color_bSTRING#0088ffThe second stop of a gradient, as hexadecimal digits. #0088ff = blue, #000000 = black. Read only when fill is `gradient`.
angleFLOAT90-360–360Degrees the gradient runs at, counted counter-clockwise from pointing right. 0 = color at the left and color_b at the right, 90 = color at the bottom and color_b at the top.
opacityFLOAT1.000–1How strongly the fill is laid down. 1.0 = the layer's own colours are replaced, 0.4 = a tint over them, 0.0 = nothing.
blend_modeCOMBOnormalHow the fill mixes with the layer's own pixels. `normal` replaces them, `color` keeps their light and takes the fill's hue, `multiply` darkens, `overlay` keeps contrast.

Outputs (1)

NameTypeDescription
layersLAYERSThe stack with the fill baked into that layer's picture. Wire it into Create Layered Image or the next effect.