Nodes/ComfyUI_Swwan/Merge Batch
ComfyUI Node

Merge Batch

Concatenate every batch you feed it

By aining2022·Created 9 months ago·Updated 11 days ago· 33
Merge Batch
    • list

    Sometimes you have two or three sources of images, latents, or data and you just want them all in one list, in order, before the next node processes them. MergeBatch is the utility that does it: connect any number of batch/list outputs into it and it returns a single merged list. Where list_Merge is the same idea with an Any output type, this one declares a LIST output - so if a downstream node is picky about the type, this is the version that satisfies it.

    It lives in the pack's Apt_Preset/data/😺backup category alongside the other list utilities, and its implementation is essentially identical to list_Merge's: no fixed input sockets, runtime discovery of whatever you've wired in, concatenation in connection order. The pack clearly has both because they evolved from different workflows - pick whichever matches the type your chain expects.

    How it works

    The info_schema shows an empty input list, which surprises people the first time. That's by design. The node reads the workflow graph at execution, finds every input connected to it, and merges them all into one list, preserving order: whatever you connected first is at the front of the merged result. This is what makes it flexible - there's no input count to configure, no "max inputs" to hit, just wire in as many as you need.

    The output is a single list, marked with the LIST type, ready for anything that consumes a list: slicing nodes, batch converters, per-item processors.

    When you'd use it

    The textbook case: you generated several batches (different seeds, different prompts, a mix of folder-loaded and freshly-generated images) and you want to feed them all to one downstream step - a contact sheet, a batch detail pass, a filter. Merge them first, process once. It also composes well with the pack's Image Batch to Image List / List to Image Batch converters if your sources are mixed between tensor-batches and lists.

    Installing it

    It ships in ComfyUI_Swwan:

    cd ComfyUI/custom_nodes
    git clone https://github.com/aining2022/ComfyUI_Swwan
    pip install -r ComfyUI_Swwan/requirements.txt
    

    Or install the pack via ComfyUI Manager, search "ComfyUI_Swwan".

    Where people get burned

    Order follows connection order, not visual position on the canvas - if you rewired and the merged list came out in a surprising order, check which wire you connected first, not where the node sits. And because inputs are discovered at runtime, a wrong-typed connection may only fail at execution, so a mismatched list (images merged with strings) can pass the node and blow up downstream. Keep one data type per merge. Also worth noting: this pack shares lineage with KJNodes and rgthree, so if ComfyUI Manager ever flags a conflict between ComfyUI_Swwan and another pack while you're updating, verify the actual missing node - the community has hit false "Swwan conflict" alarms that turned out to be unrelated KJNodes update issues.

    CategoryApt_Preset/data/😺backup

    Inputs (0)

    No inputs

    Outputs (1)

    NameTypeDescription
    listLIST