Add MiniMax H3 integration - #457
Conversation
Signed-off-by: Ang Li <angl5@illinois.edu>
Greptile SummaryThe PR adds a separately packaged MiniMax H3 integration supporting text-to-video-with-audio, first/last-frame conditioning, reference conditioning, native denoising, LoRA conversion, checkpoint recovery, and plugin registration.
Confidence Score: 3/5The PR is not yet safe to merge because the maximum advertised duration is rejected and exceptional runner exits still fail to close the MP4 output target. A 15-second request deterministically aligns to 362 frames and fails validation, while exceptions during generation, finalization, or output processing propagate past the sole output-target close call; both previously reported blocking failures remain in the current code. Files Needing Attention: integrations/minimax_h3/minimax_h3/constants.py; integrations/minimax_h3/minimax_h3/runner.py Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
CLI[flashdreams-run] --> Registry[Runner plugin registry]
Registry --> Runner[MiniMax H3 runner]
Runner --> Condition[Text, keyframe, or reference conditioning]
Condition --> Checkpoint[Conditioning checkpoint]
Checkpoint --> Denoise[Native joint video/audio denoising]
Denoise --> Latents[Latent checkpoint]
Latents --> Decode[Video decode]
Decode --> Output[MP4 output target]
Output --> Complete[Completion status]
Reviews (8): Last reviewed commit: "Merge remote-tracking branch 'upstream/m..." | Re-trigger Greptile |
| if frames / FPS > MAX_DURATION: | ||
| raise ValueError("duration aligns beyond MiniMax H3's 15-second maximum") |
There was a problem hiding this comment.
Maximum duration fails alignment
When duration is 15 seconds, alignment advances 360 frames to the next decodable count of 362 and then rejects the request, causing the advertised maximum duration to fail before generation starts.
| if frames / FPS > MAX_DURATION: | |
| raise ValueError("duration aligns beyond MiniMax H3's 15-second maximum") |
| frames = self.pipeline.generate(0, cache) | ||
| metrics = self.pipeline.finalize(0, cache) |
There was a problem hiding this comment.
Exceptional exits leak output target
When generation, finalization, processing, or writing raises after output_target.open(), the runner exits without closing the target, leaking encoder and file resources and leaving a partial MP4 that can interfere with retries.
Knowledge Base Used: Integrations
|
Tested with both the regular MiniMax H3 and the the Looping-Sketch LoRA on A100. No audio support yet. |
ArielG-NV
left a comment
There was a problem hiding this comment.
questions/suggestions
|
I tried to use the built in RoPE, but H3 precomputes cos and sin once, shaped [S, 96], then reuses them across its transformer blocks. H3 rotates only the first 96 channels of each 128-channel attention head; the final 32 channels pass through unchanged. Therefore, I cannot use the current RoPE effectively. I wonder if you guys are open to changes in the RoPE kernel? |
|
Making changes like adding to the core of flashdreams so that future development of world models is easier for future devleopers is very much encouraged. This would include changes like adding functionality (knobs for performance) or making alternative implementations of RoPE. |
|
I tested my integration and it seems that the RoPE changes were not really needed. |
# Conflicts: # uv.lock
As mentioned here: #443
This commit adds MiniMax H3 integration to flashdreams.