AFL PSD Layer V2
Turn your layers into a real PSD, before you ever leave ComfyUI
- layer_1
- layers
AFL2_PSD_Layer ("AFL PSD Layer V2") is the collection-builder half of the pack's PSD export duo. It takes images - one or several - and stacks them into a PSD_LAYERS bundle that the companion AFL2_Save_PSD node writes out as an actual Photoshop .psd file. If you've ever built a multi-layer composite in ComfyUI and then had to manually re-stack everything in Photoshop to deliver it, this pair is the shortcut.
It's a niche but a real one: anyone delivering layered artwork, mockups, or edited design files to a designer who lives in Photoshop. Generate the layers, order them, save a PSD - and the person on the other end gets real editable layers, alpha channel intact, instead of a flattened PNG and a shrug.
How it works
The node accepts image inputs named layer_1, layer_2, and so on - you'll see layer_1 in the schema, and more appear dynamically as you connect inputs. On execution it sorts them by number, converts each to RGBA (RGB images get an opaque alpha channel added), and packs them into a PSD_LAYERS structure with names like Layer_1, Layer_2. Note there are no required inputs - you can wire a single layer or a stack, and the order of the collection follows the input numbers, with layer_1 at the bottom.
Important detail: the node reads the first frame of each input tensor (image[0]), so it's designed for single images per layer. Feed it batches and you'll only get the first frame of each.
The input that matters
layer_1(IMAGE, optional) - your first layer. Addlayer_2,layer_3, … by connecting more. RGBA images keep their transparency; RGB ones become fully opaque layers.
One output: layers (PSD_LAYERS), which plugs only into AFL2_Save_PSD's layers input.
A note on expectations
This is a hand-rolled PSD writer, not a guarantee of 100% round-trip fidelity with every Photoshop feature. It writes a genuine PSD with RLE-compressed layer data and alpha - solid for images with transparency - but don't expect text layers, layer styles, or blend modes to come through, because none of that goes in. What you get is editable raster layers, which is exactly what a compositing hand-off needs.
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
- "Only one layer comes out." Check your input names - they must be
layer_N. Anything not named that way isn't picked up as a layer. - "My transparent layer came out opaque." The conversion to RGBA adds an opaque alpha only when the input was RGB - that's correct behavior. If your input was RGBA with real transparency and it's still opaque, the alpha was lost upstream (the RGB-not-RGBA Load Image trap again).
- "First frame only." Batches get truncated to frame one per layer. Feed single images.
For compositors and anyone delivering layered files, this plus AFL2_Save_PSD is a genuinely rare capability in a node pack. It's not flashy - it's just useful the moment you need a real .psd out of a graph.
Inputs (1)
| Name | Type | Default | Description |
|---|---|---|---|
| layer_1opt | IMAGE | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| layers | PSD_LAYERS | — |