Nodes/fxai-toolkit/凤希AI - 帧数计算器
ComfyUI Node

凤希AI - 帧数计算器

The no-audio frame calculator for when you know seconds, not samples

By fxai666·Created 4 months ago·Updated 3 days ago· 35
凤希AI - 帧数计算器
    • 最终总帧数
    • 帧率(小数)
    • 帧率(整数)
    秒数15.00
    帧率24
    对齐基数8
    过渡帧1
    对齐方式向上取整

    Every video model on earth is picky about frame counts, and the pickiness is where long videos die. FxAiFrameCalculator (凤希AI - 帧数计算器) is the pack's plain-vanilla answer to "how many frames do I generate for N seconds of video": type the seconds, get the aligned frame count. It's the general-purpose sibling of FxAIAudioFrameCalculate - that one measures a real audio clip and derives seconds for you; this one takes the seconds directly, which is what you want when your clip length is a number you've already decided, not something you need an audio file to tell you.

    Why alignment matters

    A video VAE doesn't encode any old number of frames. Latents are shaped on a grid, and off-grid frame counts force the model to pad or truncate - the result is either a segment that's subtly too short or, worse, frame counts that drift between segments in a loop. The fix this node applies is the same one used throughout the pack: round your raw seconds × fps to the nearest multiple of 对齐基数 (alignment base), then add the transition frames. The default base of 8 is the LTX-compatible grid; if your model wants a different stride (some want 16), change it and the whole pack's other calculators should match.

    Inputs

    • 秒数 (seconds) - float, the clip duration. Default 15.
    • 帧率 (fps) - int, default 24.
    • 对齐基数 (alignment base) - int, default 8.
    • 过渡帧 (transition frames) - int, default 1. The overlap you're reserving for the seam between segments.
    • 对齐方式 (alignment mode) - 向上取整 (round up) or 向下取整 (round down), default up. Rounding up means you never come up short; rounding down is the choice when VRAM is the constraint and a slightly shorter segment is acceptable.

    Outputs

    • 最终总帧数 (final total frames) - the INT you actually feed the sampler.
    • 帧率(小数) / 帧率(整数) - the fps as float and int, passed through for wiring into video nodes that want the rate separately. Nice when your video encoder needs to know the fps without you duplicating the value.

    Install

    Part of fxai-toolkit (凤希全能节点包), MIT-licensed, by 凤希AI. ComfyUI Manager (search "fxai") or:

    cd ComfyUI/custom_nodes
    git clone https://github.com/fxai666/fxai-toolkit
    # restart ComfyUI
    

    Pack auto-installs soundfile and psutil; no models, no ffmpeg needed - it's pure math.

    Gotchas

    • This is the "I already know my clip length" calculator. For audio-synced work, FxAIAudioFrameCalculate is the better fit - it measures the actual audio so the frames and the soundtrack agree.
    • The 过渡帧 addition is the one thing beginners forget. It's not a frame-rate thing; it's the overlap budget for stitching, and leaving it at 1 keeps the pack's loop nodes happy.
    • Keep 对齐基数 consistent with the pack's segmenters and audio calculator - the whole system assumes one grid. Mixing 8 here and 16 there quietly reintroduces the drift you installed this pack to avoid.
    Category凤希AI/工具

    Inputs (5)

    NameTypeDefaultDescription
    秒数FLOAT15.00
    帧率INT24
    对齐基数INT8
    过渡帧INT1
    对齐方式COMBO向上取整2 options: 向上取整, 向下取整

    Outputs (3)

    NameTypeDescription
    最终总帧数INT
    帧率(小数)FLOAT
    帧率(整数)INT