Merge
Stitch pipes and batches together in one node
- _way_out
- _junc_out
- _batch_out
Merge is the 0246 pack's consolidation node: feed it several Highway pipes, Junction pipes, and plain lists, and it merges each kind into a single output - one HIGHWAY_PIPE, one JUNCTION_PIPE, and one batch list. The author's description is as terse as the node: "pipe and batch merging."
It's the natural companion to the pack's two pipe types. Highway and Junction are great at bundling data down a wire, but if you've got two sources of pipes and want them as one pipe for the next stage - or a stack of lists you want flattened into a single batch output - you either write a pile of connectors or you drop a Merge. It's not a node you build a workflow around; it's the node that keeps a workflow from growing a second head.
How it works
Merge walks every input. Each one lands in one of three buckets by its shape:
- Highway pipes (
RevisionDictof kindhighway) merge lane-by-lane. Inflatmode, name collisions get suffixed with_pad(default"_") so nothing overwrites; indeepmode, same-type same-name lanes are concatenated into a list (RevisionBatch), which is the mode to reach for when you're genuinely combining batches. - Junction pipes merge by appending values into a single typed queue, preserving the junction's index bookkeeping.
- Plain lists (or anything not a pipe) get appended to the
_batch_outlist -deepmode flattens nested lists one level,flatkeeps them nested.
The inputs and outputs
_mode-flat(append, pad collisions) ordeep(recursively merge same-typed lanes)._pad- the collision suffix, default"_"._way_out- the mergedHIGHWAY_PIPE._junc_out- the mergedJUNCTION_PIPE._batch_out- the merged batch as a list.
You don't have to use all three outputs - merge just the pipes, or just the batches. Whatever you didn't feed comes out as a None/empty.
How to install it
The usual:
cd ComfyUI/custom_nodes
git clone https://github.com/Trung0246/ComfyUI-0246
restart, or ComfyUI Manager → search "ComfyUI-0246". No models.
Common issues & troubleshooting
A lane is missing or renamed. In flat mode, a name collision got _pad appended (data becomes data_). Either switch to deep (if the collision is genuinely same-type data you want combined) or check that your source lanes have distinct names.
Lists are nested when you expected flat (or vice versa). flat keeps sublists intact; deep flattens one level. If your _batch_out looks off, the mode is the first suspect.
An output is None when you expected data. You didn't feed that pipe kind - Merge only fills the outputs whose input kind actually appeared. Wire a Highway pipe in if you want _way_out to carry something.
Inputs (2)
| Name | Type | Default | Description |
|---|---|---|---|
| _mode | COMBO | 2 options: flat, deep | |
| _pad | STRING | _ | — |
Outputs (3)
| Name | Type | Description |
|---|---|---|
| _way_out | HIGHWAY_PIPE | — |
| _junc_out | JUNCTION_PIPE | — |
| _batch_out | * | — |