Extensions/comfyui-ps-normal-layer-composite
ComfyUI Extension

comfyui-ps-normal-layer-composite

A tiny ComfyUI custom node pack for compositing two transparent images like Photoshop's normal layer mode and saving as transparent PNG.

By Doki21yy·Created 3 months ago·Updated 3 months ago· 0
Doki21yy/comfyui-ps-normal-layer-composite
Nodes
On cloudLocal install
Stars0
Updated3 months ago
Readme

ComfyUI PS Normal Layer Composite

A tiny ComfyUI custom node pack for compositing two transparent images like Photoshop's normal layer mode and saving the result as a transparent PNG.

Nodes

  • PS Normal Layer Composite (RGBA)

    • Composites top_image over bottom_image using straight-alpha normal blending.
    • Supports top_x, top_y, top_opacity, and multiple canvas sizing modes.
    • Accepts optional ComfyUI MASK inputs for each image's alpha.
    • Outputs RGBA image, RGB preview, alpha mask, and ComfyUI transparency mask.
  • Save Transparent PNG (RGBA)

    • Saves an IMAGE with an alpha channel as a real transparent PNG.
    • Can also combine an RGB image with an external alpha/mask input.

Installation

Clone this repo into ComfyUI/custom_nodes:

cd ComfyUI/custom_nodes
git clone https://github.com/Doki21yy/comfyui-ps-normal-layer-composite.git

Restart ComfyUI after installation.

Basic Workflow

  1. Load two transparent PNG files with LoadImage.
  2. Connect the bottom layer's IMAGE to bottom_image.
  3. Connect the top layer's IMAGE to top_image.
  4. Connect each LoadImage mask output to bottom_alpha and top_alpha.
  5. Keep mask_mode as comfy_transparency_mask for standard ComfyUI masks.
  6. Connect rgba_image to Save Transparent PNG (RGBA).

Notes

ComfyUI's built-in IMAGE is often RGB-only, while transparency is passed separately as a MASK. This node supports both RGBA tensors and separate mask inputs, so it works with common image-loading workflows.