Nodes/ComfyUI-JH-PixelPro/Compositing: Layer Add
ComfyUI Node

Compositing: Layer Add

Add a layer with a blend mode and opacity, the way you'd expect

By jetthuangai·Created 5 months ago·Updated 4 months ago· 5
Compositing: Layer Add
  • stack
  • layer_image
  • layer_mask
  • LAYER_STACK
blend_modenormal
opacity1.00
fill1.00
clip_to_belowfalse

This is the node that makes the pack's layer system feel like Photoshop. JHPixelProLayerAdd takes a LAYER_STACK and an image, and adds that image as a new layer on top - with a blend mode, opacity, fill, an optional mask, and clip-to-below support. It's the workhorse of the compositing group: everything that isn't the background layer goes through this node.

You need a JHPixelProLayerStackStart upstream (that's the background layer), and you'll usually finish with JHPixelProLayerFlatten to render the result. In between, chain as many LayerAdds as you like - each one returns a new immutable stack, so the order you wire them in is the layer order they stack in.

The settings that matter

  • blend_mode: 27 modes, the full classic set - normal, multiply, screen, overlay, soft_light, hard_light, color_dodge, linear_burn, difference, exclusion, subtract, divide, plus the HSL modes (hue, saturation, color, luminosity) and the exotic corners (dissolve, hard_mix, pin_light, vivid_light, …). If you know Photoshop, every name means the same thing here. multiply and screen are the ones you'll live in.
  • opacity (0–1, default 1): overall layer transparency. 0.5 is a half-transparent layer, exactly like Photoshop.
  • fill (0–1, default 1): the fill knob - layer content opacity, separate from the layer's own opacity. Pro users know the distinction (fill doesn't affect layer effects; here there are no layer effects, so it's mostly a second, compositing-friendly opacity). Keep it at 1 unless you have a reason.
  • clip_to_below (default false): clip this layer to the layer beneath it - the classic Photoshop clipping-mask behavior. Great for "texture only within the shape below" composites.
  • layer_mask (optional MASK): the layer's alpha mask. The mask and the layer image both auto-resize to the base stack size (bilinear), so you don't have to pre-scale them.

Output is the new LAYER_STACK. That's it - stack in, stack out, layer added.

Two things to know

The stack is immutable, so you can't "edit" a layer - you branch or re-add. That's fine and it's how the graph stays clean. And if you're used to chaining math nodes to approximate a blend, stop: the implementation here is the real blend math, and divide, subtract, and the HSL modes are the ones you genuinely couldn't do by hand without a whole mini-graph.

Install

ComfyUI Manager → search ComfyUI-JH-PixelPro, or:

cd ComfyUI/custom_nodes
git clone https://github.com/jetthuangai/ComfyUI-JH-PixelPro.git
cd ComfyUI-JH-PixelPro
pip install -r requirements.txt

Restart ComfyUI; it's under ComfyUI-JH-PixelPro/compositing. The pack needs ComfyUI ≥ 0.43.x, Python ≥ 3.10, plus kornia, mediapipe, opencv-python-headless, and scipy.

The honest caveat: this is layers-lite. No layer styles (bevel, glow, drop shadow), no smart objects - the README is upfront that those are out of scope. What you get is the core thing people actually use layers for: stacking images with real blend modes, masks, and opacity, non-destructively, in the graph. If that's the workflow you've been missing in ComfyUI, this node plus Start and Flatten is your whole toolkit.

CategoryComfyUI-JH-PixelPro/compositing

Inputs (7)

NameTypeDefaultDescription
stackLAYER_STACK
layer_imageIMAGE
blend_modeCOMBOnormal27 options: normal, dissolve, darken, multiply, color_burn, linear_burn, +21
opacityFLOAT1.000–1
fillFLOAT1.000–1
clip_to_belowBOOLEANfalse
layer_maskoptMASK

Outputs (1)

NameTypeDescription
LAYER_STACKLAYER_STACK