Nodes/ComfyUI UX Nodes/Drop Shadow Composite
ComfyUI Node

Drop Shadow Composite

Fake a soft shadow under a cutout, in one node

By Anibaaal·Created 2 years ago·Updated 2 years ago· 2
Drop Shadow Composite
  • foreground
  • background
  • mask
  • IMAGE
shadow_blur10
shadow_opacity0.50
offset_x10
offset_y10
shadow_color#000000

Cut a subject out and paste it onto a new background, and it usually looks pasted - flat, weightless, obviously fake - because real objects cast shadows and your cutout doesn't. Drop Shadow Composite is the fix every design tool has shipped as a default layer style for decades: build a soft, offset, tinted shadow from the subject's own silhouette and composite it underneath, in one pass.

If you're already doing background removal and re-compositing (rembg, BiRefNet, or whatever cut the subject out), this is the finishing-touch node that comes right after it - the difference between "obviously composited" and "actually sits in the scene."

How it works

It takes foreground, background, and a mask (the foreground's silhouette), builds a shadow shape from that mask, and then does three things real shadows always have: offsets it by offset_x/offset_y - light almost never comes from directly overhead, so an un-offset shadow reads as fake immediately - blurs it by shadow_blur (soft edges read as natural light, hard edges read as a sticker outline), and tints it shadow_color at shadow_opacity. The result gets composited underneath the foreground onto the background, all in one output.

The inputs and outputs that matter

  • foreground, background, mask - the subject, the scene it's landing in, and the silhouette the shadow is built from.
  • shadow_blur - 0 to 100, default 10. Higher = softer, more diffuse-looking light.
  • shadow_opacity - 0 to 1, default 0.5. How dark the shadow reads against the background.
  • offset_x / offset_y - -200 to 200, default 10 each. Direction and distance of the implied light source.
  • shadow_color - default #000000.
  • Output: one composited IMAGE.

How to install it

Part of ComfyUI UX Nodes, a small pack from Reddit's Anibaaal - better known there for a popular Flux photo-style LoRA than for node work, which explains the pack's practical, no-frills feel. The README lists node names only, no install section, so use the standard route: ComfyUI Manager, search ComfyUI UX Nodes, install, restart. Or manually:

cd ComfyUI/custom_nodes
git clone https://github.com/Anibaaal/ComfyUI-UX-Nodes

then restart ComfyUI. No models involved - this is pure image compositing.

Common issues & troubleshooting

Noisy or ragged-looking shadows. The shadow is only as clean as the mask it's built from. Background-removal edges are notoriously the weak point of the whole cutout pipeline - fine hair, fur, and thin structures are where every segmentation model still struggles - and any fringe noise left in the mask shows up amplified in the shadow. Clean the mask upstream before this node rather than trying to fix it after.

Shadow reads as a hole cut in the image, not a shadow. Pure black (#000000) at high opacity on a light background can look less like a shadow and more like a black patch. Real shadows are rarely pure black - try a dark tint of the background color instead, and back shadow_opacity down before pushing shadow_blur up.

Looks flat regardless of settings. Check the offset first. A shadow directly underneath the subject with zero offset barely reads as a shadow at all - push offset_x/offset_y enough to imply an actual light direction before tuning blur and opacity.

Categoryimage/composite

Inputs (8)

NameTypeDefaultDescription
foregroundIMAGE
backgroundIMAGE
maskMASK
shadow_blurINT100–100
shadow_opacityFLOAT0.500–1
offset_xINT10-200–200
offset_yINT10-200–200
shadow_colorSTRING#000000

Outputs (1)

NameTypeDescription
IMAGEIMAGE