Nodes/ComfyUI Wan VACE Prep/πŸͺ VACE Batch Context
ComfyUI Node

πŸͺ VACE Batch Context

The bookkeeping node behind the batch joiner

By stuttlepressΒ·Created 8 months agoΒ·Updated 25 days agoΒ· 100
πŸͺ VACE Batch Context
    • work_dir
    • workfile_prefix
    • video_1_filename
    • video_2_filename
    • is_first
    • is_last
    • assemble_video
    β—„input_listβ€”β–Ί
    β—„input_dirβ–Ί
    β—„project_nameβ–Ί
    β—„index0β–Ί
    β—„debugfalseβ–Ί
    β—„make_loopfalseβ–Ί

    Some nodes generate pixels. Some nodes do the accounting. VACE Batch Context is firmly in the second camp: it doesn't touch a single frame of video. Instead it takes a list of filenames, an iteration index, and hands back which two videos you should be joining right now, plus the flags that tell the rest of the workflow whether this is the first, last, or loop-closing iteration.

    And here's the honest framing the author themselves gives in the README: "This node drives my Wan VACE Video Joiner workflow. It may not be useful outside of that context." If you're following along with the pack's batch-join path, you'll use it. If you just want to join two clips, you don't need it - use VACE Join directly.

    How it works

    Feed it a list of video filenames plus the directory they live in, and an index (0-based). It validates the index, computes the current pair of filenames, and emits a set of signals:

    • video_1_filename / video_2_filename - the pair for this iteration (with input_dir prepended if you gave one).
    • is_first / is_last - true on the boundary iterations, so the batch-aware VACE Join node knows to keep the full opening and closing.
    • assemble_video - fires on the final iteration, used to gate the assembly step that glues everything together.
    • work_dir / workfile_prefix - where this iteration's intermediate files land. If you set a project_name, work files go under ComfyUI/output/<project_name>/vace-work/.

    There's also make_loop, which adds one extra iteration pairing the last video with the first - that's the seamless looping mode. When it's on, is_first and is_last are forced false, and assemble_video fires on the loop-closing iteration instead.

    The inputs and outputs that matter

    • input_list - a STRING list of video filenames (this input is forced, so it must be connected). Order matters; it's the join order.
    • input_dir - the directory containing them.
    • index - current iteration, 0-based. Valid range is 0 to (n-2) normally, 0 to (n-1) when looping.
    • project_name - optional; creates a per-project work folder under ComfyUI's output directory.
    • make_loop - enable the wrap-around transition.
    • debug - logs the current pair and flags to the console, which makes a wrong iteration obvious fast.

    Outputs: work_dir, workfile_prefix, video_1_filename, video_2_filename, is_first, is_last, assemble_video.

    Install

    ComfyUI Manager β†’ search "Wan VACE Prep" β†’ install β†’ restart, or:

    cd /path/to/comfyui/custom_nodes
    git clone https://github.com/stuttlepress/ComfyUI-Wan-VACE-Prep
    

    No dependencies beyond the pack itself.

    Common issues

    • "Need at least 2 videos to create transitions" - the node refuses to run on a single clip, and honestly, fair.
    • "Index out of range" - the error spells out the valid range, including the loop-mode variant. Off-by-ones in iteration counting are the whole reason debug exists.
    • It relies on an undocumented calling convention - the node uses is_input_list, where ComfyUI delivers every input as a list, and the README flags that this contract isn't documented in the Nodes 2.0 API. It works today; it's on the author's own "may be fragile across ComfyUI updates" list.
    CategoryWan VACE Prep/VACE

    Inputs (6)

    NameTypeDefaultDescription
    input_listSTRINGβ€”
    input_dirSTRINGDirectory containing input videos
    project_nameSTRINGProject name - workflow files will be created under ComfyUI/output/project_name.
    indexINT0Current iteration index (0 based)
    debugBOOLEANfalseLog some details to the console
    make_loopBOOLEANfalseGenerate an extra loop-closing transition between the last and first video

    Outputs (7)

    NameTypeDescription
    work_dirSTRINGβ€”
    workfile_prefixSTRINGβ€”
    video_1_filenameSTRINGβ€”
    video_2_filenameSTRINGβ€”
    is_firstBOOLEANβ€”
    is_lastBOOLEANβ€”
    assemble_videoBOOLEANβ€”