ComfyUI Node

Merge

Stitch pipes and batches together in one node

By Trung0246·Created 3 years ago·Updated about a year ago· 137
Merge
    • _way_out
    • _junc_out
    • _batch_out
    _mode
    _pad_

    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 (RevisionDict of kind highway) merge lane-by-lane. In flat mode, name collisions get suffixed with _pad (default "_") so nothing overwrites; in deep mode, 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_out list - deep mode flattens nested lists one level, flat keeps them nested.

    The inputs and outputs

    • _mode - flat (append, pad collisions) or deep (recursively merge same-typed lanes).
    • _pad - the collision suffix, default "_".
    • _way_out - the merged HIGHWAY_PIPE.
    • _junc_out - the merged JUNCTION_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.

    Category0246

    Inputs (2)

    NameTypeDefaultDescription
    _modeCOMBO2 options: flat, deep
    _padSTRING_

    Outputs (3)

    NameTypeDescription
    _way_outHIGHWAY_PIPE
    _junc_outJUNCTION_PIPE
    _batch_out*