Nodes/Chaosaiart-Nodes/🔶 Merge Folders
ComfyUI Node

🔶 Merge Folders

🔶 Merge Folders

By chaosaiart·Created 2 years ago·Updated about a year ago· 117
🔶 Merge Folders
    • Info
    • MERGE_FOLDERS
    â—„Output_Foldermerge_folders_chaosaiartâ–º
    ◄if_Size_not_fit▾►
    â—„path_1â–º
    â—„path_2â–º
    â—„path_3â–º
    â—„path_4â–º
    â—„path_5â–º
    â—„path_6â–º
    â—„path_7â–º
    â—„path_8â–º
    â—„path_9â–º

    This one's a step outside the usual per-image node - it's a filesystem utility that lives inside your workflow. Point it at up to nine folders of images and it combines them into a single output folder, which is the kind of thing you end up needing once you've done a few rounds of Chaosaiart's frame-by-frame animation approach and have separate directories of frames from different runs or different batches that you now want stitched into one video.

    Output_Folder is where the merged result lands (default merge_folders_chaosaiart). path_1 is required - your first source folder - and path_2 through path_9 are optional additional sources, so you can combine anywhere from one folder up to nine. if_Size_not_fit matters more than it looks: source folders full of frames rendered at different resolutions (say, you changed your Image_Size setting partway through a long animation session) won't merge cleanly by default, so this tells the node whether to crop or resize mismatched images to make them consistent before writing them into the merged folder. Get this wrong for your use case and you'll either lose content off the edges of some frames (crop) or get subtly stretched/squashed images mixed in with correctly-proportioned ones (resize) - worth picking deliberately rather than leaving on default, especially if your source folders genuinely differ in aspect ratio and not just resolution.

    It's marked as an output node, meaning its real job is the side effect - writing merged files to disk - rather than passing image data through the graph. Its outputs, Info (a text status of what got merged) and MERGE_FOLDERS (type PATH), exist mainly so downstream nodes can pick up the resulting folder location programmatically, for instance to hand off to a video-stitching step later in the same workflow.

    Install: search "Chaosaiart-Nodes" in ComfyUI Manager, or use "Install via Git URL" with https://github.com/chaosaiart/Chaosaiart-Nodes. Manually: cd ComfyUI/custom_nodes && git clone https://github.com/chaosaiart/Chaosaiart-Nodes, then restart ComfyUI. On Linux, also run pip install opencv-python and pip install tqdm inside your venv - since this node is doing real image-file manipulation on disk, opencv-python is the dependency actually carrying the weight here, not just sitting unused.

    A couple of practical notes before you rely on this in a real pipeline: the path fields are plain strings, so they need to be filesystem paths ComfyUI's process can actually read - a typo or a relative path resolved from the wrong working directory will fail quietly rather than with an obvious error, so it's worth checking the Info output after a run to confirm it actually found and merged what you expected. And because this node writes to disk as a side effect, don't point Output_Folder at a directory you care about without a backup - there's nothing here to warn you if you're about to overwrite existing files with the same names.

    Category🔶Chaosaiart/video

    Inputs (11)

    NameTypeDefaultDescription
    Output_FolderSTRINGmerge_folders_chaosaiart—
    if_Size_not_fitCOMBO2 options: crop, resize
    path_1STRING—
    path_2optSTRING—
    path_3optSTRING—
    path_4optSTRING—
    path_5optSTRING—
    path_6optSTRING—
    path_7optSTRING—
    path_8optSTRING—
    path_9optSTRING—

    Outputs (2)

    NameTypeDescription
    InfoSTRING—
    MERGE_FOLDERSPATH—