Fix MiniMax-H3 refusing the 15-second clip its envelope declares - #14742
Open
PaulFidika wants to merge 1 commit into
Open
Fix MiniMax-H3 refusing the 15-second clip its envelope declares#14742PaulFidika wants to merge 1 commit into
PaulFidika wants to merge 1 commit into
Conversation
`MiniMaxH3PrepareLayoutStep` and `MiniMaxH3Ref2VASetupStep` snap `num_frames` up onto the video VAE's `17 * n + 5` grid and then check the *aligned* count against `[min_duration, max_duration]` in seconds. The two ends are not treated alike, and at MiniMax-H3's own numbers that is visible: - the floor tolerates the snap: `num_frames=120` aligns to 124 = 5.167 s and is admitted, though 5.167 > 5.0; - the ceiling does not: 362 frames = 15.083 s is refused, though 362 is `17 * 21 + 5`, a legal grid point. The grid has no point at `15.0 * 24 = 360`. Its neighbours are 345 (14.375 s) and 362 (15.083 s), so a model documented as generating up to 15 seconds cannot currently generate 15 seconds at all — the longest clip it will produce is 14.375 s. Carry the declared envelope onto the grid at both ends instead, with the same upward snap a request gets, via a small `frame_bounds` helper. For MiniMax-H3 this makes the admitted band `[124, 362]` frames. Behaviour is unchanged for every count that was already accepted; the only counts that change verdict are those aligning to 362, which the model's own declared 15-second ceiling should always have covered. The error message now names the real frame bounds rather than `int(min_duration * fps)` / `int(max_duration * fps)`, which reported 120 and 360 — neither of which is a frame count the VAE can encode. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Contributor
|
Hi @PaulFidika, thanks for the PR! It does not appear to link an issue it fixes. If this PR addresses an existing issue, please add a closing keyword (e.g. Please note that PRs without a linked issue are likely to be automatically closed 10 days after this notice. Once the PR links an issue (or gets the |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
MiniMaxH3PrepareLayoutStep(before_denoise.py) andMiniMaxH3Ref2VASetupStep(before_encoder.py) snapnum_framesup onto the video VAE's17 * n + 5grid and then check the aligned count against[min_duration, max_duration]expressed in seconds.The two ends of the envelope are not treated alike, and at MiniMax-H3's own numbers (24 fps,
min_duration=5.0,max_duration=15.0) the inconsistency is visible:num_frames17 * 21 + 5The floor tolerates the upward snap; the ceiling does not. And the grid has no point at
15.0 * 24 = 360— its neighbours are 345 (14.375 s) and 362 (15.083 s) — so a model documented as generating "between 5.0 and 15.0 seconds" cannot currently generate 15 seconds at all. The longest clip it will produce is 14.375 s.Repro
Note the message names 120 and 360 as the bounds; neither is a frame count the VAE can encode.
Change
Carry the declared envelope onto the grid at both ends, with the same upward snap the request gets, via a small
frame_boundshelper next toalign_num_frames. The bound the VAE actually has is a frame count, so that is where the check belongs; the clock only reads it.For MiniMax-H3 the admitted band becomes
[124, 362]frames:Every count that was already accepted keeps its verdict, and the band stays bounded — 379 is still refused. The only counts that change verdict are those aligning to 362, which the model's declared 15-second ceiling should always have covered. The error message now names the real frame bounds.
Evidence that 362 is a capability the model has
362 frames is a legal chunk boundary (
17 * 21 + 5), nothing in the model is length-bound at that scale — RoPE is computed per request and both VAEs are chunked convolutions — and hosted MiniMax-H3 endpoints ship 362-frame clips today. Preparation at 362 resolves cleanly through the official blocks once the seconds ceiling no longer misfires, producing a packed sequence of 109,062 rows at 1344x768.🤖 Generated with Claude Code
https://claude.ai/code/session_019xrGKGkMTvR3BRuK58Z1mo