Nodes/Comfyui_LG_Tools/AFL Save PSD V2
ComfyUI Node

AFL Save PSD V2

Save a layered composite as a real .psd from inside your graph

By LAOGOU-666·Created 2 years ago·Updated 7 months ago· 369
AFL Save PSD V2
  • layers
    filenameoutput.psd
    save_path

    AFL2_Save_PSD ("AFL Save PSD V2") is the save half of the pack's PSD export pair, and it's the payoff: give it the PSD_LAYERS bundle from AFL2_PSD_Layer, tell it a filename, and it writes a genuine, layered Photoshop .psd file to disk. No image stacking by hand afterward, no re-assembling layers in another app. You finish a layered composite in ComfyUI, and it lands on your drive as something a designer can open and edit directly.

    It's an output node with no data outputs - its job is purely writing the file - so it slots at the end of a layer-stacking chain: build layers with AFL2_PSD_Layer, then terminate the graph here.

    How it works

    The node takes your PSD_LAYERS bundle, verifies it has content, and writes the file using a hand-rolled PSD writer in the pack that handles the header, color mode, image resources, layer records, and RLE-compressed image data - including per-layer alpha. By default it saves into ComfyUI's standard output directory with your filename (a .psd extension is appended if you forget it). Set save_path and it writes wherever you point it instead.

    The inputs that matter

    • layers (PSD_LAYERS, required) - the layer bundle, straight from AFL2_PSD_Layer.
    • filename (STRING, required, default output.psd) - the file name. The .psd extension gets added automatically if missing.
    • save_path (STRING, optional, default empty) - where to write it. Empty means ComfyUI's output directory.

    What you get vs. what you don't

    Real, editable raster layers with transparency survive - that's the point, and the alpha channel is explicitly written per layer. What won't survive is anything the node never knew about: there are no text layers, layer styles, blend modes, or adjustment layers coming out of this, because the node only ever had images to work with. Keep that in mind if you're tempted to treat it as a full Photoshop export pipeline - it's a raster-layer hand-off tool, and it's excellent at that one job.

    Installing it

    Part of Comfyui_LG_Tools:

    cd ComfyUI/custom_nodes
    git clone https://github.com/LAOGOU-666/Comfyui_LG_Tools.git
    pip install -r requirements.txt
    

    Or via ComfyUI Manager → "Comfyui_LG_Tools" → restart. It's under Add Node → AFL → PSD.

    Common issues

    • "Nothing gets written." Check the ComfyUI console for the [AFL_Save_PSD] messages - it prints every layer it writes and the final path. If you see "No layers to save," the bundle upstream is empty.
    • "It saved without the .psd extension." The node appends .psd if the filename lacks it, so this shouldn't happen unless the path itself ends in something odd. Just name it normally.
    • "Where did it go?" Default is ComfyUI's output folder. If you set save_path, it's there - and the console prints the exact full path.
    • Batch layers. As with the layer builder, only the first frame of each layer tensor is used. Single images per layer, always.

    The PSD pair is one of the least-seen capabilities in this pack, and it's exactly the kind of thing you don't know you need until a client asks for a layered file. When that day comes, this is the node that has you covered.

    CategoryAFL/PSD

    Inputs (3)

    NameTypeDefaultDescription
    layersPSD_LAYERS
    filenameSTRINGoutput.psd
    save_pathoptSTRING

    Outputs (0)

    No outputs