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.
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)
| Name | Type | Default | Description |
|---|---|---|---|
| group_name | STRING | ComfyUI Layers | Name of the group every input's layer is placed inside, in the written PSD. |
| layer_names | STRING | Auto-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. | |
| mode | COMBO | Wait for first save | How 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_seconds | INT | 180010–86400 | How 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_layers | INT | 641–512 | Maximum 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_path | STRING | Optional 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. | |
| layersopt | LAYERS | Optional 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_1opt | IMAGE | One 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_2opt | IMAGE | One 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_3opt | IMAGE | One 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_4opt | IMAGE | One 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_5opt | IMAGE | One 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_6opt | IMAGE | One 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_7opt | IMAGE | One 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_8opt | IMAGE | One 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_9opt | IMAGE | One 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_10opt | IMAGE | One 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_11opt | IMAGE | One 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_12opt | IMAGE | One 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_13opt | IMAGE | One 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_14opt | IMAGE | One 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_15opt | IMAGE | One 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_16opt | IMAGE | One 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_17opt | IMAGE | One 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_18opt | IMAGE | One 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_19opt | IMAGE | One 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_20opt | IMAGE | One 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)
| Name | Type | Description |
|---|---|---|
| image | IMAGE | The flattened composite of every connected layer (or your saved edit, once one arrives). |
| mask | MASK | Marks any canvas area no input layer covers (1.0 = uncovered, 0.0 = covered). |
| filename | STRING | The written PSD's filename, relative to the input folder -- feed this straight into a Load PSD node's psd widget. |
| layers | IMAGE | One 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. |