π NL Merge
Nuke-style A/B compositing, minus the Nuke license
- A
- B
- A_mask
- B_mask
- mask
- image
- mask
- image_info_json
NLMerge is the pack's attempt to bring a real compositing merge into ComfyUI, and the family resemblance to Nuke is not an accident. It takes a foreground stream A and a background stream B and combines them with any of 30 Nuke-style operations - over, atop, plus, difference, color-dodge, screen, and the rest of the classic set. If you've ever composited in Nuke you'll recognize the operation list instantly; if you haven't, the short version is that "over" is the one you'll use 90% of the time, and the rest are the bag of tricks you reach for when "over" isn't what you want.
The difference from a simple alpha-blend node is the compositor's toolkit around it: per-stream mattes, an effect mask, bbox/canvas control for differently-sized inputs, and a mix control. That's what makes it a merge rather than a blend.
The controls that matter
operation- the merge mode,overby default. Change it when you want difference, plus, multiply, etc.set_bbox_to-union,intersection,A, orB. This is the canvas behavior for mismatched input sizes, andunionis the safe default (the result is as big as both inputs together).invert_mask- flips the effect mask.mix- dissolve between B (at 0) and the full merge (at 1). This is your "dial it back" knob and it's genuinely useful for matching - a 70% merge is often the tasteful answer.
Inputs: A (foreground), B (background), optional A_mask/B_mask mattes (missing ones default to solid), an optional effect mask applied after the merge, and A_image_info_json/B_image_info_json color metadata from upstream NL nodes. Outputs: the merged image, the resulting mask, and passthrough image_info_json.
Where it fits
This is the "put it together" step. A typical NOLABEL graph: NL Read the plate, generate or grade with NL Grade, and NLMerge the result over the plate with a matte - then NL Write the comp. Run NL Match upstream first if your A and B aren't already the same size and length, because the merge can only do so much about mismatched streams, and set_bbox_to gets confusing the more your inputs disagree.
Install
Standard pack install:
cd ComfyUI/custom_nodes
git clone https://github.com/NOLABEL-VFX/ComfyUI-NL_Nodes
or ComfyUI Manager β "ComfyUI-NL_Nodes", restart. No models, no ffmpeg requirement - pure tensor compositing, though the color-managed metadata passthrough behaves best with the PyOpenColorIO/OpenEXR deps installed. If your merge produces a black result, check that your A mask actually has values (a missing matte defaults to solid, which is probably not what a "black result" needs) and that mix isn't pinned at 0.
Inputs (11)
| Name | Type | Default | Description |
|---|---|---|---|
| A | IMAGE | Foreground image stream. | |
| B | IMAGE | Background image stream. | |
| operation | COMBO | over | Nuke-style merge operation. |
| set_bbox_to | COMBO | union | Canvas behavior for differently sized inputs. |
| invert_mask | BOOLEAN | false | Invert the optional effect mask. |
| mix | FLOAT | 1.000β1 | Dissolve between B at 0 and the full merge at 1. |
| A_maskopt | MASK | Optional matte for A; missing defaults to solid. | |
| B_maskopt | MASK | Optional matte for B; missing defaults to solid. | |
| maskopt | MASK | Optional effect mask applied after the merge. | |
| A_image_info_jsonopt | STRING | Optional serialized color metadata for A. | |
| B_image_info_jsonopt | STRING | Optional serialized color metadata for B. |
Outputs (3)
| Name | Type | Description |
|---|---|---|
| image | IMAGE | β |
| mask | MASK | β |
| image_info_json | STRING | β |