LayerStyle: DropShadow
DropShadow — drop a proper shadow behind a cutout
- background_image
- layer_image
- layer_mask
- image
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_imageandlayer_image- the scene, and the element casting the shadow.layer_mask(optional MASK) plusinvert_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) andshadow_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.normalandmultiplyare the sane defaults for a shadow. (Yes, the list spells itmultply- 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.
Inputs (11)
| Name | Type | Default | Description |
|---|---|---|---|
| background_image | IMAGE | — | |
| layer_image | IMAGE | — | |
| invert_mask | BOOLEAN | true | — |
| blend_mode | COMBO | 19 options: normal, multply, screen, add, subtract, difference, +13 | |
| opacity | INT | 500–100 | — |
| distance_x | INT | 25-9999–9999 | — |
| distance_y | INT | 25-9999–9999 | — |
| grow | INT | 6-9999–9999 | — |
| blur | INT | 180–100 | — |
| shadow_color | STRING | #000000 | — |
| layer_maskopt | MASK | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| image | IMAGE | — |