ComfyUI Node Runs on cloud

Layers Load

Get a layered PSD into ComfyUI without flattening it first

By WASasquatch·Created 3 years ago·Updated 4 days ago· 1,844
Layers Load
    • layers
    • composite
    • count
    • names
    file

    Most ComfyUI tutorials end the same way: save a flat PNG and go fix it in an editor. Layers Load runs the pipe the other direction. Point it at a .psd or a layered .tif and you get the actual stack - separate layers, still named, still placed, still carrying their own opacity, blend mode and visibility - as a LAYERS value your graph can work on.

    Why you'd want that

    Because a stack is information a flattened image no longer has. If you built a composite in Photoshop - a plate, a cut-out subject, a title, a grade - every layer boundary is a decision somebody already made. Load it as a picture and that's gone. Load it as a stack and the graph can pull one layer out, filter it, and put it back with Layer Replace Image, or hand it to Layer Edit, Layer Fit, Layer Select, Layers Merge and finish the comp in the graph rather than round-tripping it.

    It's also the honest alternative to the generative routes for the same job: background removal after the fact is a model guessing where the edges were, and the alpha you drew isn't a guess.

    How it works

    The pack reads both containers itself. No psd-tools, no Pillow, no OpenCV. A PSD gets parsed down to its layer information section; a layered TIFF carries the identical layer block in its Adobe image source data tag. Same record layout, two wrappers - which is why this pair writes and reads both formats with nothing installed.

    Each layer then arrives with its name (the unicode one, where the file has it), the rectangle it occupies, its opacity, its blend mode mapped out of the file's four-letter key, and its hidden flag. Alpha becomes the layer's mask. Two limits worth knowing: groups are flattened on the way in, so layers inside a group arrive as ordinary layers, and any layer with no raster pixels stored - a group divider, a pure adjustment layer - is skipped rather than reconstructed. Text and shape layers arrive as whatever pixels the file wrote for them.

    The composite output is the flattened picture the file stored; where that can't be read, the node composites the stack on the way out. Its cache key is the document's modified time, so re-saving the PSD and re-queuing re-reads it.

    Inputs and outputs

    One input: file. It's a dropdown, not a path box - it lists the .psd, .psb, .tif and .tiff files it can see in ComfyUI's input and output folders, labelled like art.psd [input], plus any folder added under paths.allow_read in config.yaml (listed under its own name).

    Four outputs. layers is the stack, lowest layer first - wire it into Layer Edit, Layer Fit, Layers Merge, Layers Canvas, Layers Info or Layers Save. composite is an IMAGE for anything that wants pixels. count is an INT for switch-style logic. names is the layer names, one per line, lowest first - the underrated one, since a text node fed by it can build a caption out of what the document is actually called.

    Installing it

    ComfyUI Manager, search WAS Node Suite v3. Or manually:

    cd ComfyUI/custom_nodes
    git clone https://github.com/WASasquatch/was-node-suite-comfyui.git
    

    Restart ComfyUI. That's the whole install - v3 pulls in nothing, downloads no model files, runs no pip step. It wants ComfyUI 0.14.0 or newer and Python 3.10+. First start takes a second longer while it writes config.yaml and its support folders under <ComfyUI user dir>/was-node-suite/. Both layer-file nodes sit behind the features.photoshop switch there, on by default.

    Then drop your .psd into ComfyUI/input (or output), or add a folder to paths.allow_read and restart.

    Common issues

    The menu is built when the page loads. Add a new PSD to the input folder and it won't appear in the dropdown until you reload the page - the node's own error message says exactly this when you pick a file that's since been renamed, moved or deleted.

    .psb is offered but won't read. The big-document format is listed and then refuses with "this is a large document (PSB), and only a PSD is read here". Re-save a copy as a plain PSD.

    RGB only, and 8, 16 or 32 bit. A CMYK or greyscale document errors and names the colour mode it found. A 32-bit file whose channels were zipped with a predictor also errors, and suggests re-saving at 16 bit.

    Missing layers are usually empty layers. If a layer you can see in Photoshop isn't in the stack, it had no pixels stored. The reader keeps what the file holds and doesn't fake the rest.

    Ignore the old troubleshooting threads. Search the pack's name and you'll mostly find 2024 posts about "Import Failed" after a ComfyUI update, fixed by downgrading opencv-python. That was v2, which installed twenty packages and could break on someone else's pip resolution. v3 installs none of them.

    CategoryWAS Suite/Image/Layers

    Inputs (1)

    NameTypeDefaultDescription
    fileCOMBOWhich document to read. Each entry carries the folder it sits in, as `art.psd [input]` or `plate.tif [output]`. A folder added under paths.allow_read in config.yaml appears under its own name.

    Outputs (4)

    NameTypeDescription
    layersLAYERSThe stack the file held, lowest layer first; LAYERS.
    compositeIMAGEThe flattened picture the file stored, or the stack composited here where it stored none; IMAGE.
    countINTHow many layers the stack holds; INT.
    namesSTRINGWhat each layer is called, one per line, lowest first.