Nodes/Orion4D_layer_manager/πŸŒ‘ Drop Shadow
ComfyUI Node

πŸŒ‘ Drop Shadow

Drop shadows without leaving ComfyUI β€” and they're good ones

By orion4dΒ·Created about a month agoΒ·Updated about a month agoΒ· 2
πŸŒ‘ Drop Shadow
  • image
  • mask
  • image
  • mask
  • rgba_image
  • shadow_rgba
  • shadow_mask
β—„canvas_width1024β–Ί
β—„canvas_height1024β–Ί
β—„scale_percent-15.0β–Ί
β—„shadow_modeouterβ–Ί
β—„shadow_spread0β–Ί
β—„shadow_blur24.0β–Ί
β—„shadow_offset_x24β–Ί
β—„shadow_offset_y24β–Ί
β—„shadow_opacity0.55β–Ί
β—„shadow_color#000000β–Ί
β—„background_modetransparentβ–Ί
β—„background_color#FFFFFFβ–Ί

Every compositor's dirty secret is that a decent drop shadow takes about five fiddly steps in a pixel editor, and doing it in ComfyUI used to mean hand-building a blur, a shift, a composite, and a mask from scratch. The Drop Shadow node from the Orion4D Layer Manager pack collapses all of that into one node with a visual editor: pick the shadow direction, drag the blur, hit Apply, and it hands you a clean RGBA result plus the shadow as its own mask. If you're doing product shots, floating cards, or "subject on a new background" work, this is the one you'll reach for.

How it works

The pipeline is classic shadow math, and it reads like a Photoshop recipe: take the image's alpha channel (or your mask), scale it to the canvas, center it, dilate by shadow_spread, shift by the offset, run a Gaussian blur by shadow_blur, tint with shadow_color, and composite under the object. In outer mode the shadow grows out from the object's edges; in inner mode it's computed as alpha Γ— (1 βˆ’ inner_seed), which gives you that soft shadow inside the shape - the pressed-button look.

Two outputs deserve a callout: shadow_rgba and shadow_mask. Most drop shadow nodes just flatten everything and dare you to like it. This one hands you the shadow as its own layer, which is huge if you want to blur it separately, recolor it later, or animate it - the compositing work is already done for you.

The inputs that matter

  • image - required. The shadow is built from the image's alpha channel if it has one; otherwise the whole image is treated as opaque.
  • mask - optional, and the trap lives here. The code computes alpha as 1 βˆ’ mask, the ComfyUI-inverted convention. If you feed a "keep the object" mask (white on your subject, the normal way you'd think about it), the object reads as transparent and the shadow wraps the background instead. Flip the mask - black on your object - and it works. There's no toggle for this, unlike Layer Manager's invert_input_masks, so flip it upstream.
  • scale_percent - object size relative to the canvas, default βˆ’15 (i.e. shrink 15%). The canvas is canvas_width Γ— canvas_height (both default 1024); the object is centered and scaled onto it.
  • shadow_spread, shadow_blur, shadow_offset_x/shadow_offset_y, shadow_opacity - spread grows the shadow seed, blur feathers it (default 24), the offsets move it (default 24/24), opacity caps it (default 0.55).
  • shadow_mode - outer or inner.
  • shadow_color, background_mode, background_color - the tint, and whether the canvas behind everything is transparent or a solid color. Transparent keeps a true RGBA out; color gives you a flattened, viewable image.

Outputs

image (RGB flattened on the background color), mask (the composite alpha), rgba_image (true transparency preserved), shadow_rgba (the shadow alone, tinted), and shadow_mask (the shadow's alpha). Five sockets, but the ones you'll actually wire are rgba_image for further compositing and shadow_mask when you want to grade the shadow by hand.

Install

No model downloads, no extra deps - just the NumPy/Pillow/PyTorch ComfyUI already has:

cd ComfyUI/custom_nodes
git clone https://github.com/orion4d/Orion4D_layer_manager

Restart ComfyUI. Manager users: search Orion4D_layer_manager under "Install Custom Nodes." Presets live in presets_shadows/ (the pack ships "Hard Shadow" and "Soft Shadow") and you can save your own from the editor.

Common issues

  • Shadow hugs the background instead of the object. Your mask is flipped - see the note above. Flip it and rerun.
  • App window won't open. Allow pop-ups for your local ComfyUI address.
  • Big blurs are slow. Gaussian blur on large canvases is the pack's documented hot spot. A 4096px canvas with blur at 200+ will make you wait; work at preview size and upscale the composite later.
CategoryOrion4D_Layer

Inputs (14)

NameTypeDefaultDescription
imageIMAGEβ€”
canvas_widthINT10241–8192β€”
canvas_heightINT10241–8192β€”
scale_percentFLOAT-15.0-99–500β€”
shadow_modeCOMBOouter2 options: outer, inner
shadow_spreadINT00–256β€”
shadow_blurFLOAT24.00–256β€”
shadow_offset_xINT24-4096–4096β€”
shadow_offset_yINT24-4096–4096β€”
shadow_opacityFLOAT0.550–1β€”
shadow_colorSTRING#000000β€”
background_modeCOMBOtransparent2 options: transparent, color
background_colorSTRING#FFFFFFβ€”
maskoptMASKβ€”

Outputs (5)

NameTypeDescription
imageIMAGEβ€”
maskMASKβ€”
rgba_imageIMAGEβ€”
shadow_rgbaIMAGEβ€”
shadow_maskMASKβ€”