Nodes/Eric/Combine Results
ComfyUI Node

Combine Results

Union, intersection, or concat — merge two search sets

By EricRollei·Created 7 months ago·Updated 7 months ago· 2
Combine Results
  • results_a
  • results_b
  • results
modeunion
max_results100

Once you've got two different searches, you'll immediately want to combine them - and this is the node that does it. Combine Results takes two SEARCH_RESULTS sets and merges them one of three ways: union (everything, keeping the higher score for duplicates), intersection (only files present in both, averaged scores), or concat (just append them, no dedup). One node, three set operations, no Python required.

It's a utility node, but it unlocks real workflows. The pattern that earns its keep: run Search by Text for "portrait" and Search by Text for "dramatic lighting", then intersection to find dramatic portraits without writing a fragile combined query. Or run two queries with different result_type filters and union them to search across mixed media in one pass. Union is the default for a reason - it's the "I want everything from both, best version of each" mode, and it deduplicates by file path while keeping the highest score.

Inputs and modes

Required: results_a, results_b, and mode (union / intersection / concat). Optional: max_results (default 100, up to 500). Output: results (SEARCH_RESULTS).

  • union - all unique results across both, higher score kept. The everyday default.
  • intersection - only files in both sets, scores averaged. The "these two searches agree" mode.
  • concat - simple concatenation, duplicates kept. For stacking ranked lists where you want original ordering preserved.

Install

Same pack install as every node here - ComfyUI Manager (search "Semantic-Search") or git clone https://github.com/EricRollei/Semantic-Search into custom_nodes, install the requirements.txt deps, restart, nodes under Eric/SemanticSearch.

Where people get burned

  • Intersection returns nothing. If the two searches never produced a common file, that's an empty result - usually because the searches were too different or one was too filtered. Loosen min_score/top_k on the input searches before suspecting the node.
  • Scores changed and it's not a bug. Union keeps the higher score; intersection averages. If your scores look different after combining, that's the mode working. Concat preserves everything untouched.
  • The "why is this a thing" moment. If you only ever run one search and pipe it to output, you'll never touch this node - and that's fine. It exists for multi-query workflows, and it's much nicer than trying to bolt the logic together with text-manipulation nodes.

Combine Results is set theory wearing a ComfyUI hoodie. It's the glue between the pack's search nodes, and it turns "find things" into "find things that match this and this."

CategoryEric/SemanticSearch

Inputs (4)

NameTypeDefaultDescription
results_aSEARCH_RESULTS
results_bSEARCH_RESULTS
modeCOMBOunion3 options: union, intersection, concat
max_resultsoptINT1001–500

Outputs (1)

NameTypeDescription
resultsSEARCH_RESULTS