Nodes/CRT-Nodes/Minimax Length (CRT)
ComfyUI Node

Minimax Length (CRT)

MiniMax H3 won't take just any frame count — this node snaps yours to the grid

By PGCRT·Created 2 years ago·Updated 13 days ago· 132
Minimax Length (CRT)
    • frames
    frames124

    MiniMax H3, the open-weight multimodal video model MiniMax shipped in mid-2026, has a quirk that will bite you exactly once: its video VAE can only decode frame counts of the form 17*n + 5. Ask it for 100 frames and you'll get an error, or worse, silent nonsense. This node exists so you stop guessing.

    CRT_MinimaxLength is a utility in the pack's Logic & Values category. You feed it a frame count, it snaps it to the nearest valid value, and hands you back an INT. The valid grid at H3's fixed 24fps runs 5, 22, 39, ... up to 362 - that's 17*n + 5 where n goes 0 to 21. The model's official range is 124–362 frames, which is 5–15 seconds at 24fps; values below 124 are decodable but outside the trained duration window, so output quality can wobble. The node exposes the full grid but keeps the 362-frame ceiling.

    How to use it

    The one input is frames, and the widget itself steps by 17 from a minimum of 5, so the dropdown literally won't let you pick an invalid number. The default is 124 - exactly 5 seconds, the shortest "safe" official length. The function also re-snaps anything off-grid (like a value that arrived from a converted widget or a math node), so even wired in from elsewhere it self-corrects:

    • frames → output frames (INT)

    Wire the output into whatever H3 sampler or scheduler you're using that takes a frame count. Want a 10-second clip? 10s × 24fps = 240 frames... which is 240 = 17×13 + 19, not on the grid, so set 238 (17×13 + 5, ~9.9s) or 255 (17×14 + 5, ~10.6s). The node does this math for you, which is the entire point. There's a "snap to nearest" happening under the hood, so even a rough input like 250 lands on 255, the closest valid value.

    Why it's worth having

    You could compute this yourself with an arithmetic node - nobody's pretending it's rocket science. But it encodes the model's actual constraints in one place, with the tooltip explaining the 5–15s official window and the out-of-distribution caveat, so you don't re-derive the formula every time you build an H3 workflow. When the model's own pipeline enforces a grid and ComfyUI doesn't, a tiny guard node like this is exactly what saves you a wasted ten-minute generation.

    Install

    It's part of CRT-Nodes, so the usual dance:

    cd ComfyUI/custom_nodes
    git clone https://github.com/PGCRT/CRT-Nodes
    pip install -r requirements.txt
    

    Or ComfyUI Manager → search CRT-Nodes, then restart. No model downloads, no heavy dependencies - it's pure arithmetic and it only needs the pack registered.

    CategoryCRT/Utils/Logic & Values

    Inputs (1)

    NameTypeDefaultDescription
    framesINT1245–362MiniMax-H3 frame count at 24 fps. Valid values are 17*n+5 (5 to 362). Official range is 124-362 (5-15 s); shorter runs but is out-of-distribution.

    Outputs (1)

    NameTypeDescription
    framesINT