Nodes/Comfyui-PixNodes/Get Video from Path List (PixNodes)
ComfyUI Node

Get Video from Path List (PixNodes)

Pick a video from a list of file paths

By pixixai·Created 8 months ago·Updated 6 months ago· 24
Get Video from Path List (PixNodes)
    • video
    • video_path
    • name
    • index
    • total
    video_paths_json
    index0

    You have a list of video file paths - from Pix_CreateVideoList, from a folder scan, from a text file - and you need to select one to process. Pix_GetVideoFromPathList does exactly that, with a built-in preview player and a native VIDEO object out. It's the bridge between "paths as data" and "video as a first-class ComfyUI type."

    The inputs are video_paths_json (a STRING, forced input) and index (an INT, 0–999999). The path list parsing is forgiving on purpose: it accepts a JSON array (["E:/a.mp4", "E:/b.mp4"]), newline-separated paths, comma-separated paths, even Windows "copy as path" output with the surrounding quotes - it strips them. That's a small quality-of-life thing that saves real time when you're pasting from a file explorer. The index wraps modulo the list length, so an index of 7 on a 3-video list picks video 1 - looping behavior that makes it safe to drive with a counter.

    The five outputs are the payoff: video (a VIDEO object - a reference to the file, not decoded frames, so it's cheap), video_path (the absolute path), name (just the filename), index, and total. The path-plus-name outputs are the reason this node beats a pure object selector: if you're feeding a traditional loader like VHS_LoadVideoPath, you grab video_path; if you're using the modern VIDEO stack, you grab video. index/total are handy for progress display or for checking which clip you're on.

    Two implementation notes that explain real-world behavior. First, it's an OUTPUT_NODE, and the frontend builds a preview player that hard-links or copies the selected file into ComfyUI's temp folder, reading FPS via OpenCV if it's available - that's the "why is there a video player under this node" answer, and it also means you might see cv2 in the picture even though it's optional (missing OpenCV just means a default 30fps timecode display, not an error). Second, and this is the compatibility one: creating the VIDEO object requires comfy_api.latest, the new API that ships with current ComfyUI. If you're on an old build, you'll see the "requires ComfyUI V0.3+" warning and video comes out null. Update ComfyUI before debugging anything else.

    Install is the standard PixNodes path - ComfyUI Manager, search PixNodes, restart - or:

    cd ComfyUI/custom_nodes
    git clone https://github.com/pixixai/Comfyui-PixNodes
    cd Comfyui-PixNodes
    pip install -r requirements.txt
    

    then restart. Requirements are just openai and Requests - no ffmpeg, no pyav in the actual install, regardless of what a blog post claims.

    It pairs with Pix_CreateVideoList (its video_paths_list output feeds this node's path input) or Pix_GetVideoFromVideoList (the pure-object equivalent when you're already working with VIDEO objects instead of paths). Choose this one when your data source is paths; choose the other when it's objects.

    CategoryPixNodes/video

    Inputs (2)

    NameTypeDefaultDescription
    video_paths_jsonSTRING
    indexINT00–999999

    Outputs (5)

    NameTypeDescription
    videoVIDEO
    video_pathSTRING
    nameSTRING
    indexINT
    totalINT