Skip to content

Invoke is a leading creative engine that uses image and video generation models to empower professionals, artists, and enthusiasts to generate and create visual media using the latest AI-driven technologies. The solution offers an industry-leading application interface, and serves as the foundation for multiple commercial products.

fix(webv2): gate Invoke on H3 stack completeness for components-only installs

Lincoln Stein50e0d8de2912
diff --git a/invokeai/frontend/webv2/src/features/video/core/videoPolicies.test.ts b/invokeai/frontend/webv2/src/features/video/core/videoPolicies.test.ts
index fc171c49c8..f8aa98f950 100644
--- a/invokeai/frontend/webv2/src/features/video/core/videoPolicies.test.ts
+++ b/invokeai/frontend/webv2/src/features/video/core/videoPolicies.test.ts
@@ -459,6 +459,46 @@ describe('component section policy', () => {
).not.toContain('wanLowNoiseModel');
});
+ it('requires both single-file overrides for a components-only MiniMax H3 install', () => {
+ // The slim "MiniMax H3 Components" folder carries tokenizer/processor/VAEs
+ // but no transformer or text-encoder weights (backend `components_only`):
+ // without the gate, Invoke enables and the loader fails mid-generation.
+ const componentsOnly = { ...h3Model(), components_only: true };
+ const bare = settingsFor(componentsOnly);
+
+ expect(getVideoComponentSectionPolicy(componentsOnly, bare).defaultOpen).toBe(true);
+
+ const reasons = getVideoValidationReasons(componentsOnly, bare);
+
+ expect(reasons).toContainEqual(expect.stringContaining('select a single-file Transformer'));
+ expect(reasons).toContainEqual(expect.stringContaining('select a single-file Text encoder'));
+
+ // Both overrides selected → the gate opens.
+ const filled = settingsFor(componentsOnly, {
+ h3TextEncoderModel: { base: 'minimax-h3', key: 'h3-te-int8', name: 'H3 Text Encoder', type: 'qwen3_vl_encoder' },
+ h3TransformerModel: {
+ base: 'minimax-h3',
+ format: 'checkpoint',
+ key: 'h3-tf-int8',
+ name: 'H3 Transformer',
+ type: 'main',
+ },
+ });
+
+ expect(getVideoValidationReasons(componentsOnly, filled)).toEqual([]);
+
+ // One override alone is not enough.
+ expect(getVideoValidationReasons(componentsOnly, { ...filled, h3TextEncoderModel: null })).toContainEqual(
+ expect.stringContaining('select a single-file Text encoder')
+ );
+
+ // A full Diffusers install keeps both slots optional.
+ const full = h3Model();
+
+ expect(getVideoValidationReasons(full, settingsFor(full))).toEqual([]);
+ expect(getVideoComponentSectionPolicy(full, settingsFor(full)).defaultOpen).toBe(false);
+ });
+
it('offers the component-source slot only for single-file mains, never listing the main itself', () => {
const diffusers = wanModel('i2v_a14b', 'diffusers');
diff --git a/invokeai/frontend/webv2/src/features/video/core/videoPolicies.ts b/invokeai/frontend/webv2/src/features/video/core/videoPolicies.ts
index 591a3de94f..eab726093d 100644
--- a/invokeai/frontend/webv2/src/features/video/core/videoPolicies.ts
+++ b/invokeai/frontend/webv2/src/features/video/core/videoPolicies.ts
@@ -224,6 +224,18 @@ export const isSupportedVideoModel = <T extends { base: string; type: string; fo
export const isVideoModelSelectable = <T extends ModelConfig>(model: T): boolean => isSupportedVideoModel(model);
+/**
+ * A slim MiniMax H3 folder install: tokenizer/processor/VAEs only, no
+ * transformer or text-encoder weights. The backend probe records
+ * `components_only` on the config precisely so the UI can require the
+ * single-file overrides up front instead of failing mid-generation.
+ */
+export const isComponentsOnlyH3Main = (model: MainModelConfig): boolean =>
+ // Demand the full config, not a Pick: a narrowed object would type-check
+ // here but silently read `components_only` as absent — a false negative
+ // that re-opens the fail-mid-generation hole this helper exists to close.
+ model.base === 'minimax-h3' && model.format === 'diffusers' && model.components_only === true;
+
const getVideoVariantConfig = (
model: Pick<MainModelConfig, 'base' | 'type' | 'variant' | 'format'> | undefined
): VideoVariantConfig | null => {
@@ -761,24 +773,38 @@ export const getVideoComponentSectionPolicy = (
return createComponentPolicy(model.format !== 'diffusers', slots);
}
- // MiniMax H3: the Diffusers install bundles everything; both slots are
- // optional single-file overrides (e.g. the int8 repacks).
- return createComponentPolicy(false, [
+ // MiniMax H3: a full Diffusers install bundles everything, so both slots
+ // are optional single-file overrides (e.g. the int8 repacks). A slim
+ // "components-only" install (tokenizer/processor/VAEs without transformer
+ // or text-encoder weights — the backend probe records `components_only`)
+ // REQUIRES both overrides: without this gate Invoke enables and the loader
+ // fails minutes into the run.
+ const componentsOnly = isComponentsOnlyH3Main(model);
+
+ return createComponentPolicy(componentsOnly, [
{
filter: (candidate) =>
candidate.type === 'main' && candidate.base === 'minimax-h3' && candidate.format === 'checkpoint',
- helpText: 'Optional single-file transformer (e.g. pruned int8) used in place of the main model’s transformer.',
+ helpText: componentsOnly
+ ? 'Required: this main model is a components-only install, so the transformer must come from a single-file checkpoint (e.g. pruned int8).'
+ : 'Optional single-file transformer (e.g. pruned int8) used in place of the main model’s transformer.',
key: 'h3TransformerModel',
label: 'Transformer (single file)',
+ missingMessage: `${model.name} is a components-only install — select a single-file Transformer.`,
modelTypes: ['main'],
+ required: componentsOnly ? () => true : undefined,
valueKind: 'main',
},
{
filter: (candidate) => candidate.type === 'qwen3_vl_encoder' && candidate.base === 'minimax-h3',
- helpText: 'Optional single-file Qwen3-VL encoder used in place of the main model’s text encoder.',
+ helpText: componentsOnly
+ ? 'Required: this main model is a components-only install, so the text encoder must come from a single-file Qwen3-VL checkpoint.'
+ : 'Optional single-file Qwen3-VL encoder used in place of the main model’s text encoder.',
key: 'h3TextEncoderModel',
label: 'Text encoder (single file)',
+ missingMessage: `${model.name} is a components-only install — select a single-file Text encoder.`,
modelTypes: ['qwen3_vl_encoder'],
+ required: componentsOnly ? () => true : undefined,
valueKind: 'component',
},
]);