SDPPP Get Document
Pick a Photoshop document and get a handle (plus both boundary masks)
- document
- document boundary
- selection boundary
Almost every node in the newer half of SD-PPP needs a DOCUMENT handle before it can do anything - you don't ask Photoshop "give me the layer," you ask "give me the layer in this document." This node is where that handle comes from. You pick which of your open Photoshop documents you're working on, and it returns a reference plus the two masks you'll want for compositing.
How it works
The document_name input looks like a plain text box, but the SD-PPP front-end replaces it with a live dropdown populated from the connected Photoshop instance - every document you have open appears by name. Pick one, run, and the node calls the plugin's getDocumentInfo action over the Socket.IO bridge. Photoshop reports back where the document itself sits and where the current selection sits, and the node converts both rectangles into masks.
Inputs and outputs
The single input is document_name - the document picker. In return you get three things:
- document - the
DOCUMENThandle. This is the one you wire intoSDPPP Get Layer By ID,SDPPP Get Selection, and friends. Treat it as an opaque ID; you never read values out of it. - document boundary - a
MASKcovering the whole canvas. Wire this anywhere you need to know the full-document extent. - selection boundary - a
MASKof the current selection's bounding box. Same idea, but for the marching ants you have active.
Both masks come out at document resolution, so they line up perfectly with anything else the pack pulls from that document.
When to reach for it
Any workflow that's anchored to a specific Photoshop file. For example: get the document, use SDPPP Get Selection to turn your PS selection into a mask, then feed that mask into an inpaint or regional prompt node - everything stays keyed to the same open file. It also works well as the anchor for a batch workflow where the document doesn't change between runs.
Install and gotchas
Install 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 on first import - no manual pip. You also need the Photoshop plugin from sdppp.zombee.tech (a .ccx; double-click to install with Creative Cloud, or rename to .zip and extract into the Photoshop Plug-ins folder).
The big one: the plugin and the custom node pack must be on matching versions. If they drift apart you'll get "version mismatch, please reinstall PS plugin" and no documents will appear in the dropdown. Update both together. And if the dropdown stays empty, Photoshop isn't connected - the plugin's panel should show a connection to your ComfyUI server before anything will list.
Inputs (1)
| Name | Type | Default | Description |
|---|---|---|---|
| document_name | STRING | — |
Outputs (3)
| Name | Type | Description |
|---|---|---|
| document | DOCUMENT | — |
| document boundary | MASK | — |
| selection boundary | MASK | — |