Nodes/Photoshop Bridge/Compose Layers to PSD
ComfyUI Node

Compose Layers to PSD

Stack your renders into a real layered PSD, one layer per input

By ericpaulsnowden·Created 2 months ago·Updated 4 days ago· 1
Compose Layers to PSD
  • layers
  • image_1
  • image_2
  • image_3
  • image_4
  • image_5
  • image_6
  • image_7
  • image_8
  • image_9
  • image_10
  • image_11
  • image_12
  • image_13
  • image_14
  • image_15
  • image_16
  • image_17
  • image_18
  • image_19
  • image_20
  • image
  • mask
  • filename
  • layers
group_nameComfyUI Layers
layer_names
modeWait for first save
timeout_seconds1800
max_layers64
existing_psd_path

The other half of the layered-PSD story, and the natural sibling to Load PSD. Where Load PSD turns a document into layers, Compose Layers to PSD takes a pile of images and writes them out as a genuine multi-layer, grouped .psd in ComfyUI's input folder - then, if you want, opens it in Photoshop and waits for you to edit it, exactly like Edit in Photoshop. The flat composite returns as the node's image output, so a full round trip - multiple renders in, one editable layered document in Photoshop, your manual edits back out - is one node.

How the inputs stack

The image_1image_20 sockets are all optional. image_1 is the bottom layer; each higher-numbered socket stacks above it, all inside one group named by group_name (default "ComfyUI Layers"). Layers keep their native resolution - never rescaled - on a shared canvas sized to the largest input. Double-click a socket to rename it, and that name becomes the layer's name in the PSD. max_layers (default 64) caps how many images become layers; anything beyond is dropped from the end rather than growing the document forever.

There's also an optional layers (LAYERS) input - from Load PSD, core's layer nodes, or a layer-splitting model - and it's written out as real PSD layers: names, absolute positions, opacity, blend mode, and visibility all land as live, editable properties. Rotation, flips, and display size get baked into the pixels (PSD has no non-destructive transforms), with a log line per bake. Stack layers sit below any connected image_N inputs, and max_layers counts the combined total.

What comes out

  • image - the flattened composite (or your saved edit, once one arrives). Previewed with simple alpha blending; the PSD in Photoshop is the authoritative render.
  • mask - marks any canvas area no layer covers (1.0 = uncovered).
  • filename - the written PSD's name relative to the input folder. Feed it straight into a Load PSD psd widget to chain the two.
  • layers - one image per layer at its real position on the shared canvas, for a Preview node.

The mode widget mirrors Edit in Photoshop: Wait for first save opens the PSD and blocks until you save, Re-run on every save re-queues per save, Don't open (composite only) just writes the file - and even then, the node shows a Written: <filename> line with a Copy Path button and right-click Open in Photoshop. existing_psd_path is the interesting one: point it at a PSD (or name a new one via Browse) and each run appends as a new numbered group into that one review document instead of writing a fresh file every time. Writes are atomic, so a failed run can't truncate a document you've been collecting into.

Install & notes

Standard pack install (Manager → Install via Git URL, or clone + pip install -r requirements.txt with ComfyUI's own Python, restart). No Photoshop or plugin needed just to write the PSD - only the open-and-edit modes involve Photoshop, and those work via the file watch without the plugin. Pre-1.0, actively developed. Two honesty notes to keep in mind: 24 of Photoshop's 27 blend modes map 1:1 by name (dissolve, darker-color, lighter-color fall back to nearest, logged), and if you append to an existing target it must be RGB - a non-RGB target is refused rather than silently converted.

CategoryPhotoshop Bridge/Handoffs

Inputs (27)

NameTypeDefaultDescription
group_nameSTRINGComfyUI LayersName of the group every input's layer is placed inside, in the written PSD.
layer_namesSTRINGAuto-filled by renaming an image input's socket (double-click it) -- the JSON list of custom layer names. Not meant to be edited by hand.
modeCOMBOWait for first saveHow this node treats Photoshop after writing the PSD. 'Wait for first save' opens Photoshop and pauses the workflow until you save, then returns your edited composite. 'Re-run on every save' opens Photoshop once and re-queues the workflow automatically each time you save. 'Don't open (composite only)' just writes the file and returns the flattened composite -- Photoshop never opens.
timeout_secondsINT180010–86400How long to wait for you to save in Photoshop before giving up and stopping the workflow, in seconds. Only used by 'Wait for first save'.
max_layersINT641–512Maximum number of images that become layers. Images beyond this cap are dropped from the end (the first images/frames are kept) rather than growing the document without limit.
existing_psd_pathSTRINGOptional path to an existing .psd/.psb file. When set, this run's layers are appended to that file as a new group instead of writing a fresh numbered file -- use Browse to pick one, or point at a path that doesn't exist yet to create it. Leave blank to always write a new file.
layersoptLAYERSOptional layer stack (LAYERS) -- from this pack's Load PSD node or ComfyUI 0.31+'s layer nodes (Add Layer, Create Layered Image, or a layer-splitting model). Every layer is written into the PSD with its own name, position, opacity, blend mode, and visibility, below any connected image inputs. Rotation, flips, and display size are baked into the pixels (PSD has no non-destructive transforms). The node's image output previews the result with simple alpha blending -- open the PSD in Photoshop for the authoritative render.
image_1optIMAGEOne image layer. image_1 is the bottom layer; each higher-numbered socket stacks above it. Double-click the socket to rename it -- that name becomes the layer's name in the written PSD.
image_2optIMAGEOne image layer. image_1 is the bottom layer; each higher-numbered socket stacks above it. Double-click the socket to rename it -- that name becomes the layer's name in the written PSD.
image_3optIMAGEOne image layer. image_1 is the bottom layer; each higher-numbered socket stacks above it. Double-click the socket to rename it -- that name becomes the layer's name in the written PSD.
image_4optIMAGEOne image layer. image_1 is the bottom layer; each higher-numbered socket stacks above it. Double-click the socket to rename it -- that name becomes the layer's name in the written PSD.
image_5optIMAGEOne image layer. image_1 is the bottom layer; each higher-numbered socket stacks above it. Double-click the socket to rename it -- that name becomes the layer's name in the written PSD.
image_6optIMAGEOne image layer. image_1 is the bottom layer; each higher-numbered socket stacks above it. Double-click the socket to rename it -- that name becomes the layer's name in the written PSD.
image_7optIMAGEOne image layer. image_1 is the bottom layer; each higher-numbered socket stacks above it. Double-click the socket to rename it -- that name becomes the layer's name in the written PSD.
image_8optIMAGEOne image layer. image_1 is the bottom layer; each higher-numbered socket stacks above it. Double-click the socket to rename it -- that name becomes the layer's name in the written PSD.
image_9optIMAGEOne image layer. image_1 is the bottom layer; each higher-numbered socket stacks above it. Double-click the socket to rename it -- that name becomes the layer's name in the written PSD.
image_10optIMAGEOne image layer. image_1 is the bottom layer; each higher-numbered socket stacks above it. Double-click the socket to rename it -- that name becomes the layer's name in the written PSD.
image_11optIMAGEOne image layer. image_1 is the bottom layer; each higher-numbered socket stacks above it. Double-click the socket to rename it -- that name becomes the layer's name in the written PSD.
image_12optIMAGEOne image layer. image_1 is the bottom layer; each higher-numbered socket stacks above it. Double-click the socket to rename it -- that name becomes the layer's name in the written PSD.
image_13optIMAGEOne image layer. image_1 is the bottom layer; each higher-numbered socket stacks above it. Double-click the socket to rename it -- that name becomes the layer's name in the written PSD.
image_14optIMAGEOne image layer. image_1 is the bottom layer; each higher-numbered socket stacks above it. Double-click the socket to rename it -- that name becomes the layer's name in the written PSD.
image_15optIMAGEOne image layer. image_1 is the bottom layer; each higher-numbered socket stacks above it. Double-click the socket to rename it -- that name becomes the layer's name in the written PSD.
image_16optIMAGEOne image layer. image_1 is the bottom layer; each higher-numbered socket stacks above it. Double-click the socket to rename it -- that name becomes the layer's name in the written PSD.
image_17optIMAGEOne image layer. image_1 is the bottom layer; each higher-numbered socket stacks above it. Double-click the socket to rename it -- that name becomes the layer's name in the written PSD.
image_18optIMAGEOne image layer. image_1 is the bottom layer; each higher-numbered socket stacks above it. Double-click the socket to rename it -- that name becomes the layer's name in the written PSD.
image_19optIMAGEOne image layer. image_1 is the bottom layer; each higher-numbered socket stacks above it. Double-click the socket to rename it -- that name becomes the layer's name in the written PSD.
image_20optIMAGEOne image layer. image_1 is the bottom layer; each higher-numbered socket stacks above it. Double-click the socket to rename it -- that name becomes the layer's name in the written PSD.

Outputs (4)

NameTypeDescription
imageIMAGEThe flattened composite of every connected layer (or your saved edit, once one arrives).
maskMASKMarks any canvas area no input layer covers (1.0 = uncovered, 0.0 = covered).
filenameSTRINGThe written PSD's filename, relative to the input folder -- feed this straight into a Load PSD node's psd widget.
layersIMAGEOne image per layer, each placed at its real position on the shared canvas -- connect this batch to a Preview node to see every layer individually, since the image output only ever shows the flattened composite.