ComfyUI Node Runs on cloud

Layer Shadow

Cast a shadow off a cut-out without leaving the stack

By WASasquatch·Created 3 years ago·Updated 4 days ago· 1,844
Layer Shadow
  • layers
  • layers
layer_index-1
layer_name
shadow_typedrop
angle315
distance12
spread0.00
size12
color#000000
opacity0.60
blend_modenormal

Drop shadows are the fastest way to make a cut-out feel placed on a plate instead of pasted on top of it, and Layer Shadow is the one-layer version of that trick inside the LAYERS stack. A drop shadow sits behind the layer's own pixels and lifts a subject off whatever's underneath; an inner shadow sits inside the edge and sinks the layer into it - the pressed-in look you want for embossed text or a badge set into a panel. Pick the layer, dial in angle, distance and softness, and the shadow is baked into that layer and its transparency without touching anything else in your composite.

The controls that matter

The physics are conventional Photoshop, which means the defaults get you a decent result fast:

  • shadow_type - drop behind the layer, inner inside its coverage.
  • angle - degrees counter-clockwise from pointing right. 315 (down-right) is the default and matches how most people light: light from top-left, shadow thrown down-right. An inner shadow lands on the opposite side, because it's the shadowed side of a recessed edge.
  • distance - how far the shadow moves from the layer, in pixels. 0 is directly behind, 12 a small lift, 60 thrown well clear.
  • size - blur radius. 0 is a hard-edged copy (useful as a deliberate cut-out silhouette), 12 a soft contact shadow, 64 a broad haze.
  • spread - the share of size spent hardening the shadow's core rather than blurring it. 0.5 gives a solid core with a soft rim, which reads far more "real" than an even blur.
  • opacity and color - 0.6 with black is a natural cast; a dark violet like #1a0033 is the classic way to fake a coloured light source.
  • blend_mode - where shadow overlaps the layer's own pixels. multiply is the honest darken; screen flips it into a glow.

A layer is picked by layer_index (0 = bottom, -1 = top) or layer_name. Output is the stack with the shadow baked in, ready for the next effect or Create Layered Image.

How it works under the hood

Same family as the glow and stroke nodes: the effect takes the layer's actual coverage - not its rectangle - grows or shifts it by distance, blurs it by size, and composites it behind. That's why a shadow follows the silhouette of a cut-out subject and not its bounding box. An outer shadow grows the layer's picture and shifts it back on the canvas so the layer stays where it was visually. Give the stack a canvas (Layers Canvas) if you want a shadow that runs off the plate edge rather than silently inflating the document.

Installing it

Part of WAS Node Suite:

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

or ComfyUI Manager → "WAS Node Suite v3", then restart. Requires ComfyUI 0.14.0+ and Python 3.10+; v3 installs no pip packages.

Where people trip

The most common disappointment: a layer that fills its whole frame casts a shadow the size of the frame - the shadow follows coverage, so you need transparency or a mask for a shaped shadow. And an inner shadow needs the light angle to make sense or it reads as a glow; if your inner shadow looks inverted, flip the angle 180° rather than fighting distance. Finally, at size 0 the "shadow" is a hard opaque copy of the layer offset by distance - great for sticker silhouettes, baffling if you expected softness and left size at 0.

CategoryWAS Suite/Image/Layers

Inputs (11)

NameTypeDefaultDescription
layersLAYERSThe stack holding the layer to shade. Wire in Add Layer, Layers From Bounding Boxes, or another layer effect to stack effects up.
layer_indexINT-1-1000–1000Which layer to shade 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 shade, matched ignoring case and spare space. Empty reads layer_index instead. 'subject' picks the layer Add Layer was given that name.
shadow_typeCOMBOdropWhich side of the edge the shadow falls on. `drop` sits behind the layer and grows it, `inner` sits inside the layer's own coverage on the side the light does not reach and grows nothing.
angleFLOAT315-360–360Degrees the shadow is thrown at, counted counter-clockwise from pointing right. 0 = right, 90 = up, 180 = left, 315 = down and to the right. An inner shadow lands on the opposite side.
distanceINT120–256Pixels the shadow moves from the layer. 0 = directly behind it, 12 = a small lift, 60 = thrown well clear.
spreadFLOAT0.000–1Share of size spent hardening the shadow's edge rather than blurring it. 0.0 = a soft falloff, 0.5 = a solid core with a soft rim, 1.0 = a hard silhouette.
sizeINT120–128Blur radius in pixels. 0 = a hard-edged copy, 12 = a soft contact shadow, 64 = a broad haze.
colorSTRING#000000Colour of the shadow, as hexadecimal digits. #000000 = black, #1a0033 = a cool dark violet. Three digits such as #103 work too.
opacityFLOAT0.600–1How strongly the shadow is laid down. 1.0 = solid, 0.6 = a natural cast, 0.0 = nothing.
blend_modeCOMBOnormalHow the shadow mixes with the layer's own pixels where the two overlap. `normal` lays the colour down as it is, `multiply` darkens, `screen` lightens.

Outputs (1)

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