Image Concatenate (AIIA Utils, Disk)
Side-by-side comparison videos without loading every frame into RAM
- output_directory
- concatenated_frame_count
Want to put a source talking-head video next to your generated one and compare lip-sync frame by frame? The naive ComfyUI way - load both image sequences as tensors, concatenate, feed to a video node - dies the moment the video gets long. 1,500 frames × 2 streams in VRAM is a one-way ticket to out-of-memory. This node sidesteps the whole problem by never holding more than one frame at a time.
AIIA Utils Image Concatenate (Disk) takes two directories of frame images, concatenates each corresponding frame, and writes a brand-new directory with the results. It's the disk-mode sibling of the pack's in-memory image utilities, and it's the tool you reach for when the thing you're building is a comparison or multi-panel video of anything non-trivial.
How it works
Pure disk-to-disk streaming. For each pair it reads one frame from directory 1, one from directory 2, concatenates them into a new image, saves it, and frees the tensors before moving on. Nothing accumulates in memory, so the length of the sequence is effectively unlimited. File order comes from a natural sort on the numbers in the filenames - frame_001.png, frame_002.png… - which is exactly how the pack's own ToDisk nodes name things, so it drops into the OOM-safe pipeline without friction.
The output lands in a fresh folder under ComfyUI's output/ directory, named after your output_subdir_name plus a timestamp and a random suffix (so repeated runs never collide).
The inputs that matter
- directory_1 / directory_2 - absolute paths to the two frame folders. That's the whole job: this node has no tensor input at all.
- direction -
right,down,left,up.rightgives you the classic side-by-side;downstacks top-and-bottom. - match_image_size (default on) - resizes the second sequence to match the first (or vice versa per
base_size_from), keeping aspect ratio. - background_color -
white,black, or#RRGGBB. Whatever's left over when the resized image doesn't fill the frame gets padded with this. - output_subdir_name - the folder name prefix; defaults to
concatenated_frames_AIIA.
Outputs: output_directory (the STRING path - wire it straight into AIIA Video Combine's frames_directory input) and concatenated_frame_count (INT, so you can sanity-check that both dirs had the same number of frames).
Install
Standard pack install, nothing extra:
cd ComfyUI/custom_nodes
git clone https://github.com/havvk/ComfyUI_AIIA.git
or ComfyUI Manager → search "ComfyUI_AIIA", restart. Pillow comes with ComfyUI, so there's no hidden dependency.
Common issues
- "Frame count is off." The node concatenates pairwise, so a directory with 1,500 frames and one with 1,499 produces 1,499 outputs and a warning. If your two sequences came from different-length generations, trim one first.
- Wrong order. The natural sort parses digits out of filenames. If your files aren't zero-padded (
frame_1.png,frame_10.png,frame_2.png), string sorting alone would scramble them - the node handles that, but only when the digits are extractable. - "Directory not found." Absolute, existing paths only - the pack is strict about this everywhere. A relative path fails silently.
Inputs (7)
| Name | Type | Default | Description |
|---|---|---|---|
| directory_1 | STRING | path/to/frames1 | — |
| directory_2 | STRING | path/to/frames2 | — |
| direction | COMBO | right | 4 options: right, down, left, up |
| match_image_size | BOOLEAN | true | — |
| base_size_from | COMBO | directory_1 | 2 options: directory_1, directory_2 |
| output_subdir_name | STRING | concatenated_frames_AIIA | — |
| background_coloropt | STRING | white | 背景颜色 (例如 'white', 'black', '#RRGGBB') |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| output_directory | STRING | — |
| concatenated_frame_count | INT | — |