Nodes/SD-PPP/SDPPP Get Linked Layers
ComfyUI Node

SDPPP Get Linked Layers

Get every layer linked to the one you picked

By zombieyang·Created 2 years ago·Updated 7 months ago· 2,150
SDPPP Get Linked Layers
  • layer_or_group
  • layer_or_group
  • layer_boundary
  • layer_info
selectall

Photoshop's layer-linking feature is easy to forget about, but it's a tidy way to group layers that should move together without wrapping them in a group folder. This node is the one that respects that relationship: give it a LAYER handle and it returns every layer linked to it, plus each one's boundary mask and metadata, as parallel lists. It's the same shape as SDPPP Get Layers In Group, just keyed off the link chain instead of the folder tree.

How it works

You feed it a layer handle - from SDPPP Get Layer By ID, SDPPP Get Document-anchored sources, or a send node's output. It asks the PS plugin for that layer's linked siblings over the Socket.IO bridge, with the same select filter applied: all returns every linked layer, text or image narrows to those types, and first takes just the first one. Results come back as three index-aligned lists.

Inputs

  • layer_or_group - the anchor layer. The node returns the layers linked to it, not the layer itself.
  • select - all (default), text, image, or first. Filtering happens in Photoshop, so on big files it's also a bandwidth save.

Outputs

  • layer_or_group - a LAYER list of the linked layers.
  • layer_boundary - a MASK list of their bounds.
  • layer_info - a LAYER_INFO list, ready for SDPPP Parse Layer Info.

Index alignment matters - layer_info[i] describes layer_or_group[i] - same contract as Get Layers In Group.

When it's the right tool

Honestly, this is a niche node. It shines when a project was organized with links instead of groups - common when someone's assembling a composite where linked layers move as a unit but live in different parts of the stack. If the linked set is what you want to batch-process (say, all the linked layers are frames or variants), this gets you the whole set in one call. If your document doesn't use linking at all, the output will simply be empty - in that case you want SDPPP Get Layers In Group instead.

Install and the usual traps

ComfyUI Manager, search sd-ppp (or git clone https://github.com/zombieyang/sd-ppp into ComfyUI/custom_nodes), restart. The pack auto-installs python-socketio and jsonpatch on first import - no manual pip. The Photoshop plugin comes from sdppp.zombee.tech as a .ccx (double-click with Creative Cloud, or rename to .zip and extract into the Photoshop Plug-ins folder).

The pack-wide gotcha applies here too: plugin and custom node must be on matching versions, or Photoshop won't attach ("version mismatch, please reinstall PS plugin") and you'll get nothing from this node. And if a layer is linked to nothing, an empty result isn't a bug - it's Photoshop telling you there's no chain to follow.

CategorySD-PPP

Inputs (2)

NameTypeDefaultDescription
layer_or_groupLAYER
selectCOMBOall4 options: all, text, image, first

Outputs (3)

NameTypeDescription
layer_or_groupLAYER
layer_boundaryMASK
layer_infoLAYER_INFO