Nodes/VRGameDevGirl Video Enhancement Nodes/VRGDG Build Video Output Path (General)
ComfyUI Node

VRGDG Build Video Output Path (General)

A Little String Node That Decides Where Your Video Gets Saved

By vrgamegirl19·Created about a year ago·Updated 2 days ago· 717
VRGDG Build Video Output Path (General)
    • output_path
    output_folder
    chunk_index
    base_namevideo
    overwrite_mode

    VRGDG_BuildVideoOutputPath_General is the most boring-sounding node in this pack, and it's also the one that quietly prevents an annoying class of disaster: your final video being silently overwritten or landing in the wrong folder. It computes the output file path for a video-combine step - it does not save anything itself, it just hands you a STRING path that other nodes use. The name is a promise: it's the general-purpose path builder for the pack's combine pipeline.

    How it works: you give it an output folder, a chunk index, a base name, and an overwrite mode, and it builds the canonical filename {base_name}_{chunk_index:04d} (so video_0000, video_0001, ...) inside that folder. Then comes the part that matters: overwrite behavior. In backup mode it moves any existing MP4 with that prefix into a backup/ subfolder with a timestamped .bak name before you overwrite it - so re-runs don't destroy your last good render. In overwrite mode it just returns the path and lets the encoder do its thing. It also creates the output folder if it doesn't exist, which saves you the "directory not found" failure on a fresh run.

    The inputs that matter

    • output_folder - where the video goes. Created automatically if missing.
    • chunk_index - the zero-based index that makes the filename unique across chunks (video_0000, video_0001...).
    • base_name - the name prefix (default video).
    • overwrite_mode - the important choice: backup (keeps a .bak copy of anything it's about to clobber) or overwrite (return the path, let the encoder overwrite).

    Output: output_path - the STRING path. Feed it to your video-save/encode node so everything writes to the same place.

    Why it exists

    The pack's combine pipeline runs many chunks across multiple sets, and the "where do I save this and did I just delete the previous render" problem is real. This node centralizes the filename logic so every chunk is numbered consistently and every re-run is either safe (backup mode) or intentional (overwrite mode). It's the kind of node that looks trivial until you realize it's saving you from data loss on run #47 of a long render.

    Install

    cd ComfyUI/custom_nodes
    git clone https://github.com/vrgamegirl19/comfyui-vrgamedevgirl
    

    Or search vrgamedev in ComfyUI Manager. No special dependencies - it's pure path logic.

    Common issues

    • Files aren't backed up: check overwrite_mode is literally backup. The backup only triggers for existing .mp4 files matching the exact prefix.
    • "Directory not found" from your encoder: the node creates the folder, but only if you're passing its output path downstream. If you typed the folder elsewhere, you're bypassing it.
    • Video saved without an extension: this node returns a path without an extension - the extension comes from your encoder. Don't add one here or you'll double it.

    Honest take: nobody googles this node for fun, but if you've ever lost a render to an overwrite, you get it immediately. It's a small piece of process hygiene that the pack's long-running music-video builds genuinely need - boring, correct, and quietly doing its job every single run.

    CategoryVRGDG

    Inputs (4)

    NameTypeDefaultDescription
    output_folderSTRING
    chunk_indexINT
    base_nameSTRINGvideo
    overwrite_modeSTRING

    Outputs (1)

    NameTypeDescription
    output_pathSTRING