Nodes/ComfyUI-JNK-Tiny-Nodes/Add Layer Overlay JNK
ComfyUI Node

Add Layer Overlay JNK

Stack layers with position, rotation and fade β€” watch the opacity slider

By AljnkΒ·Created about a year agoΒ·Updated 12 months agoΒ· 3
Add Layer Overlay JNK
  • base_image
  • overlay_image
  • IMAGE
β—„position_typeβ–Ύβ–Ί
β—„center_rotation0β–Ί
β—„x_offset0β–Ί
β—„y_offset0β–Ί
β—„opacity0β–Ί

Add Layer Overlay is the compositing workhorse of the JNK pack: it pastes one RGBA image on top of another and lets you position, rotate, and fade the top layer without ever leaving the graph. Pair it with the pack's Create RGBA Image and the alpha-layer nodes and you can build a mini Photoshop out of ComfyUI - drop a transparent character render onto a background, nudge it around, tilt it, dial down its visibility.

Under the hood it's PIL alpha compositing. The overlay is converted to RGBA, pasted at a computed position onto a canvas the size of the base image, then alpha-composited with the base. Simple, predictable, and it handles batches: if you feed more base frames than overlays, it reuses the last overlay for the extras.

Inputs that matter

  • base_image / overlay_image - base and top layer, both plain IMAGE tensors. The overlay's alpha channel is what gets respected.
  • position_type - top-left or center. top-left puts the overlay's corner at the offset coordinates; center centers the overlay on them.
  • center_rotation - degrees, -360 to 360. Note the source only rotates in center mode; in top-left mode rotation is ignored.
  • x_offset / y_offset - pixel offsets, up to Β±48000.
  • opacity - the slider that will bite you (see below).

Output is a single IMAGE - the composited result, same size as the base.

The opacity trap

This slider works backwards from what its name implies. In the code, opacity is really a fade-to-transparent amount: at 0 (the default) the overlay's alpha is untouched - fully opaque. At 100 the alpha is zeroed - the overlay vanishes entirely. So you don't set "how visible should it be," you set "how much should I erase it." Half visible is 50, which is... fine, but if you grew up on Photoshop sliders where 0 = invisible, the default of 0 looking fully visible will confuse you once, and on this node it's a classic "why is my layer ignoring me" moment. Zero means full opacity here.

Installing it

Part of ComfyUI-JNK-Tiny-Nodes, so pack-level install: search JNK in ComfyUI Manager β†’ Install β†’ restart, or:

cd ComfyUI/custom_nodes/
git clone https://github.com/Aljnk/ComfyUI-JNK-Tiny-Nodes.git

The pack lists opencv-python, pygame, and google-genai in requirements.txt, but this node runs on PIL and numpy, both already present in ComfyUI. No extra installs, no model downloads.

Where people get burned

Beyond the opacity inversion, the usual suspects: forgetting that the overlay needs an alpha channel to do anything interesting (a fully opaque JPG pasted at top-left just covers the base), and expecting rotation in top-left mode - it only rotates when position_type is center. Offset values are huge by design (that Β±48000 range), so don't be shy. It's the node to reach for when you want explicit, tweakable layer placement instead of whatever a batch-combine node does by default.

CategoryπŸ”§ JNK

Inputs (7)

NameTypeDefaultDescription
base_imageIMAGEβ€”
overlay_imageIMAGEβ€”
position_typeCOMBO2 options: top-left, center
center_rotationINT0-360–360β€”
x_offsetINT0-48000–48000β€”
y_offsetINT0-48000–48000β€”
opacityFLOAT00–100β€”

Outputs (1)

NameTypeDescription
IMAGEIMAGEβ€”