Nodes/SD-PPP/SDPPP Get Layer By ID
ComfyUI Node

SDPPP Get Layer By ID

Grab one specific layer out of a Photoshop document

By zombieyang·Created 2 years ago·Updated 7 months ago· 2,150
SDPPP Get Layer By ID
  • document
  • layer_or_group
  • layer boundary
  • layer_info
layer_or_group

Once you've got a DOCUMENT handle from SDPPP Get Document, this is how you reach inside it and grab a specific layer by name. It hands you three things at once: the LAYER handle for that layer, a mask of its boundary, and its metadata - which is usually more than you need, but it means one node covers both "get me this layer" and "tell me about this layer."

How it works

You feed it the document you're working on plus the layer's name - which, like the document picker, is a live dropdown populated from the connected Photoshop instance, so you're choosing from the actual layers in that file rather than typing names that might not match. On run, it calls the plugin's getLayerInfo action over the Socket.IO bridge. Photoshop resolves the layer, and the node wraps what comes back into a LAYER handle and a boundary mask at document resolution.

Inputs and outputs

  • document - a DOCUMENT handle from SDPPP Get Document. Required, and worth saying: this is why Get Document exists. Without a document to anchor to, "which layer?" is meaningless.
  • layer_or_group - the layer picker. Select by name from the dropdown.

Outputs:

  • layer_or_group - the LAYER handle. Wire it into SDPPP Get Layers In Group (if it's a group), SDPPP Get Linked Layers, SDPPP Get Text From Layer, or the send nodes.
  • layer boundary - a MASK of the layer's bounds, handy for regional prompting or compositing.
  • layer_info - the LAYER_INFO blob. Feed it to SDPPP Parse Layer Info to get opacity, bounds, and name as plain numbers.

When you'd bother

This node earns its keep in stable, repeatable workflows where the same named layer is your anchor every run - say, a "character" layer you always pull to drive a ControlNet, or a "subject" layer whose boundary becomes your regional prompt mask. Because the picker is by name, it survives minor layout changes in the PSD as long as the layer keeps its name.

Install and the usual traps

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

And the pack-wide rule: plugin and custom node versions must match or Photoshop won't connect ("version mismatch, please reinstall PS plugin") and the layer dropdown stays empty. If the dropdown is empty, the plugin isn't attached - connect it in Photoshop before anything lists.

CategorySD-PPP

Inputs (2)

NameTypeDefaultDescription
documentDOCUMENT
layer_or_groupSTRING

Outputs (3)

NameTypeDescription
layer_or_groupLAYER
layer boundaryMASK
layer_infoLAYER_INFO