Nodes/ComfyUI LC123 Nodes/LC Dynamic Overlay
ComfyUI Node

LC Dynamic Overlay

Composite B onto A, then tune the opacity live

By lonecatone23·Created 2 months ago·Updated 3 days ago· 18
LC Dynamic Overlay
  • image_a
  • image_b
  • blended Image
opacity0.50

Overlaying one image on another is a two-step pain in most ComfyUI setups: you resize the top layer to match, wire a blend node, run the queue, squint at the result, and if the opacity's off you run the whole thing again. LC Dynamic Overlay (LCDynamicOverlay) collapses that into one node with a genuinely good trick: after the first run, you can adjust opacity on the node and it recomputes without a full regeneration.

Feed it image_a and image_b. A sets the resolution; B is fit-scaled to cover it (centered, preserving aspect). The single output is blended Image, and the node preview shows you A, B, and the blend at once.

How it works

The math is a standard alpha composite - out = A × (1 − opacity) + B_fit × opacity - with one subtlety that shows the author thought about it: when B is a different aspect ratio than A, the fit-resize letterboxes with empty padding, and the node builds a coverage mask so those empty pad pixels don't darken image A. That's the difference between a correct overlay and one that looks like you pressed a gradient onto your photo by mistake.

The opacity knob ranges 0 to 1 and the node clamps it. "Adjust after one queue" works because the blend is pure arithmetic on tensors already in memory - there's no model in the path to re-run, so the frontend can reblend the preview instantly. Same reason it's marked as an output node with its own preview strip.

Why you'd reach for it

Compositing jobs that would otherwise mean three nodes and a resize: putting a texture or pattern over a render at partial strength, a dirty-lens or watermark-ish overlay, checking what your subject looks like under a color-graded frame. Because it handles the resize and the centering for you, it's also the fastest way to A/B two images at different strengths to see which opacity reads better.

Install

Part of ComfyUI_LC123_nodes:

cd ComfyUI/custom_nodes
git clone https://github.com/lonecatone23/ComfyUI_LC123_nodes

or ComfyUI Manager, then restart. No dependencies beyond torch - no models, no downloads.

Where people get burned

The fit-scaling means B is always cropped-to-fit by letterboxing, not stretched - if you expect B to fill A edge-to-edge at a different aspect ratio, you'll see padding and think it's broken. It isn't; resize B yourself first if you want it stretched. And because it's a quiet niche pack with no real Reddit presence, the only documentation that matters is the README's image table and dynamic_overlay.py - both of which are accurate and short.

CategoryLC123/image

Inputs (3)

NameTypeDefaultDescription
image_aIMAGE
image_bIMAGE
opacityFLOAT0.500–1

Outputs (1)

NameTypeDescription
blended ImageIMAGE