Nodes/TrentNodes/PSD Layer Loader
ComfyUI Node

PSD Layer Loader

Reusing a Split PSD Without Paying the Parse Cost Again

By TrentHunter82·Created 9 months ago·Updated 4 days ago· 36
PSD Layer Loader
    • images
    • masks
    • layer_names
    • layer_count
    • manifest_json
    folder_path
    filter_kind
    start_index0
    end_index-1
    load_alphatrue

    The PSD Layer Splitter is slow because parsing a Photoshop file is slow. If you're iterating on a design - trying five different backgrounds, nudging layer visibility - you do not want to re-parse the PSD every time. This node reads the splitter's output folder instead: the already-rasterized PNGs and the manifest. Same layers, no re-parse, fast reruns.

    What it does

    Point it at a splitter output folder (folder_path) and it loads the layer PNGs straight from disk, decoding the index/kind/name info that's baked into the filenames. Because it works off the folder, it's the node to reach for in a loop: split once, then re-run the compositing branch as much as you like.

    The useful controls:

    • filter_kind - load only certain layer kinds (comma-separated: pixel, type, shape, smartobject, group, fill). Handy when you want, say, just the text layers or just the raster art.
    • start_index / end_index - load a contiguous slice of the stack. end_index defaults to -1, which means "everything from start_index". Keep the indices aligned with how you split, or you'll grab the wrong slice.
    • load_alpha (default on) - also emits a per-layer alpha mask.

    The outputs mirror the splitter's: images (list), masks (inverted convention - white = transparent), layer_names, layer_count, and manifest_json (the raw manifest text, or an empty string if it's missing - a quick way to check you pointed at a real splitter folder).

    Why the inverted mask convention matters

    This pack consistently outputs masks where white means transparent on layer outputs, which is the opposite of ComfyUI's usual "white = opaque" rule. It matches how alpha behaves in Photoshop compositing. The RGBA flatten variant exists precisely because that inconsistency trips people up - if you're feeding masks to a standard ComfyUI node that assumes white = opaque, either use the RGBA variant downstream or invert before wiring.

    Installing it

    Part of TrentNodes; install once, use everywhere:

    cd ComfyUI/custom_nodes
    git clone https://github.com/TrentHunter82/TrentNodes.git
    cd TrentNodes
    pip install -r requirements.txt
    

    ComfyUI Manager ("Trent Nodes") works too; if it flags the pack as "unsafe", that's the author's day-one repo rename leaving a duplicate registry entry - the manual clone is the dependable fallback. No model downloads.

    The honest take

    If your workflow is "split a PSD, tweak the result, done," you may never need this node - the splitter's own outputs already give you the layers. The loader earns its place when you iterate: re-runs that touch the splitter are expensive, so the loader is how you keep the fast path fast.

    CategoryTrent/PSD

    Inputs (5)

    NameTypeDefaultDescription
    folder_pathSTRINGFolder containing PNGs from PSD Layer Splitter
    filter_kindoptSTRINGComma-separated layer kinds to load (empty = all). Parsed from filenames: pixel, type, shape, smartobject, group, fill
    start_indexoptINT00–9999First layer index to load
    end_indexoptINT-1-1–9999Last layer index to load (-1 = load all from start_index)
    load_alphaoptBOOLEANtrueExtract alpha channel as a separate mask output

    Outputs (5)

    NameTypeDescription
    imagesIMAGEEach layer as an RGB image
    masksMASKAlpha mask per layer (inverted: white = transparent)
    layer_namesSTRINGLayer names parsed from filenames or manifest
    layer_countINTNumber of loaded layers
    manifest_jsonSTRINGRaw JSON from _manifest.json (empty string if absent)