Nodes/Photoshop Bridge/Compose Layers to PSD
ComfyUI Node

Compose Layers to PSD

Combines multiple connected images into one multi-layer .psd file, one layer per input, written to ComfyUI's input folder. Also accepts a layer stack (LAYERS) -- from Load PSD or ComfyUI 0.31+'s layer nodes -- and writes it as real PSD layers with names, positions, opacity, blend modes, and visibility. Works with ComfyUI alone, including opening the result in Photoshop and waiting for your edits -- installing the Photoshop panel plugin makes that round trip instant instead of file-based. Double-click an image input's socket to rename it; that name becomes the layer's name in the PSD. Point existing_psd_path at a file to append each run as a new group in one growing review document instead of writing a separate file every time.

By ericpaulsnowden·Created about a month ago·Updated 10 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
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.