Nodes/Diffusion_pipe_in_ComfyUI/帧数分桶配置
ComfyUI Node

帧数分桶配置

The frame-count bucket list that video training lives and dies by

By TianDongL·Created 11 months ago·Updated 7 months ago· 69
帧数分桶配置
    • frame_buckets
    frame_buckets[1, 33, 81, 97]

    Training a video model isn't about aspect ratio alone - it's about how many frames each clip has. A 33-frame clip and a 97-frame clip don't fit in the same batch, and if you don't tell the trainer which lengths to expect, your dataset turns into a mess of wasted compute and failed batches. FrameBucketsNode is the tiny node that supplies that frame-count list. It's one of the most boring-looking nodes in this pack and one of the most necessary for video work.

    What it does

    One input, one output. frame_buckets takes a Python-style list of frame counts - the default is [1, 33, 81, 97] - and passes it through as the frame_buckets output. The tooltip is blunt about scope: "specifically for video model training." The list is the set of clip lengths diffusion-pipe will bucket your videos into; each clip gets padded or cut to the nearest bucket so training stays efficient.

    That default is worth reading closely. [1, 33, 81, 97] is a classic video-training shape: 1-frame buckets let stills ride along in the same run, then steps up through short and long clips. The other example the tooltip gives elsewhere - [1, 33] - is the minimal video setup if you only want stills plus one short clip.

    The node plugs into the optional frame_buckets input on GeneralDatasetConfig (training) or EvalDatasetConfig (evaluation). When you add it, also set video_clip_mode on GeneralConfig (none / single_beginning / single_middle / multiple_overlapping) - that's what tells the trainer how to pull clips out of your source videos, and it's the sibling knob this node depends on.

    Why bucket by frames at all

    Different video bases want different clip shapes - Wan-family models train around specific frame buckets, HunyuanVideo has its own habits, and the KB's video notes are full of "this model trains best at X frames." Fixed buckets let you control exactly which lengths you feed it, instead of letting the dataset decide and blowing up your VRAM with a 200-frame outlier.

    Installing the pack

    Shared install, Linux/WSL2 only, submodules mandatory:

    cd ComfyUI/custom_nodes/
    git clone --recurse-submodules https://github.com/TianDongL/Diffusion_pipe_in_ComfyUI.git
    git submodule update
    pip install -r Diffusion_pipe_in_ComfyUI/requirements.txt
    

    Restart and load the example workflow - its video-config section shows how FrameBucketsNode and video_clip_mode fit together.

    Common issues

    The silent-pass-through gotcha applies here hardest: the node is just a string wrapper, so a malformed list (bad brackets, trailing comma, a float where an int belongs) silently falls through to whatever the consumer does with it - usually nothing good. Validate your list before you queue a multi-hour run. And remember that frame buckets only matter if your dataset config actually feeds them in - wiring the node but forgetting to connect its output to GeneralDatasetConfig.frame_buckets is the most common way to think you've configured video training when you haven't.

    CategoryDiffusion-Pipe/dataset

    Inputs (1)

    NameTypeDefaultDescription
    frame_bucketsSTRING[1, 33, 81, 97]帧数分桶配置,专用于视频模型训练,格式:[1, 33, 81, 97]

    Outputs (1)

    NameTypeDescription
    frame_bucketsframe_buckets