Nodes/ComfyUI-Purz/Media Extractor Upload (Purz)
ComfyUI Node

Media Extractor Upload (Purz)

A video frame picker that remembers

By purzbeats·Created about a year ago·Updated 3 months ago· 24
Media Extractor Upload (Purz)
    • image
    video(no video)
    frame_index0

    The problem with a "pick a frame from a video" node is usually persistence - you pick, you close the browser, and your pick is gone. Media Extractor Upload (Purz) fixes that the boring, reliable way: the video gets uploaded to ComfyUI's input/ directory when you select it, and the workflow serializes the filename and the frame index. Reload the page, come back next week, and the node still knows which video and which frame you meant. It's the server-side sibling of the client-side Media Extractor, and it's the one you use when you want your work to survive a refresh.

    From ComfyUI-Purz's Purz/Interactive family, by PurzBeats (a Comfy Org staffer).

    How it works

    Path B in the README's scheme. Instead of keeping the video in the browser, the file is uploaded to ComfyUI's input/ directory the moment you pick it. The node shows a dropdown of every video in that directory, plus a frame_index input - and because both are ordinary workflow inputs, they serialize with the saved graph. That's the whole persistence trick: reload the workflow, the values are right there.

    Extraction happens server-side with OpenCV: the backend opens the video with cv2, seeks to frame_index, and returns that frame as an IMAGE ([1, H, W, 3]). The node also watches the underlying file's modification time, so if you re-upload a video with the same name, the workflow knows its content changed and re-extracts instead of trusting a stale frame.

    The inputs that matter

    • video - the filename, picked from a dropdown of everything in ComfyUI's input/. This is the only input that has to change per project.
    • frame_index - which frame to extract, 0 to 999999, default 0. Frame 0 is the first frame, so you can also use this node as a deterministic "first frame of a video" extractor by leaving it at 0.

    Output is image, type IMAGE, the single frame at frame_index. Feed it into img2img, a preprocessor, or the pack's Interactive Filter.

    Installing it

    ComfyUI Manager - search ComfyUI-Purz - or:

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

    Restart ComfyUI. Requirements are OpenCV, Pillow, torch, numpy - the OpenCV dependency does the extraction, and you already have it. No models.

    Where people get burned

    First: the video now lives in input/, so it counts against your ComfyUI storage and shows up in any node that scans that directory - fine, just know where your disk space went. Second: if you re-upload a file with the same name, the node detects the change and re-extracts, but other nodes that reference that filename may not be as smart. Third, the small UX tradeoff versus the client-side node: you pick the frame by index rather than by scrubbing a video player - the upload variant is a "pick a frame number" node, not a "watch and pause" node. If you want the player experience, use Media Extractor (Purz) for the session, and this one when persistence matters more.

    CategoryPurz/Interactive

    Inputs (2)

    NameTypeDefaultDescription
    videoCOMBO(no video)1 options: (no video)
    frame_indexINT00–999999

    Outputs (1)

    NameTypeDescription
    imageIMAGE