LayerStyle: DropShadow V2
DropShadow V2 — a real soft drop shadow behind your cutout
- background_image
- layer_image
- layer_mask
- image
Composited cutouts look pasted-on until they cast a shadow. This node adds one - the Photoshop drop-shadow layer style, done properly with offset, softness, spread and color. You hand it a background, a foreground layer, and a mask, and it renders a soft shadow shaped like the subject, offset behind it, then composites the lot.
It's a small thing that does most of the work of making a composite believable. A product on a new background, a character dropped into a scene, a sticker that needs to lift off the page - the shadow is what sells the depth. This is the V2, the current version.
How it works
The mask gives the subject's silhouette. The node copies that shape, colors it (black by default), offsets it by your X/Y distance, grows or shrinks it, blurs it soft, and lays it under the subject at the chosen opacity and blend mode. Everything you'd set in Photoshop's Layer Style dialog is here as a slider.
The inputs and outputs that matter
distance_x/distance_y(default 25/25) - how far the shadow is offset from the subject. This is your light direction: positive Y drops it below, negative lifts it above, and the X/Y combo says where the light's coming from.blur(default 18) - softness. Low is a hard, close shadow; high is a diffuse ambient one. The single biggest lever on how natural it looks.grow(default 6) - spreads the shadow shape outward (or pulls it in, negative). Think Photoshop's "Spread."opacity(default 50) - shadows are rarely pure black; 50 is a sane start.shadow_color(default#000000) - hex. Tint it slightly toward the scene's ambient color for extra realism.background_image,layer_image, optionallayer_mask, plusblend_mode(30 modes) andinvert_mask(default true).
Output: the composited image with the shadow baked in.
How to install it
Ships in the LayerStyle pack. Via ComfyUI Manager: search LayerStyle, install, restart. Manually:
cd ComfyUI/custom_nodes
git clone https://github.com/chflame163/ComfyUI_LayerStyle
pip install -r ComfyUI_LayerStyle/requirements.txt
then restart. It's under 😺dzNodes → LayerStyle. No model to download for this node.
Common issues & troubleshooting
No shadow shows up. Usually invert_mask. If the node thinks the background is the subject, the shadow renders in the wrong region or not at all - flip it. Also confirm opacity isn't at 0 and distance_x/distance_y aren't both 0 (a shadow directly under the subject is hidden by it).
Shadow looks like a hard cutout. Raise blur. A crisp copy of the silhouette reads as a second object, not a shadow. Softness plus a little grow is what makes it ambient.
Shadow direction is wrong. That's just distance_x/distance_y - they set the offset, so they set where the light appears to be. Match them to any lighting already in the background plate.
The node isn't there. The pack didn't import. LayerStyle's most common failure is a broken transformers dependency (frequently a stray TensorFlow) crashing the whole pack on load - every node disappears together. Check the startup traceback, use "Try Fix," or fix the named library.
Inputs (11)
| Name | Type | Default | Description |
|---|---|---|---|
| background_image | IMAGE | — | |
| layer_image | IMAGE | — | |
| invert_mask | BOOLEAN | true | — |
| blend_mode | COMBO | 30 options: normal, dissolve, darken, multiply, color burn, linear burn, +24 | |
| 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 | — |