Nodes/ComfyUI-CustomNodeKit/视频网格拼接
ComfyUI Node

视频网格拼接

Put the driving video next to the generated video and see what went wrong

By user2318·Created 4 months ago·Updated about a month ago· 56
视频网格拼接
    • video_path
    video_paths
    layout水平排列
    audio_source无音频
    match_method自适应(填满)
    fps25.00
    crf23
    duration_mode自动(最短)
    output_path_prefixvideo/grid_output

    The fastest way to evaluate a motion-transfer result is to put the source pose video and the generated video side by side and watch them together. VideoGridCompose is exactly that: it takes up to four video file paths, arranges them in a grid via ffmpeg, and writes a single composited file to ComfyUI's output folder. Because it streams through ffmpeg's filter graph instead of decoding every frame into the graph, it handles long clips without eating VRAM or RAM.

    The classic use here is debugging WanAnimate and SCAIL-2 runs: left pane the driving video, right pane the generation, and you can literally see whether the pose was followed, whether the subject drifts, and where the chunk seams are. It's also handy for contact sheets of multiple generations to pick the winner.

    The inputs that matter

    • video_paths - one path per line in a multiline box, up to 4 (duplicates and blank lines are dropped). Paths can be relative to the ComfyUI root or absolute.
    • layout - 水平排列 (horizontal strip), 垂直排列 (vertical strip), 田字格2×2 (2×2 grid), 左一右N (one left, N right), 上一+下N (one top, N below).
    • audio_source - which input's audio survives to the output (or none). Nice when you want to compare against the original sound.
    • match_method - how mismatched resolutions are reconciled: 自适应(填满) stretches to fill tiles, 自适应(保持比例) fits without distortion, 统一到最大/统一到最小 scale everything to the biggest or smallest input.
    • fps (default 25) - output frame rate; 0 picks the highest input rate.
    • crf (default 23) - encode quality, lower is better (the tooltip suggests 18–28).
    • duration_mode - which source sets the timeline: 自动(最短)/自动(最长)/视频1..4. This matters because mismatched clips otherwise get cut at the first short one. It skips execution if the chosen reference is a still image rather than a video.
    • output_path_prefix (default video/grid_output) - where the result lands, relative to ComfyUI's output directory.

    The single output is video_path - a string pointing at the composited file.

    Where it fits

    This is the terminal node of the pack's pose and animation workflows (the README's workflow section calls it after CrossFadeImages merges chunk outputs). Keep crf reasonable - 23 is fine for review, drop toward 18 if you're going to upload the comparison. If tiles come out letterboxed in a weird way, check match_method: for mixed resolutions, 保持比例 is usually the honest view.

    Install

    Part of ComfyUI-CustomNodeKit. ComfyUI Manager → search "ComfyUI-CustomNodeKit", or:

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

    Restart ComfyUI. ffmpeg comes via the pack's imageio-ffmpeg dependency, so no system install needed.

    Categoryvideo

    Inputs (8)

    NameTypeDefaultDescription
    video_pathsSTRING多行视频路径,每行一个,最多支持4路(自动去重去空行)
    layoutCOMBO水平排列拼接布局模式
    audio_sourceCOMBO无音频选择哪一路视频的音频作为输出音频
    match_methodCOMBO自适应(填满)各视频尺寸匹配方式
    fpsFLOAT25.000–120输出帧率,设为0自动取最高输入帧率
    crfINT230–51编码质量,越低质量越高(建议18-28)
    duration_modeCOMBO自动(最短)时长同步模式:以哪一路输入为基准对齐时长。自动(最短)=以最短时长为准;自动(最长)=以最长时长为准;视频N=以第N路视频的时长为准。若选中的是图片则跳过执行。Duration sync mode: which input to use as duration reference. Auto(shortest)=use shortest duration; Auto(longest)=use longest duration; VideoN=use the Nth video's duration. Skips execution if the selected source is an image.
    output_path_prefixSTRINGvideo/grid_output输出路径前缀(相对于ComfyUI输出目录)

    Outputs (1)

    NameTypeDescription
    video_pathSTRING