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

LayerStyle: DropShadow V3

DropShadow V3 — the current drop-shadow node, background now optional

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

A composited cutout looks pasted-on until it casts a shadow. This node is Photoshop's Drop Shadow layer style, done properly - offset, softness, spread, color - as a single ComfyUI node. Give it a subject layer and a mask, and it renders a soft shadow shaped like the subject, offset behind it, and composites the pair.

It's a small effect that does an outsized amount of work toward selling a composite as real. A product dropped onto a new backdrop, a character placed into a scene, a sticker that needs to visually lift off the page - the shadow is what says "this thing is sitting above the surface" instead of "this thing is stuck to the surface." This is V3, the current revision.

How it works

Your layer_mask (or the layer's own alpha, if you invert it correctly) defines the subject's silhouette. The node copies that shape, tints it shadow_color, offsets it by distance_x/distance_y, grows or shrinks it, blurs it soft, and lays it underneath the subject at the given opacity and blend mode. Everything you'd click through in Photoshop's Layer Style dialog is a slider here.

The concrete change in V3 worth knowing: background_image is now optional, not required. Earlier revisions of this node needed a background to composite onto; V3 will run without one, which matters if you want to generate just the shadow-and-subject pair to hand off to a later compositing step rather than baking the background in at this stage.

The inputs and outputs that matter

  • distance_x / distance_y (default 25/25) - how far the shadow's offset from the subject. This is effectively your light direction: positive Y drops the shadow below, negative lifts it above.
  • blur (default 18) - softness. Low reads as a hard, close shadow; high reads as diffuse ambient light. The single biggest lever on how natural it looks.
  • grow (default 6) - spreads the shadow shape outward (or pulls it in on negative values). Photoshop calls this "Spread."
  • opacity (default 50) - real shadows are rarely pure black opacity; 50 is a sane starting point.
  • shadow_color (default #000000, hex) - tint it slightly toward the scene's ambient light color for a more convincing composite.
  • layer_image (required), optional background_image and layer_mask, plus blend_mode (30 options) and invert_mask (default true).

Output: the composited image, shadow baked in.

How to install it

Ships in the LayerStyle pack. ComfyUI Manager - search ComfyUI Layer Style, install, restart. Manually:

cd ComfyUI/custom_nodes
git clone https://github.com/chflame163/ComfyUI_LayerStyle
pip install -r ComfyUI_LayerStyle/requirements.txt

then restart. Lives under 😺dzNodes → LayerStyle. No model to download for this node.

Common issues & troubleshooting

No shadow shows up. Check invert_mask first - if the node reads the background as the subject, the shadow either renders in the wrong region or disappears entirely. Also confirm opacity isn't at 0, and that distance_x/distance_y aren't both 0 (a shadow directly under the subject is hidden by the subject itself).

Shadow reads as a hard, flat cutout rather than a shadow. Raise blur. A crisp copy of the silhouette registers as a second object stacked behind the first, not as cast light. Softness plus a touch of grow is what sells it as ambient.

Shadow's pointing the wrong way relative to the scene's lighting. That's purely distance_x/distance_y - match them to whatever light direction already exists in the plate you're compositing onto.

Node's not there at all. Pack import failure, not this node. LayerStyle's dependency chain is long, and a broken transformers/TensorFlow pairing is the most common way the entire pack fails to load - every node vanishes together. Especially likely on an old, pre-split install (LayerStyle used to ship combined with LayerStyle Advance). Reinstall clean or use "Try Fix" in Manager.

Category😺dzNodes/LayerStyle

Inputs (11)

NameTypeDefaultDescription
layer_imageIMAGE—
invert_maskBOOLEANtrue—
blend_modeCOMBO30 options: normal, dissolve, darken, multiply, color burn, linear burn, +24
opacityINT500–100—
distance_xINT25-9999–9999—
distance_yINT25-9999–9999—
growINT6-9999–9999—
blurINT180–1000—
shadow_colorSTRING#000000—
background_imageoptIMAGE—
layer_maskoptMASK—

Outputs (1)

NameTypeDescription
imageIMAGE—