Layer Duplicate
Copy a layer and nudge the copy — start of every drop shadow
- layers
- layers
- index
The classic way to build a drop shadow by hand - in any image editor - is to duplicate the layer, offset it, and darken the copy. WAS Layer Duplicate is that first step as a node: it copies one layer of a stack and stacks the copy directly above the original, offset by dx and dy.
Mechanically it's honest bookkeeping. The copy carries the same picture, mask, size, angle and blend mode as the original, so at dx/dy of 0 you have two identical layers sitting on top of each other - useless on its own, useful the moment you nudge it. The tooltip lays out the intended workflow in one sentence: it's "the start of a drop shadow, an outline or a repeated element that Layer Edit then changes on its own." Duplicate with a dy of 8, then run the copy through Layer Edit to set its colour to black and its opacity to 40%, and you've got the shadow without touching the original. Same trick with Layer Stroke or a blur for an outline.
Which layer gets copied is picked by index (0 from the back, -1 the front - the default, since you usually copy what's on top) or layer_name. dx and dy are the offset in pixels, positive right and down respectively. The name field is worth using even when you don't care about labels: blank names the copy by appending " copy" to the original's name (Sky becomes Sky copy), which keeps layers tellable apart by name for every other node in the suite that matches on layer_name.
Outputs are layers (the stack with the copy in it, numbered 0 at the back, for Create Layered Image or another edit) and index - where the copy landed, counting from the back. That second output matters if the stack is doing something positional downstream: it tells you exactly which layer is the new one, so a Layer Select or Layer Order downstream doesn't have to guess.
It's a deliberately thin node - one copy, straight up the stack, nothing else. That's fine: its job is to be the building block under effects that are themselves built from copies, and it fits the layer-tools pattern of the suite where small operations chain into big looks. If you find yourself needing several spaced copies of one element (a row of identical badges, a repeated pattern), the trick is to chain duplicates - each one copies the newest layer, so three Layer Duplicates in a row with the right offsets give you four elements with one source.
Install
Part of WAS Node Suite v3. ComfyUI Manager, search "WAS Node Suite", or:
cd ComfyUI/custom_nodes
git clone https://github.com/WASasquatch/was-node-suite-comfyui
Restart after. Needs ComfyUI 0.14.0+ and Python 3.10+, no pip packages or model downloads (the suite's v3 install is clean).
Common issues
- Nothing appears to change. At
dx/dy0 the copy sits exactly on the original. Nudge it, or darken the copy with Layer Edit, before you judge. - The copy isn't what you wanted. Check
index/layer_name- with several layers in the stack, -1 is only the top one. - Can't find which layer is the copy. Give it a
name, or read theindexoutput - it tells you where the copy landed.
Inputs (6)
| Name | Type | Default | Description |
|---|---|---|---|
| layers | LAYERS | The stack holding the layer to copy. Wire in Add Layer, Layer Edit or anything else answering a LAYERS document. | |
| index | INT | -1-16384–16384 | Which layer is copied, counting 0 from the back of the stack. -1 is the front layer. Ignored while layer_name names one. |
| layer_name | STRING | Name of the layer to copy instead of index. Blank uses index. 'sky' finds a layer called Sky, and finds Sky Backdrop where nothing is called exactly Sky. | |
| dx | INT | 0-16384–16384 | Pixels the copy sits right of the original. 0 = straight on top, 8 = 8px right, -8 = 8px left. |
| dy | INT | 0-16384–16384 | Pixels the copy sits below the original. 0 = straight on top, 8 = 8px down, -8 = 8px up. |
| name | STRING | What the copy is called. Blank adds ' copy' to the original's name, so Sky becomes Sky copy and the two stay tellable apart by name. |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| layers | LAYERS | The stack with the copy in it, numbered from 0 at the back, for Create Layered Image or another edit. |
| index | INT | Where the copy landed, counting 0 from the back. |