Nodes/ComfyWarp/Make Frame Dataset
ComfyUI Node

Make Frame Dataset

Extract the frames once, then stop thinking about it

By Sxela·Created 3 years ago·Updated 2 months ago· 49
Make Frame Dataset
    • FRAME_DATASET
    • Total_frames
    file_pathC:\code\warp\19_cn_venv\images_out\stable_warpfusion_0.20.0\videoFrames\650571deef_0_0_1
    update_on_frame_loadtrue
    start_frame0
    end_frame-1
    nth_frame1
    overwritefalse

    Before you can style-warp a video, you need its frames on disk as a folder of images. This is the node that does that, and it's the entry point for almost every ComfyWarp workflow. Point it at a video file - or a folder that's already been extracted, or even a glob pattern - and it hands back a FRAME_DATASET object plus the total frame count, ready to feed the loaders.

    What it accepts

    • A video file (mp4, mov, whatever ffmpeg reads): it extracts frames into a folder inside your ComfyUI output directory, named from a hash of the source file so the same video always maps to the same frames.
    • A folder of images: it just indexes them in sorted order.
    • A glob pattern: same thing, but you get to cherry-pick which files count.

    It also enforces some rules you'll hit as errors: a folder with mixed extensions (a png and a jpg in the same directory) throws, and if it finds zero frames it raises "Found 0 frames" rather than silently giving you an empty dataset. Those messages are annoyingly literal, but they're correct - clean the folder up and move on.

    The inputs

    • file_path - the video, folder, or glob. The default is a leftover Windows path from the author's machine; replace it. On Windows, backslashes work; the code normalizes them internally.
    • start_frame (default 0) and end_frame (default -1, meaning "to the end") - which range to keep. For a video these get passed to ffmpeg's select filter during extraction; for a folder/glob they just slice the file list.
    • nth_frame (default 1) - the "every Nth frame" slider. 1 keeps everything; 4 keeps a quarter of the frames. This is the knob for trading video length against compute time - and note the gotcha: if you extract every 4th frame, your rendered output will be 4× shorter at the same fps, so either lower RenderVideo's fps or interpolate later.
    • overwrite (default off) - if a frame set already exists for that video (same hash), it skips extraction. Tick it to re-extract after changing start_frame/end_frame/nth_frame.
    • update_on_frame_load (default on) - refreshes the frame list whenever a frame is pulled from the dataset, so frames saved by the loopback (e.g. SaveFrame) get picked up.

    Outputs

    FRAME_DATASET is the thing the loaders consume - wire it into LoadFrameFromDataset or LoadFramePairFromDataset. Total_frames is the count, and you'll see it plugged into RenderVideo's render_at_frame in the sample workflows so the video export fires exactly when the last frame is diffused.

    One habit that saves headaches: keep the source video and its extracted frames in a path without spaces or non-latin characters. The README calls this out for the pack in general, and it's genuinely where Windows users lose an hour - ffmpeg and path joins both misbehave on those. Make the dataset once, and every loader downstream stops caring about the source video entirely.

    CategoryWarpFusion

    Inputs (6)

    NameTypeDefaultDescription
    file_pathSTRINGC:\code\warp\19_cn_venv\images_out\stable_warpfusion_0.20.0\videoFrames\650571deef_0_0_1
    update_on_frame_loadBOOLEANtrue
    start_frameINT00–9999999999
    end_frameINT-1-1–9999999999
    nth_frameINT11–9999999999
    overwriteBOOLEANfalse

    Outputs (2)

    NameTypeDescription
    FRAME_DATASETFRAME_DATASET
    Total_framesINT