ComfyUI-Layers

ComfyUI-Layers
★ 57

图层导出掩码处理PSD 保存透明通道
基于输入掩码将图像分层并导出为PSD,支持添加原图层与透明通道与动态文件命名。
💡 将多掩码分离的区域导出为可编辑PSD图层。
🍴 9 Forks💻 Python🔄 2024-07-31
📦
网盘下载
复制链接后前往夸克网盘下载
https://pan.quark.cn/s/8b0992d318c3
Example Workflow
Example Workflow
📄 README

LayersSaver – Save Layers Node for ComfyUI

These two custom nodes for ComfyUI allows you to save images into a PSD file as layers.

This can be particularly useful for graphic design, image processing, and tasks requiring manipulation of image layers.

LayersSaver – Save Layer

This custom node for ComfyUI allows you to create layers of an image based on input masks and save them into a PSD file. The node provides flexibility to include the original image and creates separate layers for each masked region.

Example

You can find the example workflow here

Features

  • Input Image Handling: Processes a single input image with batch dimension removed.
  • Mask Application: Applies multiple masks to the input image, creating separate layers for each masked region.
  • Original Image Inclusion: Optionally includes the original image as a separate layer.
  • Alpha Channel Management: Ensures the input image includes an alpha channel for transparency.
  • Dynamic PSD Naming: Generates a unique PSD filename based on the current timestamp if not specified.
  • PSD File Creation: Saves the resulting layers into a PSD file with specified or dynamically generated filename.
  • LayersSaver – Save Layer From Images

    This custom node for ComfyUI allows you to create layers of an image based on all the input images. Every image in the input batch will be saved as a separate layer in the output PSD.

    Example

    You can find the example workflow here

    Features

  • Input Image Handling: Processes a infinite bach dimension input image.
  • Alpha Channel Management: Ensures the input image includes an alpha channel for transparency.
  • Dynamic PSD Naming: Generates a unique PSD filename based on the current timestamp if not specified.
  • PSD File Creation: Saves the resulting layers into a PSD file with specified or dynamically generated filename.
  • Installation

    To use this custom node in ComfyUI, follow these steps:

  • Clone the repository into your ComfyUI custom_nodes directory:
  • “`sh

    git clone https://github.com/yourusername/comfyui-layerssaver.git

    “`

  • Install the following libraries or run install.py
  • pip install pytoshop -I --no-cache-dir
  • pip install psd-tools --no-deps
  • Restart ComfyUI to load the new node.
  • Acknowledgements

    Special thanks to jtydhr88/ComfyUI-LayerDivider for the inspiration. Their work provided a foundation and motivation for developing this custom node.

    Contributing

    We welcome contributions! If you find any issues or have suggestions for improvements, please open an issue or submit a pull request.

    License

    This project is licensed under the GPL-3.0 License. See the LICENSE file for details.



    Thank you for using the LayersSaver node for ComfyUI. We hope it enhances your image processing workflows!