Nodes/ComfyUI Layer Style/LayerStyle: DropShadow
ComfyUI Node Runs on cloud

LayerStyle: DropShadow

DropShadow — drop a proper shadow behind a cutout

By chflame163·Created 3 years ago·Updated 5 days ago· 3,113
LayerStyle: DropShadow
  • background_image
  • layer_image
  • layer_mask
  • image
â—„invert_masktrueâ–º
◄blend_mode▾►
â—„opacity50â–º
â—„distance_x25â–º
â—„distance_y25â–º
â—„grow6â–º
â—„blur18â–º
â—„shadow_color#000000â–º

This is the node the whole pack is named after - a Photoshop layer style, brought into ComfyUI. DropShadow takes a subject (usually a cutout you've already masked off a background), casts a soft, offset shadow behind it, and composites the result over a background image. If you're doing product mockups, sticker-style graphics, or anything where a floating element needs to sit on a surface instead of looking pasted on, this is exactly the tool.

How it works

A drop shadow is a blurred, offset, tinted copy of the layer's silhouette, painted behind it. So the node needs to know the layer's shape - that comes from a mask (or the layer image's alpha) - then it offsets that shape, grows or shrinks it, blurs it, tints it, and blends it onto the background under the layer. The realism lives in the interaction of offset, spread, and blur, which is why there are separate controls for each.

The inputs that matter

  • background_image and layer_image - the scene, and the element casting the shadow.
  • layer_mask (optional MASK) plus invert_mask - the silhouette. If your cutout carries alpha you may not need a separate mask; invert_mask (default on) flips it if the shadow comes out around the wrong region.
  • distance_x / distance_y (default 25 each) - how far the shadow is offset. Bigger offset reads as the object floating higher off the surface.
  • blur (default 18) - softness. Low blur is a hard, close shadow; high blur is a soft, distant one.
  • grow (default 6) - expands or contracts the shadow shape before blurring, controlling its spread.
  • opacity (default 50) and shadow_color (default black) - how dark and what tint. Real shadows aren't pure black; a very dark blue or the scene's ambient color often looks better.
  • blend_mode - 19 Photoshop-style modes. normal and multiply are the sane defaults for a shadow. (Yes, the list spells it multply - a long-standing typo in the node, not your eyes.)

Output is a single image - the layer composited over the background with its shadow.

How to install it

ComfyUI Manager: search ComfyUI Layer Style, install, restart. Or:

cd ComfyUI/custom_nodes
git clone https://github.com/chflame163/ComfyUI_LayerStyle

install requirements.txt, restart. It's under 😺dzNodes → LayerStyle.

Common issues

The most common one is the shadow appearing on the wrong side of the mask - the subject is shadowed instead of the background, or the whole frame darkens. That's invert_mask; toggle it. Second: no visible shadow at all usually means the node has no silhouette to work from, so make sure a layer_mask is connected or the layer image genuinely has alpha. Third, the look. A pure-black shadow at full opacity and zero blur screams "pasted graphic" - soften it with blur, pull opacity down toward 30–40, and tint shadow_color slightly toward the scene, and the element starts sitting in the picture instead of on top of it.

Category😺dzNodes/LayerStyle

Inputs (11)

NameTypeDefaultDescription
background_imageIMAGE—
layer_imageIMAGE—
invert_maskBOOLEANtrue—
blend_modeCOMBO19 options: normal, multply, screen, add, subtract, difference, +13
opacityINT500–100—
distance_xINT25-9999–9999—
distance_yINT25-9999–9999—
growINT6-9999–9999—
blurINT180–100—
shadow_colorSTRING#000000—
layer_maskoptMASK—

Outputs (1)

NameTypeDescription
imageIMAGE—