Nodes/ComfyUI-NL_Nodes/πŸ”€ NL Merge
ComfyUI Node

πŸ”€ NL Merge

Nuke-style A/B compositing, minus the Nuke license

By NOLABEL-VFXΒ·Created 9 months agoΒ·Updated 2 months agoΒ· 0
πŸ”€ NL Merge
  • A
  • B
  • A_mask
  • B_mask
  • mask
  • image
  • mask
  • image_info_json
β—„operationoverβ–Ί
β—„set_bbox_tounionβ–Ί
β—„invert_maskfalseβ–Ί
β—„mix1.00β–Ί
β—„A_image_info_jsonβ–Ί
β—„B_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, over by default. Change it when you want difference, plus, multiply, etc.
  • set_bbox_to - union, intersection, A, or B. This is the canvas behavior for mismatched input sizes, and union is 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.

CategoryNOLABEL/Color

Inputs (11)

NameTypeDefaultDescription
AIMAGEForeground image stream.
BIMAGEBackground image stream.
operationCOMBOoverNuke-style merge operation.
set_bbox_toCOMBOunionCanvas behavior for differently sized inputs.
invert_maskBOOLEANfalseInvert the optional effect mask.
mixFLOAT1.000–1Dissolve between B at 0 and the full merge at 1.
A_maskoptMASKOptional matte for A; missing defaults to solid.
B_maskoptMASKOptional matte for B; missing defaults to solid.
maskoptMASKOptional effect mask applied after the merge.
A_image_info_jsonoptSTRINGOptional serialized color metadata for A.
B_image_info_jsonoptSTRINGOptional serialized color metadata for B.

Outputs (3)

NameTypeDescription
imageIMAGEβ€”
maskMASKβ€”
image_info_jsonSTRINGβ€”