daff6e33336eb99059bf2f4dfca7e181d0fcd8d3
D2 SavePSD ComfyUI
A node that saves images in Photoshop format (.psd). Alpha channel application and separation are also possible.
*Note: Layer mask application is not implemented at this time (2025/04/07). Alpha channels are exported as normal layers.
🗂️ Install
Manual installation method
cd {ComfyUI installation folder}/custom_nodes
git clone https://github.com/da2el-ai/D2-SavePSD-ComfyUI.git
Install required libraries ❗ This step is necessary even if you installed using ComfyUI Manager.
cd {ComfyUI installation folder}/custom_nodes/D2-SavePSD-ComfyUI
..\..\venv\Scripts\activate
python install.py
🍅 Nodes
D2 Save PSD
- Saves images received via
imagesin PSD format - Layer masks are not supported, so alpha channels are converted to normal image layers
Input
filrename_prefix- File name format. The same format as the standard
Save Imagenode can be used.
- File name format. The same format as the standard
file_mode- Behavior when receiving multiple images
single_file: Combine as layers into a single PSDmulti_file: Save each image to individual PSD files
alpha_name- Layer name given to alpha channels
- Default value:
_mask_
alpha_name_mode- Naming method for alpha channel layers
simple:{alpha_name}suffix:{image layer name}_{alpha_name}
D2 Apply Alpha Channel
- Apply MASK as an alpha channel
D2 Extract Alpha
- Separate alpha channels applied with
D2 Apply Alpha Channel - Cannot separate alpha channels from transparent PNGs, etc.
💻 About Applying Masks to Layers (Manual)
- The following are operations in Photoshop.
- There are various other ways to create masks besides the methods described here, so please try your preferred method.
- Probably possible in applications other than Photoshop as well.
- We do not accept questions about Photoshop operations.
Procedure
- Select the mask layer, then Select All > Copy
- Select the layer to which you want to apply the mask, then click the mask button
- Display the mask channel in the Channels palette
- Paste into the mask channel
💻 About Applying Masks to Layers (Photoshop Script)
- Applies masks to all images in a specified folder using a Photoshop Script
Prerequisites
- Photoshop CC 2024
- Not tested with other versions
- Images created with
D2 Save PSDsettings set toalpha_name_mode: simple- OK as long as mask layer names are unified
Preparation
Save the script file d2_automask.jsx to any location.
Execution
- Place the PSD data you want to apply masks to in any folder
- Please do not place unrelated files
- Select
[File > Scripts > Browse]from the Photoshop menu
- Select the saved
d2_automask.jsx - A dialog will open, enter the folder with images in
入力フォルダ, and click実行
- Images with masks applied will be output
About Options
入力フォルダ- Folder where target PSD data is located
出力フォルダ- Output destination folder. When blank, saved to
入力フォルダ/output
- Output destination folder. When blank, saved to
マスクレイヤー名- Name of the target mask layer. When blank,
_mask_is applied
- Name of the target mask layer. When blank,
マスクを反転する- When checked, inverts the selection and masks
マスクレイヤーを削除する- Delete mask layers when saving files
🌼 Update History
2025.04.09
- PS Script: Added option to delete mask layers
2025.04.07
- Initially created
Languages
JavaScript
63.2%
Python
36.8%