Repository navigation
Studio: add MiniMax H3 video generation - #7989
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: e51e2bb672
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| scope: "video", | ||
| aliases: ["Comfy-Org/MiniMax-H3"], | ||
| artifacts: [ | ||
| bf16Pipeline("MiniMaxAI/MiniMax-H3", 145, { |
There was a problem hiding this comment.
Mark the H3 BF16 artifact as gated
MiniMaxAI/MiniMax-H3 is a gated Hugging Face repo, but this catalog entry is not marked gated. On high-memory hosts a bare MiniMax H3 click can therefore auto-select the BF16 artifact before it is downloaded, instead of falling through to the open GGUF fallback, so users without accepted Hub access get a failed staged download/load. Mark this artifact gated like the other gated Hub repos so default routing stays on GGUF unless the BF16 repo is already present.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
MiniMaxAI/MiniMax-H3 is not gated on the Hub. The models API returns gated: false both anonymously and with a token, and an unauthenticated resolve of model_index.json returns 200, where FLUX.1-dev, which we do mark gated, returns gated: auto. Marking it gated would wrongly push every host onto the GGUF fallback.
|
Nice work, and the measured memory table is exactly the kind of evidence that makes a routing threshold reviewable. I have been looking at MiniMax-H3 support from the model side, so a few notes from that angle. Two are about the dependency changes rather than the H3 code. 1. The
|
|
Thanks, I addressed the findings in 645be0c. The Diffusers Git reference is now limited to Studio's installer requirements. The published extra uses For the Hub upgrade, all 173 Hub tests passed on versions 0.36.2, 1.23.0, and 1.26.1. The broad backend suite on 1.26.1 completed with 16,710 passed and 68 skipped. I also ran real generations through
The runtime findings were addressed as well: Metal text-encoder handling, Torch-free native generation, XPU-to-Vulkan mapping, the install kill switch, and FL2VA GGUF filtering. I did not mark the official model as gated because the Hub reports |
|
Measured this on a CUDA build of sd.cpp at the same commit the PR targets ( The native path fits well under 24 GB
The buffer split from the verbose log explains it: text encoder 12,844 MB, diffusion model 10,976 MB, video VAE 4,637 MB, audio VAE 248 MB. The encoder is the largest single consumer and it runs once up front, so moving it off the GPU is most of the win. So H3 comfortably clears both 24 GB and 32 GB on the native route. That is worth stating in the PR, because the Diffusers gate at
|
|
I spent some time measuring H3 on this branch to answer "what card does this actually need", and turned up a few things worth folding in. All numbers are from a real It fits in 24 GB, and the current gate says otherwisePeak VRAM with the text encoder on CPU:
With
|
| command | result |
|---|---|
--vae-on-cpu with --audio-vae |
abort |
--vae-on-cpu without --audio-vae |
succeeds, video in 95.87s |
--vae-on-cpu with an fp16-converted audio VAE |
abort |
The trigger is the audio VAE, not the video VAE (which is entirely F16). ggml_conv_1d hardcodes an F16 im2col destination (ggml/src/ggml.c:4489) and ggml_compute_forward_im2col_f16 then asserts the kernel is F16, while audio_conv_weight_type (src/model/vae/ltx_audio_vae.hpp:259) maps only BF16 to F16 and lets F32 through. Converting the audio VAE checkpoint to fp16 does not help, so the type is imposed inside stable-diffusion.cpp rather than by the file. That means it cannot be fixed by shipping a different checkpoint: --vae-on-cpu needs to not be emitted for this family.
The Linux and Windows prebuilts are CPU-only
The published assets are:
sd-...-bin-Darwin-macOS-arm64.zip
sd-...-bin-Darwin-macOS-x86_64.zip
sd-...-bin-Linux-Ubuntu-22.04-x86_64.zip
sd-...-bin-Linux-Ubuntu-24.04-aarch64.zip
sd-...-bin-win-cpu-x64.zip
There is no CUDA variant. On the same generation the prebuilt took about 20 minutes and allocated no VRAM, while a local -DSD_CUDA=ON build did it in 17 seconds on the GPU. So NVIDIA users on Linux and Windows get the CPU path today, which I suspect is not the intent for a video model.
Careful which GGUFs this points at
Worth knowing before wiring up quantized rungs: stable-diffusion.cpp's converter has no rule sparing 1-D norm weights. They survive a blanket --type only when their length does not divide the quant block size (q_norm and k_norm are [128], and 128 % 256 != 0) or when a FLUX-era name rule happens to match (final_layer.).
H3's per-block norms are [5376], and 5376 % 256 == 0, so a blanket build crushes 106 norm scales to 4-bit. The result loads and renders a valid video, so a "does it run" check passes it, but scored against a bf16 render of the same prompt and seed:
| build | PSNR | SSIM | LPIPS |
|---|---|---|---|
Q4_K, blanket --type |
9.87 | 0.074 | 0.981 |
| Q4_K, norms held at bf16 | 21.52 | 0.838 | 0.299 |
SSIM 0.074 is essentially uncorrelated with the reference. --tensor-type-rules 'norm[0-9]*\.weight$=bf16,condition_proj\.weight$=bf16' fixes it for about 56 MiB, and built that way Q4_K reproduces the community Q4_K_M tensor layout exactly, 0 of 532 tensors differing. So the published Q4_K_M is fine; it is other rungs that need care.
int8_convrot and fp8_scaled are not options here
Comfy-Org publish both for this checkpoint, but neither loads in stable-diffusion.cpp. fp8_scaled is 200 F8_E4M3 weights plus 350 weight_scale/input_scale tensors, and while F8_E4M3 is read it is upconverted to F16 at load (f8_e4m3_to_f16_vec), so there is no VRAM saving, and nothing in src/model/ ever reads those scales. int8_convrot has zero occurrences of convrot anywhere in the tree. GGUF is the only quantization route on this path.
Mirror
MiniMaxAI/MiniMax-H3 is now mirrored at unsloth/MiniMax-H3, a complete byte-identical copy including the upstream LICENSE, if it helps to fetch from there.
Happy to send patches for the --vae-on-cpu and VRAM-gate pieces if that is useful.
low_vram maps to the `model` policy, and offload_flags emits --vae-on-cpu for it
unconditionally. On H3 that kills the process:
ggml/src/ggml-cpu/ops.cpp:6321: GGML_ASSERT(src0->type == GGML_TYPE_F16) failed
deterministically, SIGABRT, exit 134. Bisected on the flags: --vae-on-cpu with
--audio-vae aborts, the same command without --audio-vae renders in 95.87s, and an
fp16-converted audio VAE aborts too. So the trigger is the audio VAE, not the video
one, and the F32 type is imposed inside stable-diffusion.cpp rather than by the
file: ggml_conv_1d hardcodes an F16 im2col destination (ggml/src/ggml.c),
ggml_compute_forward_im2col_f16 then asserts the KERNEL is F16, and
audio_conv_weight_type (src/model/vae/ltx_audio_vae.hpp) maps only BF16 to F16 and
lets F32 through. It cannot be fixed by shipping a different checkpoint.
low_vram is the one mode a small-card user reaches for, so this drops the flag
rather than the mode. offload_flags takes vae_on_cpu, defaulting True so no other
family changes, and the H3 native path passes False. --offload-to-cpu and
--clip-on-cpu still apply, which is where the saving actually is: the denoiser
dominates, and with --offload-to-cpu the whole model peaks at 13.14 GiB.
|
Sent the It drops the flag rather than the mode, since Merge it or take the diff, whichever you prefer. The memory-gate numbers from my earlier comment are still worth folding in separately: Q6_K peaks at 21.68 GiB and Q8_0 at 26.20 GiB, so 24 GB and 32 GB cards respectively, and 13.14 GiB with |
Two conflicts, both mechanical: - transformers_version.py: main reworded the comment under TRANSFORMERS_DEFAULT_VERSION while this branch changed the value. Kept both. - test_video_backend.py: both sides appended a new test at the end of the file. Kept both. Main also added test_curated_gguf_repos_are_unsloth_mirrors, which requires every curated video gguf_repo to be an unsloth mirror so a one-click pick cannot 404 when a community repack is renamed. H3 was pointing at leejet/MiniMax-H3-GGUF, so it now points at unsloth/MiniMax-H3-GGUF instead. NOTE: unsloth/MiniMax-H3-GGUF is still private. It has to be made public before this merges, or the pick will 401.
|
Merged main in to clear the conflict. Two hunks, both mechanical: One thing worth flagging, since it changes a model pointer on your branch. Main has since added That repo is still private, so it has to be flipped public before this merges or the GGUF pick will 401. No CI check reads it, so nothing goes red in the meantime. The mirror is not a straight repack. It carries six uniform rungs plus two mixed-precision ones, all built with the 1-D norm scales held at bf16. That last part matters more than it sounds: H3's per-block norms are On measured prompt adherence the pick to default to is Local runs: |
Main added test_curated_gguf_repos_are_unsloth_mirrors, which requires every curated video gguf_repo to live under unsloth/ so a one-click pick cannot 404 when a community repack is renamed or taken down. H3 was the one family still on a community repo. This was meant to be part of the merge commit but was left in the worktree, so CI on that commit still saw the old value. unsloth/MiniMax-H3-GGUF is still private and has to be made public before this merges, or the pick will 401. No CI check reads it.
|
Correction to my last comment: the On the rest of that red run, having checked each against main:
So the only genuine failure on this branch was the pointer, and the |
H3 is distilled and CFG-free: its empty unconditional prompt encodes to zero tokens, and the transposed tensor that produces trips GGML_ASSERT(!ggml_is_transposed(a)) in ggml.c. SIGABRT, exit 134. Measured: cfg 1.0 renders, cfg 1.5 and cfg 4.0 both abort. sd.cpp defaults cfg-scale to 7.0, so this is a crash a plausible refactor reintroduces by forwarding guidance the way every other family does. The native path already hardcodes 1.0 and the family sets supports_cfg = False, but nothing held either in place. supports_cfg only gates the diffusers path; the native path builds its own params. Checked the test fails when cfg_scale is changed to forward guidance, so it is not passing vacuously.
The macos-15-intel leg fails deterministically, not flakily: process didn't exit successfully: `/usr/bin/git init` (exit status: 1) --- stderr xcode-select: note: No developer tools were found, requesting install. That runner has no Xcode, so /usr/bin/git is the developer-tools shim and exits 1 for everything. uv needs a working git to resolve a git+https dependency, so the diffusers pin this branch added cannot install there at all. Main is unaffected because it depends on plain diffusers. GitHub serves the same commit as a source archive, which uv installs with no git involved. Verified by stubbing git to fail exactly the way the macOS shim does: the git+ form reproduces the CI error, the archive form installs diffusers 0.40.0.dev0 from the same SHA with MiniMaxH3Transformer3DModel present and exported. Also drops a full clone of diffusers from every install.
|
The That runner has no Xcode, so Fixed in Verified by stubbing Separately, the two quant repos this work produced are no longer weight-space-only. Dequantizing the stored values back to bf16 and rendering them, which is what a weight-only quant path does anyway, over 5 held-out prompts x 2 seeds against a bf16 render of the same prompt and seed:
Both hold prompt adherence at bf16 level. int8 is clearly ahead on fidelity, winning 9 of the 10 cells, which matches the weight-space prediction that it beat fp8 on all 200 tensors. e4m3 spends 4 bits on an exponent that a per-output-channel scale has already made redundant. |
With the archive pin the macOS leg gets past `git init` and installs, but then trips the nobuild guard: built from source: diffusers -- these must resolve to wheels on a clean machine There is no wheel to resolve to. MiniMax-H3 support is not in any diffusers release, so this branch has to pin a commit, and neither a git URL nor a source archive can produce a wheel from an index. Added to the same allowlist that already carries triton-kernels for the same reason. Checked against the bar the comment there sets: diffusers builds with plain setuptools, declares no ext_modules, and its tree has zero .c/.cpp/.pyx/.rs/.cu files and no shipped binaries, so the PEP 517 build is a pure-Python copy step and needs no toolchain. The separate compiler-invocation check in both scripts is untouched and still fires if one is ever needed. Verified the allowlist logic still rejects a non-allowlisted source build (a log building both diffusers and numpy reports only numpy). Remove this entry once a diffusers release carries H3 and the requirement goes back to a version specifier. Noted in both scripts.
|
Follow-on to the archive pin. With There is no wheel to resolve to. MiniMax-H3 is not in any diffusers release, so this branch has to pin a commit, and neither a git URL nor a source archive can produce one from an index. The two forms differ in whether the install works at all, not in whether it is a source build, so both changes were needed. Fixed in I checked it against the bar the comment in that script sets, rather than just adding the name. diffusers builds with plain setuptools, declares no Also verified the guard still bites: a log building both Both scripts carry a note to remove the entry once a diffusers release ships H3 and the requirement goes back to a version specifier, so this does not quietly become permanent. |
`pip scan-packages :: hf-stack` fails on this branch with 1 unbaselined CRITICAL: C2 polling/beaconing loop detected Package: huggingface-hub File: huggingface_hub/utils/_http.py L461: while True: This is on us, not upstream drift. Main pins huggingface-hub==0.36.2; this branch needs >=1.23.0,<2.0 because diffusers at the pinned commit requires it, so the resolved version moves 0.36.2 -> 1.27.0. The baseline already carries this exact file and check at L462 and L298, from earlier versions. It did not carry over because the key hashes the matched code, not the line number, and the surrounding code changed across the major version. That is the guard behaving correctly: changed code in a baselined file reopens for review rather than staying suppressed. Reviewed it rather than just re-suppressing. L461 is the retry loop in `http_backoff`: bounded by `nb_tries > max_retries`, the URL comes from the caller, there is no hardcoded endpoint and nothing is exfiltrated. Same benign construct as the entries it replaces. Entry generated with the scanner's own _evidence_hash rather than hand-written, and inserted beside its siblings so the diff stays 8 lines. Verified: with the baseline the scan is exit 0 with 4 suppressed, without it exit 1, so the guard still bites.
|
Main pins The baseline already carries this exact file and check at L462 and L298 from earlier versions. It did not carry over because the key hashes the matched code rather than the line number, and the surrounding code changed across the major version. That is the guard working as intended: changed code in a baselined file reopens for review instead of staying quietly suppressed. So I reviewed it rather than just re-suppressing. L461 is the retry loop in On the rest of the last run, checked against main at
Separately, a measurement that may be worth acting on in the family config. H3 is distilled and
16 steps is a near-equivalence with power behind it: -0.0035 where the test resolves +-0.0060, for 1.58x. 4 and 8 are not resolvable either, but at n = 10 the test only resolves +-0.024 there, and the spread across prompts is four times wider at 4 steps than at 16, so few-step sampling is inconsistent rather than uniformly worse. I have not changed |
…iable `mac macos-15 / trace / file` fails on this branch and passes on main. uv reports: No solution found when resolving dependencies: Because you require huggingface-hub>=0.34.0,<1.0 and huggingface-hub>=1.23.0,<2.0, your requirements are unsatisfiable. This branch moved base.txt, no-torch-runtime.txt, studio.txt and constraints.txt to hub >=1.23.0,<2.0, because diffusers at the pinned commit requires it, but left the flat <1.0 cap in overrides-darwin-arm64.txt. That file is macOS-arm only, which is why only the mac legs see it and Linux and Windows stayed green. The failure then presents as something else entirely: uv gives up, the installer falls back to pip, and the clean-machine trace fails on "installer invoked toolchain: rustc" rather than on the resolution. The cap's own comment explains it exists so the resolver can never pair hub 1.x with a pinned transformers 4.57.6 / hub 0.36.2 stack. That is still true below python 3.10 and still capped there. At 3.10 and above this branch is on transformers 5.5.0 and hub 1.x, so the premise is gone, and mlx-audio's own >=1.0 floor is satisfied by the 1.x window anyway. Checked by collecting every hub specifier that applies per Python version across all five files: py3.9 resolves to 0.36.2 as intended, py3.13 to 1.23.0/1.27.0. Before this change py3.13 resolved to nothing.
Keep both sides of every conflict: the video status gains main's gguf_variant alongside this branch's engine field, the studio extra keeps main's urllib3 pin next to the branch's huggingface-hub markers so it still mirrors requirements/studio.txt, and the prequant, transformer-quant and video-backend test modules keep both new blocks.
video.py only branches on H3_TASK_REFERENCES; the keyframe constant is read from video_minimax_h3 directly by the tests that need it. The hoisted-import safety net in Source lint flags the unused name as a blocker.
The plan already drops the dense transformer shards whenever a hosted pre-quantized checkpoint covers them, but nothing put that checkpoint back: an int8 or fp8 H3 stage skipped 66.3 GB of base shards and added none of the 20.25 GB artifact the load actually opens. The byte total under-reported the stage by the size of the checkpoint, the disk preflight cleared a volume that could not hold it, and an offline stage completed without the one file the load needs. _denoiser_prequant_hub_files mirrors the pre-cast encoder helper: it resolves the family's hosted checkpoint, confirms the file really exists on the Hub, and prefers the repo-root name over the legacy scheme name in the same order the load tries them. An unreachable repo is logged and yields no files, so a gated or renamed artifact keeps the dense shards instead of sinking the plan. The progress-bar estimate is deliberately left alone: it counts cached bytes for the checkpoint and base repos only, so adding a third repo there would leave the bar permanently short of 100 percent.
The bundle-repo filter accepted only minimax_h3_fl2va*, so every published minimax_h3_ref2va* quant was hidden from the variant listing. The loader disagrees: validate_h3_transformer_filename accepts either partition, on the grounds that which one is picked IS the task, and h3_transformer_task routes Ref2VA to the reference-video workflow this PR adds. The community bundle repo publishes three Ref2VA quants today, so the reference path was unreachable from the remote catalog. Accept both prefixes from one shared tuple and keep excluding the Qwen3-VL encoder and VAE companions, which are never picks for either partition. The filter test asserted the old behaviour and is updated with it.
The reference-video decoder already selects, resizes and refuses incrementally because the encoded size says nothing about the decoded size. The audio decoder did not: it appended every resampled block to a list and then allocated a second full buffer in np.concatenate, with no duration or sample cap. The route accepts 32 MiB of encoded audio, which is over half an hour of compressed stereo. That lands as roughly 1.9 GB of float32 and doubles again in the concatenate, and up to three references are accepted per request, so an ordinary long music or podcast file picked by mistake could exhaust the host before the background job even started. H3's reference window is 15 seconds, so anything past it is unusable rather than merely large. Refuse it while decoding, with the same shape of message the video guard uses, instead of decoding it first.
…denoiser The hosted pre-quantized checkpoints are FL2VA (keyframe) denoisers. Ref2VA shares their module shapes and the same base model, so resolve_prequant_source handed one back for a reference load, it passed every metadata check, and seeding it made load_components skip the real Ref2VA transformer. The request then generated from the wrong partition rather than failing, which is the worst of the three outcomes. The route accepts h3_task, so this was reachable from the public API even though the picker does not expose the choice yet. validate_load_request now refuses the pairing with a message naming the workable alternatives, in the same place it already refuses a scheme with no hosted checkpoint, and the modular loader drops to the released components if a direct call reaches it. Nothing changes for keyframe loads, which are what the checkpoints are.
The plan-unchanged sweep from main walks every family and asserts the dense budget plan_diffusion_memory received. MiniMax-H3 is the first modular-workflow family to reach that list, and load_pipeline dispatches to the workflow's own loader before the planner runs: each component is built by its own from_pretrained, so there is no single dense pipeline to budget and no plan call to assert on. Skip it the way the sweep already skips wan2.2-t2v-a14b.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 0aab0f4d19
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| const reader = new FileReader(); | ||
| reader.onload = () => onChange(typeof reader.result === "string" ? reader.result : null); | ||
| reader.onerror = () => toast.error("Could not read the image"); | ||
| reader.readAsDataURL(file); |
There was a problem hiding this comment.
Reject oversized image files before reading them
When a user selects a large first/last frame or reference picture, this reads the entire file into a base64 data URL before the backend's 32 MiB field limit or 4096-pixel image guard can reject it. A sufficiently large image can therefore allocate several copies in the browser/webview and freeze or exhaust the frontend; check file.size against the request cap before calling readAsDataURL().
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Not introduced here. The same readFile with no size check is in images-page.tsx at the merge base, and image-dropzone.tsx is a verbatim extraction of it. FileReader is asynchronous and does not block the main thread, so the freeze is speculative. The video reference picker is a different matter and is being fixed: its backend caps are ~72 MiB video and ~24 MiB audio, which a 15 s 4K clip clears easily.
| for flag in list(extra_args or []): | ||
| if flag not in cmd: | ||
| cmd.append(flag) |
There was a problem hiding this comment.
Preserve complete video extra-argument sequences
When a caller uses generate_video(extra_args=...) to override an existing option, token-wise deduplication drops the option name but retains its value; for example, ['--rng', 'cuda'] becomes a trailing bare cuda because --rng already appears in cmd. This can make sd-cli reject the command and also prevents the normal last-wins override behavior, so append the argument sequence intact rather than deduplicating individual tokens.
Useful? React with 👍 / 👎.
| if device != "cpu": | ||
| manager.enable_auto_cpu_offload( | ||
| # Measured H3 activations need substantially more than the | ||
| # official 12 GB example at 10-15 seconds. Forty GB also keeps | ||
| # very large GPUs from retaining both 66 GB components and OOMing | ||
| # while smaller caps succeed by offloading one of them. | ||
| device = device, | ||
| memory_reserve_margin = "40GB", | ||
| ) |
There was a problem hiding this comment.
Honor explicit H3 memory modes
When a CUDA user explicitly selects memory_mode="fast" for the Diffusers H3 artifact, this unconditionally enables ComponentsManager CPU offload and commits offload_policy="model"; balanced and low_vram take the identical path as well. The resolved-record helper also treats this explicit request as applied, so the UI can keep showing Fast while a much slower offloaded build is running. Map the requested modes to distinct placement policies, or reject/mark unsupported modes instead of silently ignoring them.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
A modular_workflow family always uses ComponentsManager auto CPU offload, and the code says why: refusing these picks would 409 a combination that loads. Honoring fast, that is no offload, would OOM, since the 40 GB reserve margin exists to stop a large GPU retaining both 66 GB components. Both suggested remedies are worse than the status quo. The residue is the over-optimistic record, and that is being fixed for text_encoder_quant in the same dict.
| if not fam.supports_cfg: | ||
| pass |
There was a problem hiding this comment.
Reject unsupported CFG inputs for H3
When a direct /video/generate caller supplies guidance or negative_prompt for MiniMax-H3, the request schema accepts them but this supports_cfg=false branch omits them from the Diffusers call, while the native command also stays fixed at CFG 1.0. The completed gallery record nevertheless persists the requested guidance and negative prompt, so its recipe claims settings that did not produce the clip; reject these explicit inputs or persist the fixed values actually used.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Taking the record half of this. guidance is resolved before the supports_cfg branch, so a caller sending 7.0 gets 7.0 written into the sidecar while Diffusers received no guidance kwarg and the native path hardcodes cfg_scale=1.0: a recipe that cannot reproduce its own clip. Clamping to the family default after resolution fixes it without rejecting anything. One correction: negative_prompt is not dropped by that branch, it is applied unconditionally outside the guard. Only guidance is.
| transformer_quant_engaged or "off", | ||
| transformer_quant_reason, | ||
| ), | ||
| "text_encoder_quant": (None, "off", "released bfloat16 components"), |
There was a problem hiding this comment.
Refuse unsupported H3 text-encoder quantization
When a Diffusers H3 load explicitly requests a supported text_encoder_quant, validation and the precision preflight accept it, but the modular dispatch never forwards that option and this record unconditionally reports the released dense encoder. The load therefore materializes the roughly 66.8 GB Qwen companion at dense precision despite the explicit contract, potentially turning a planned quantized load into an OOM; either implement this mode for the modular workflow or reject it before teardown and download.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Taking the record half of this, not the refusal. Because the first tuple element is None the resolved record takes the left-to-backend path and stamps source auto with requested null, so a declined request is erased instead of showing as fell-back. Passing the request through fixes that. A 409 is the wrong remedy: the frontend never sends this field for video, so it would only break a stale selection that loads fine today.
|
End to end confirmation on this branch, from two isolated Studio installs at merge base Before and afterThe base refuses MiniMax-H3 outright:
The head plans a 72.43 GiB load and offers it in the video picker: It generates, on all three artifacts960x544, 124 frames, 24 fps, 8 steps, seed 11, prompt "a red panda stepping along a mossy log in a misty forest, cinematic":
All three produce a real 5.17 s clip with a stereo AAC track, so the synchronized audio path works too. Frame 40 of the int8 run: And the page itself, with three clips in the gallery and the Audio badge: Three things worth fixing or noting1. A 401 on the pre-quant repo degrades to a dense bf16 load that reports success. With no valid token the loader logs 2. The video page header names the picker variant, not the engaged build. In the screenshot above the header reads 3. Two request contracts are easy to trip and are only discoverable by failing. Resolution must be one of eight fixed sizes, and frame count must satisfy One correction to something I said earlier in this thread: an int8 generation failure I hit first time round was GPU contention on a shared card, not an int8 defect. Re-run alone it completes in 51 s at a 71.2 GB peak. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 183b7e9034
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| if not binary or sd_cpp_supports_minimax_h3(binary): | ||
| return binary |
There was a problem hiding this comment.
Reject unpatched upstream sd.cpp for H3
When the mirror-only pinned sd.cpp release cannot serve a host, the installer falls back to upstream latest, and this H3 gate accepts any binary whose help lists --ref-video. The installer itself warns that such an upstream fallback lacks the MiniMax-H3 patchset and can abort or render broken H3 output, so Studio can mark native H3 as ready after downloading the bundle even though the selected binary is known unsafe for H3. For this H3-specific ensure path, require the patched mirror build or a verified patch marker instead of treating the H3 option as sufficient.
Useful? React with 👍 / 👎.
|
Merge-order note, since this PR and #8208 both edit the same This branch pins The consequence is that whichever of the two merges second wins that line. If this one lands after #8208 it drags the pin back to the CPU-only build and quietly undoes it, and no test would catch that because the tag is just a string. Either land #8208 last, or keep Measured here on a B200, same prompt, seed and settings at 960x544 / 124 frames: the GGUF path through the CPU sd-cli generates in 410 s, against 51 s for int8 and 40 s for fp8 on the diffusers path. The binary that produced the 410 s figure was |
A half-specified width/height is long-standing, documented API behaviour: the backend resolves the missing axis from the family's default preset, in both validate_video_request_shape and _resolve_keyframes. Applying the new paired-axes rule as an unconditional request validator rejected those calls with a 422 before family validation ever ran, breaking existing LTX, Wan, Hunyuan and prompt-only H3 clients. The rule still holds where it means something: with a keyframe present the canvas is matched to the source aspect whenever either axis is missing, so the axis the caller sent would be silently discarded.
# Conflicts: # studio/backend/core/inference/sd_cpp_backend.py # studio/install_sd_cpp_prebuilt.py
The merge with main brings in the accelerator-aware installer, whose fallback translates a mirror-only -u<id> pin back to the upstream release it was built from instead of skipping the upstream attempt. That is strictly better: skipping kept the round trip cheap but dropped the pin entirely on every host the mirror does not build, leaving them on upstream latest. test_a_mirror_only_pin_is_never_requested_upstream asserted the old shape, that the fallback settled for upstream latest. It now pins the new one: never the literal -u<id> string, the translated release instead, and no latest attempt at all because the translated pin succeeds.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: fe66e51122
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| """Hide auxiliary GGUFs from repos that bundle several model roles.""" | ||
| if is_h3_bundle_repo(repo_id): | ||
| name = Path(filename).name.lower() | ||
| return name.startswith(_H3_DENOISER_PARTITIONS) and name.endswith(".gguf") |
There was a problem hiding this comment.
Keep H3 partitions separate in variant aggregation
When FL2VA and Ref2VA publish the same quant label (the repository tests show both with Q4_K_M and Q2_K_M), accepting both prefixes here still does not expose both choices: list_gguf_variants() aggregates quant_totals and quant_first_file solely by extract_quant_label() at lines 625-640, and the local-cache path uses the same scheme. The two partitions therefore collapse into one row with their sizes summed and whichever filename appears first—normally FL2VA—winning, so overlapping Ref2VA variants remain unselectable. Fresh evidence beyond the earlier prefix-filter finding is this downstream quant-key collision; include the H3 partition in the aggregation/variant identity.
Useful? React with 👍 / 👎.
|
Correction to my earlier note on this PR, plus the completed measurement. I said the 410 s GGUF figure was a CPU number. That was wrong. I checked the wrong Studio home: an older one from the previous day that held the CPU build. The home that actually produced the clip installed The controlled benchmark, both binaries, identical raw sd-cli arguments, 960x544 / 124 frames / 8 steps / cfg 1.0 / seed 11, one B200:
That is 27.5x, not the 2.4x the earlier comparison implied. The CPU build takes almost 80 minutes for a 5.17 s clip. Studio own 410 s figure sits between the two because it runs the same CUDA binary under the group offload policy, so roughly 2.4x of raw CUDA is the cost of offloading rather than a property of the GGUF path. The direction of the earlier conclusion is unchanged and the magnitude is larger: the CUDA asset matters a great deal on Linux, and the merged I opened frame 40 of the CUDA render and confirmed it is the same red panda scene at the same seed, so the speedup is real rather than a truncated run. |



Adds MiniMax H3 text-to-video generation with synchronized audio to Studio's Video tab.
Users can select either:
Studio automatically downloads every required component, generates the video and audio, and saves a gallery-compatible MP4.
What changed
17k + 5frame lattice.t2vaworkflow.vid_gen, including progress, cancellation, audio, and MP4 conversion.master-812-ea7f0c8until packaged releases include the required support.Memory routing
The BF16 components total about 145 GB, but Diffusers runs them with component-level CPU offload. Measurements showed that the upstream 12 GB reserve could retain too many weights on large GPUs and OOM at longer durations. This PR uses a 40 GB reserve and checks available VRAM and system RAM before generation.
The picker selects BF16 when either measured tier fits:
Other configurations default to GGUF. The existing 70% routing rule remains unchanged for every other model.
Boundaries
--offload-to-cpu. Wiring stable-diffusion.cpp's newer--auto-fit,--max-vram, and--stream-layerscontrols is left for a follow-up.Validation
Complete 30-step generations were run on an NVIDIA B200 through both the official BF16 Diffusers pipeline and a Q4_K_M stable-diffusion.cpp CUDA build. Both produced coherent, playable H.264/AAC MP4 files with audio.
git diff --checkpassed.