Nodes/ComfyUI-PSD2Layer/PSD to Layers
ComfyUI Node

PSD to Layers

Turn one PSD into a stack of layers, with the metadata riding along

By Nolan0722·Created 2 months ago·Updated about a month ago· 7
PSD to Layers
  • psd
  • layer_image
  • layer_info
include_hiddentrue
backgroundnone

This is the node that makes the whole pack worth installing. PSD to Layers takes a PSD reference (from Load PSD File) and cracks it open into every pixel layer as a separate IMAGE, plus a parallel list of metadata that records exactly where each layer lives. It's the "divide" half of the divide-and-conquer workflow this pack is built around.

Here's the design idea, because once you see it the rest of the pack makes sense: your layer images flow through whatever processing you want - an upscaler, an inpaint, a Qwen edit, a color pass - and the layer metadata takes a completely separate path around your black box. The processing nodes only ever touch pixels. When you're done, the rebuild nodes use the metadata to put everything back in place, same position, same group nesting, same opacity.

What comes out

  • layer_image - a list of IMAGE tensors, one per rasterized pixel layer. Different sizes, in the document's bottom-to-top order. Groups are not composited into the list; they're recorded as structure (see below).
  • layer_info - a matching list of the pack's LAYER_INFO type, one per image, same order. It carries left/top/width/height, opacity, blend mode, layer name, visibility, the original alpha channel, and the full group chain (names plus sibling indices) so even same-named groups come back in the right place.

The lists are index-aligned, so layer_image[3] and layer_info[3] describe the same layer. Keep that pairing straight - the rebuild nodes will refuse to run if the counts disagree, which is the one error you'll actually hit.

The inputs that matter

  • psd - your loaded reference. Only PSD-typed pins fit here.
  • include_hidden - defaults to True, which is worth knowing: hidden layers come out too. If you're splitting a document that uses visibility as a toggle, set it to False or your "hidden" stuff turns up in the final rebuild.
  • background - none (default), black, white, or gray. This is where people trip. none keeps each layer as 4-channel RGBA with real transparency, which is what you want for faithful rebuilds - but a lot of image-processing nodes expect 3-channel RGB and will reject or mangle 4-channel input. If your downstream node chokes, pick a solid background; the alpha still rides along in layer_info either way, so the rebuild isn't hurt.

Install & gotchas

Install is pack-wide: Manager search for ComfyUI-PSD2Layer, or clone into custom_nodes, pip install -r requirements.txt, restart. Dependencies are psd-tools, Pillow, numpy - no models, no GPU.

Two things to know before you trust the output. First, this all runs through psd-tools, the pure-Python PSD library, so a document with exotic features (PSB, certain smart objects) may rasterize imperfectly - test on a real file before you commit a 200-layer job to it. Second, layer alpha is carried as the layer's transparency, not a user layer mask, which is the distinction that keeps your rebuilds clean when you open them in Photoshop. If you split, process nothing, and rebuild, you should get your document back close to byte-for-byte - which is the whole point.

CategoryPSD2Layer

Inputs (3)

NameTypeDefaultDescription
psdPSD
include_hiddenBOOLEANtrue
backgroundCOMBOnone4 options: none, black, white, gray

Outputs (2)

NameTypeDescription
layer_imageIMAGE
layer_infoLAYER_INFO