Nodes/SD-PPP/SDPPP Get Layers In Group
ComfyUI Node

SDPPP Get Layers In Group

Expand a Photoshop group into a list of its layers

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

Photoshop groups are folders, and ComfyUI is a batch machine - this node is the adapter between the two. Feed it a LAYER handle that points at a group, and it returns every layer inside it as a list, along with each child's boundary mask and metadata. If you keep your PSD organized into groups (and you should), this is how a whole folder of layers becomes a batch you can process in one go.

How it works

You hand it a group handle - from SDPPP Get Layer By ID, or from another Get Layers In Group if you're recursing. On run it asks the PS plugin, via the Socket.IO bridge, for the group's children. The select option filters what comes back before it's shipped across: all (default) grabs everything, text or image keeps only text or raster layers, and first just takes the top child. The results come back as three parallel lists.

Inputs

  • layer_or_group - the group. If you feed it a plain layer instead of a group, there are no children and you get an empty result, so make sure the handle points at a folder.
  • select - all, text, image, or first. The filter is applied in Photoshop, not in ComfyUI, so it's also a small efficiency win on big documents.

Outputs

  • layer_or_group - a LAYER list, one entry per child. This is the batch you iterate over.
  • layer_boundary - a matching MASK list of each child's bounds.
  • layer_info - a matching LAYER_INFO list, ready for SDPPP Parse Layer Info.

All three lists stay index-aligned, which is the thing to remember: layer_info[2] belongs to layer_or_group[2]. Don't scramble them.

The batch pattern

The reason this node exists: SDPPP Get Layers In Group (select all) → Get Image From Photoshop Layer on each → process → Send Images To Photoshop back. All the frames of an animation, all the layers of a character sheet, all the icons in a UI pack - one run instead of N manual pulls. select: image is a nice way to skip text layers that would come back as empty images anyway.

Install and gotchas

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

Standard pack trap: plugin and node pack must be on matching versions, or you'll see "version mismatch, please reinstall PS plugin" and get nothing. And remember groups can nest - if your groups contain groups, you'll need to recurse by running this node again on each returned group handle that's itself a group.

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