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

凤希AI - MiniMax帧数计算器

Stop hand-computing H3 frame counts — let the audio length do it

By fxai666·Created 4 months ago·Updated 4 days ago· 35
凤希AI - MiniMax帧数计算器
  • 音频
  • 生成帧数
  • 视频时长
  • 剩余音频时长
  • 视频潜变量T
  • 音频潜变量T
过渡帧数0

FxAiMiniMaxFrameCalculate (凤希AI - MiniMax帧数计算器) exists because MiniMax H3 doesn't accept "any number of frames you feel like." H3 generates on a strict 17k+5 frame grid - 5, 22, 39, 56, 73, … - so an arbitrary "make it 130 frames" gets you a clip that doesn't exist and a model that quietly does something you didn't ask for. This node takes an AUDIO input and answers the only question that matters for a segment: how many frames can I generate so the video and audio stay in sync, and how much audio is left over for the next loop pass.

The math, so you never trust a black box with it: take the audio duration in seconds at 24fps (H3's fixed frame rate - not 30, the source is explicit), add any 过渡帧数 overlap you want, then floor the total down to the largest 17k+5 value that fits. Video length never exceeds the audio, so the leftover audio - the 剩余音频时长 output - is exactly what the next segment's audio loader picks up. That "floor down, carry the remainder" pattern is the pack's whole long-video continuity trick: each segment generates slightly less than its audio, and the remainder feeds forward so nothing drifts over a 3-minute render.

The outputs are the point:

  • 生成帧数 - feed this into the H3 image-to-video node's 帧数 input.
  • 视频时长 - seconds of video this segment produces.
  • 剩余音频时长 - the leftover, for the next segment.
  • 视频潜变量T / 音频潜变量T - the latent timeline lengths for the AV latent, for workflows that build latents by hand. Video latent T follows the same grid (5 frames → T 2, then +5 T per 17 frames); audio latent runs at 40/s.

Inputs are just 音频 (AUDIO) and 过渡帧数 (default 0 - extra overlap frames, summed before the floor-down). It pairs naturally with FxAiMiniMaxAudioSegmentLoad (which does the same alignment on a per-scene slice) - this one is the single-shot version you reach for when you're building one clip, not a loop.

Install: ComfyUI Manager → "fxai-toolkit", or cd ComfyUI/custom_nodes && git clone https://github.com/fxai666/fxai-toolkit, restart. Auto-installs soundfile/psutil, FFmpeg on PATH; the MiniMax family additionally wants the H3 weights and a ComfyUI core with native MiniMaxH3 support (the pack patches the official H3 code at import to fix a keyframe/reference bug - keep pack and core in sync). Labels are Chinese (凤希AI; QQ group 775649071, Bilibili).

One trap: the node floors down, so short audio can return a surprisingly small frame count (sub-22-frame clips collapse to 5). If your segment audio is under about half a second, you're generating 5 frames - that's correct behavior, but worth knowing before you wonder why a tiny clip came back as a single beat. Otherwise, wire audio in, take 生成帧数 out, and never do grid math in your head again.

Category凤希AI/MiniMax

Inputs (2)

NameTypeDefaultDescription
音频AUDIO
过渡帧数INT0额外生成的重叠帧,先加总再向下对齐到 17k+5 网格

Outputs (5)

NameTypeDescription
生成帧数INT
视频时长FLOAT
剩余音频时长FLOAT
视频潜变量TINT
音频潜变量TINT