From 487de75c96fe16f1a9806f022ecc4a784dd28b47 Mon Sep 17 00:00:00 2001 From: Daniel Han Date: Tue, 11 Aug 2026 08:22:20 -0700 Subject: [PATCH] fix: fail with a message when MiniMax-H3 is run in img_gen mode (#1863) --- src/stable-diffusion.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/stable-diffusion.cpp b/src/stable-diffusion.cpp index f2b69cc0..5986163a 100644 --- a/src/stable-diffusion.cpp +++ b/src/stable-diffusion.cpp @@ -5584,6 +5584,18 @@ SD_API bool generate_image(sd_ctx_t* sd_ctx, return false; } + // MiniMax-H3 is video-only. Its denoiser always splits the packed latent into a video and an + // audio half, and only generate_video ever computes the audio length, so reaching this + // function with an H3 checkpoint is guaranteed to die on + // GGML_ASSERT(!audio_input_cache.empty()) with a core dump, after the several minutes it + // takes to load the weights, and with nothing in the output pointing at the missing --mode. + // (The AnimateDiff path below routes vid_gen back through here, but that is SD1.5 plus a + // motion module, never H3.) + if (sd_version_is_minimax_h3(sd_ctx->sd->version)) { + LOG_ERROR("MiniMax-H3 is a video model and cannot be run in img_gen mode; use --mode vid_gen"); + return false; + } + sd_ctx->sd->reset_cancel_flag(); int64_t t0 = ggml_time_ms();