Nodes/ComfyUI-NL_Nodes/🎯 NL Match
ComfyUI Node

🎯 NL Match

Make two image streams actually comparable

By NOLABEL-VFXΒ·Created 9 months agoΒ·Updated 2 months agoΒ· 0
🎯 NL Match
  • A
  • A_mask
  • B
  • B_mask
  • A
  • A_mask
  • A_image_info_json
  • B
  • B_mask
  • B_image_info_json
β—„targetcontextβ–Ί
β—„match_resolutiontrueβ–Ί
β—„match_batchtrueβ–Ί
β—„match_color_spacetrueβ–Ί
β—„resize_modefitβ–Ί
β—„batch_moderepeat_lastβ–Ί
β—„mask_default1.00β–Ί
β—„target_width0β–Ί
β—„target_height0β–Ί
β—„target_batch_size1β–Ί
β—„target_color_spaceβ–Ί
β—„A_image_info_jsonβ–Ί
β—„B_image_info_jsonβ–Ί

NL Match is the boring, essential utility of this pack: it takes two image streams, A and B, and aligns them so you can actually compare, blend, or merge them. If you've ever tried to wire two images of different resolutions or frame counts into a single node and watched it explode (or silently do the wrong thing), you know exactly why this exists.

The problem it solves is the classic pipeline mismatch: your generated render is 832Γ—480, the plate is 1920Γ—1080, and one of them is a batch of 10 frames while the other is 24. Diffusers and matchers choke on that. NL Match normalizes both streams to a common ground - matching resolution, batch length, and colorspace context - while keeping their masks and metadata intact. Then every downstream node gets inputs it can actually work with.

What it aligns

  • target - what to align against: A, B, context (the NL Workflow resolution), or custom.
  • match_resolution / match_batch / match_color_space - toggles for each axis, so you can align dimensions but deliberately not touch colorspace, for example.
  • resize_mode - fit, fill, or stretch for the resolution alignment.
  • batch_mode - repeat_last, cycle, truncate, or pad_zero for length matching.
  • mask_default - what fills in for a missing mask (default 1 = solid).
  • target_width / target_height / target_batch_size / target_color_space - used when target is custom.

Inputs: A/B streams with optional A_mask/B_mask and A_image_info_json/B_image_info_json color metadata. Outputs: both aligned streams plus their masks and metadata, so the alignment is visible and inspectable.

Where it sits in a workflow

Reach for it before any NLMerge, comparison, or A/B compositing step - or before any node that needs two streams of identical shape. The pack's own manual testing treats NL Match, Fit Frame, Merge, and Shuffle as one family: size the input, align the streams, merge, and shuffle channels. The tip that saves real pain: keep match_batch on and pick repeat_last unless you've thought about what truncate will do to your tail frames.

Install

Standard pack route:

cd ComfyUI/custom_nodes
git clone https://github.com/NOLABEL-VFX/ComfyUI-NL_Nodes

or ComfyUI Manager β†’ "ComfyUI-NL_Nodes", restart. No heavy dependencies, no models to download - it's pure tensor plumbing. The context target assumes you've configured the NL Workflow panel; if you haven't, it defaults to A's shape, which is usually a fine fallback for a first run.

CategoryNOLABEL/Utilities

Inputs (17)

NameTypeDefaultDescription
targetCOMBOcontext4 options: A, B, context, custom
match_resolutionBOOLEANtrueβ€”
match_batchBOOLEANtrueβ€”
match_color_spaceBOOLEANtrueβ€”
resize_modeCOMBOfit3 options: fit, fill, stretch
batch_modeCOMBOrepeat_last4 options: repeat_last, cycle, truncate, pad_zero
mask_defaultFLOAT1.000–1β€”
target_widthINT00–16384β€”
target_heightINT00–16384β€”
target_batch_sizeINT11–4096β€”
target_color_spaceSTRINGβ€”
AoptIMAGEOptional A image stream.
A_maskoptMASKOptional A mask. Missing masks are filled from mask_default.
A_image_info_jsonoptSTRINGOptional serialized color metadata for A.
BoptIMAGEOptional B image stream.
B_maskoptMASKOptional B mask. Missing masks are filled from mask_default.
B_image_info_jsonoptSTRINGOptional serialized color metadata for B.

Outputs (6)

NameTypeDescription
AIMAGEβ€”
A_maskMASKβ€”
A_image_info_jsonSTRINGβ€”
BIMAGEβ€”
B_maskMASKβ€”
B_image_info_jsonSTRINGβ€”