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.

Merge branch 'main' into minimax-h3/04-linear-ui

Lincoln Stein07f1163210ab
diff --cc invokeai/frontend/web/public/locales/en.json
index aeb5f65fc5,d4af42ca68..dc7bd7d126
--- a/invokeai/frontend/web/public/locales/en.json
+++ b/invokeai/frontend/web/public/locales/en.json
@@@ -1781,9 -1789,10 +1789,11 @@@
"noQwen3EncoderModelSelected": "No Qwen3 Encoder model selected for FLUX2 Klein generation",
"noFlux2KleinVaeModelSelected": "No VAE selected. Non-diffusers FLUX.2 Klein models require a standalone VAE",
"noFlux2KleinQwen3EncoderModelSelected": "No Qwen3 Encoder selected. Non-diffusers FLUX.2 Klein models require a standalone Qwen3 Encoder",
+ "noFlux2DevVaeModelSelected": "No VAE selected. Non-diffusers FLUX.2 [dev] models require a standalone FLUX.2 VAE",
+ "noFlux2DevMistralEncoderModelSelected": "No Mistral Encoder selected. Non-diffusers FLUX.2 [dev] models require a standalone Mistral text encoder",
"noQwenImageComponentSourceSelected": "GGUF Qwen Image models require a Diffusers Component Source for VAE/encoder",
"noWanComponentSourceSelected": "GGUF Wan 2.2 models require a Diffusers Component Source for VAE/encoder",
+ "minimaxH3VideoOnGenerateTab": "MiniMax H3 video generation runs on the Generate tab (switch Output to Image to use MiniMax H3 on canvas)",
"noZImageVaeSourceSelected": "No VAE source: Select VAE (FLUX) or Qwen3 Source model",
"noZImageQwen3EncoderSourceSelected": "No Qwen3 Encoder source: Select Qwen3 Encoder or Qwen3 Source model",
"noKrea2VaeModelSelected": "Non-diffusers Krea-2: select a VAE in Advanced settings",
diff --cc invokeai/frontend/web/src/features/controlLayers/store/paramsSlice.test.ts
index 39387191c6,9e95dde86b..013e08880b
--- a/invokeai/frontend/web/src/features/controlLayers/store/paramsSlice.test.ts
+++ b/invokeai/frontend/web/src/features/controlLayers/store/paramsSlice.test.ts
@@@ -170,8 -168,8 +170,8 @@@ describe('paramsSliceConfig persisted s
const result = migrate?.(v2State) as ReturnType<typeof getInitialParamsState>;
// v2 migrates all the way through the current chain (v2 -> v3 adds Qwen fields,
- // v3 -> v4 adds Krea-2 and PiD fields, v4 -> v5 adds MiniMax H3 fields).
- // v3 -> v4 adds Krea-2 and PiD fields).
-- expect(result._version).toBe(5);
++ // v3 -> v4 adds Krea-2 and PiD fields, v5 -> v6 adds MiniMax H3 fields).
++ expect(result._version).toBe(6);
expect(result.qwenImageVaeModel).toBeNull();
expect(result.qwenImageQwenVLEncoderModel).toBeNull();
expect(result.hiDiffusionEnabled).toBe(false);
@@@ -187,6 -185,40 +187,40 @@@
expect(result.dimensions.height).toBe(768);
});
+ it('merges the separate Klein / dev VAE slots into flux2VaeModel when migrating from v3', () => {
+ expect(migrate).toBeDefined();
+
+ const initial = getInitialParamsState();
+ const kleinVae = { key: 'klein-vae', hash: 'h', name: 'Klein VAE', base: 'flux2', type: 'vae' };
+ // Pre-PR v3 state: separate Klein / dev VAE slots, no shared flux2VaeModel and none of the
+ // other v4-only keys. Deleting both is what makes this a field-accurate v3 blob — without it
+ // the fixture carries flux2DevMistralEncoderModel from getInitialParamsState() and masks the
+ // migration's missing seed (which makes zParamsState.parse() throw on real upgrades).
+ const v3State: Record<string, unknown> = {
+ ...initial,
+ _version: 3,
+ positivePrompt: 'a fluffy cat',
+ seed: 42,
+ kleinVaeModel: kleinVae,
+ flux2DevVaeModel: null,
+ };
+ delete v3State.flux2VaeModel;
+ delete v3State.flux2DevMistralEncoderModel;
+
+ const result = migrate?.(v3State) as ReturnType<typeof getInitialParamsState> & Record<string, unknown>;
+
- expect(result._version).toBe(5);
++ expect(result._version).toBe(6);
+ expect((result.flux2VaeModel as { key: string } | null)?.key).toBe('klein-vae');
+ // The new standalone dev Mistral encoder slot must be seeded, not left undefined.
+ expect(result.flux2DevMistralEncoderModel).toBeNull();
+ // Unrelated params must survive the migration (they'd be wiped if parse() threw).
+ expect(result.positivePrompt).toBe('a fluffy cat');
+ expect(result.seed).toBe(42);
+ // The old slots must be gone.
+ expect(result.kleinVaeModel).toBeUndefined();
+ expect(result.flux2DevVaeModel).toBeUndefined();
+ });
+
it('backfills Krea-2 fields when migrating from v3 and preserves existing params', () => {
expect(migrate).toBeDefined();
@@@ -211,7 -241,7 +245,7 @@@
const result = migrate?.(v3State) as ReturnType<typeof getInitialParamsState>;
-- expect(result._version).toBe(5);
++ expect(result._version).toBe(6);
expect(result.krea2VaeModel).toBeNull();
expect(result.krea2Qwen3VlEncoderModel).toBeNull();
expect(result.krea2SeedVarianceEnabled).toBe(false);
@@@ -229,26 -259,91 +263,144 @@@
expect(migrate).toBeDefined();
const initial = getInitialParamsState();
- const v4State: Record<string, unknown> = {
+ // Released v6.13.x builds wrote v3 blobs before the Wan fields existed. They're nullable
+ // with no default, so if the v3 -> v4 step didn't seed them, parse() would throw and the
+ // whole slice would be wiped on upgrade.
+ const v3State: Record<string, unknown> = {
+ ...initial,
+ _version: 3,
+ positivePrompt: 'a fluffy cat',
+ };
+ delete v3State.wanTransformerLowNoise;
+ delete v3State.wanComponentSource;
+ delete v3State.wanVaeModel;
+ delete v3State.wanT5EncoderModel;
+ delete v3State.wanGuidanceScaleLowNoise;
+ delete v3State.flux2VaeModel;
+ delete v3State.flux2DevMistralEncoderModel;
+
+ const result = migrate?.(v3State) as ReturnType<typeof getInitialParamsState>;
+
- expect(result._version).toBe(5);
++ expect(result._version).toBe(6);
+ expect(result.wanTransformerLowNoise).toBeNull();
+ expect(result.wanComponentSource).toBeNull();
+ expect(result.wanVaeModel).toBeNull();
+ expect(result.wanT5EncoderModel).toBeNull();
+ expect(result.wanGuidanceScaleLowNoise).toBeNull();
+ expect(result.positivePrompt).toBe('a fluffy cat');
+ });
+
+ it('migrates a v4 blob written by main (PiD fields, no flux2 fields) without wiping it', () => {
+ expect(migrate).toBeDefined();
+
+ const initial = getInitialParamsState();
+ const kleinVae = { key: 'klein-vae', hash: 'h', name: 'Klein VAE', base: 'flux2', type: 'vae' };
+ // main and the FLUX.2 [dev] branch both shipped _version 4 with different keys. A blob from
+ // main has the PiD fields and the old kleinVaeModel slot, but no flux2VaeModel /
+ // flux2DevMistralEncoderModel.
+ const mainV4State: Record<string, unknown> = {
+ ...initial,
+ _version: 4,
+ positivePrompt: 'a fluffy cat',
+ pidMode: 'fit',
+ kleinVaeModel: kleinVae,
+ };
+ delete mainV4State.flux2VaeModel;
+ delete mainV4State.flux2DevMistralEncoderModel;
+
+ const result = migrate?.(mainV4State) as ReturnType<typeof getInitialParamsState> & Record<string, unknown>;
+
- expect(result._version).toBe(5);
++ expect(result._version).toBe(6);
+ expect((result.flux2VaeModel as { key: string } | null)?.key).toBe('klein-vae');
+ expect(result.flux2DevMistralEncoderModel).toBeNull();
+ // main's own v4 values must survive untouched.
+ expect(result.pidMode).toBe('fit');
+ expect(result.positivePrompt).toBe('a fluffy cat');
+ expect(result.kleinVaeModel).toBeUndefined();
+ });
+
+ it('migrates a v4 blob written by a pre-merge [dev] build (flux2 fields, no PiD fields) without wiping it', () => {
+ expect(migrate).toBeDefined();
+
+ const initial = getInitialParamsState();
+ const flux2Vae = { key: 'flux2-vae', hash: 'h', name: 'FLUX.2 VAE', base: 'flux2', type: 'vae' };
+ const devV4State: Record<string, unknown> = {
...initial,
_version: 4,
+ positivePrompt: 'a fluffy cat',
+ flux2VaeModel: flux2Vae,
+ flux2DevMistralEncoderModel: null,
+ };
+ delete devV4State.pidMode;
+ delete devV4State.pidDecoderModel;
+ delete devV4State.gemma2EncoderModel;
+ delete devV4State.pidSteps;
+
+ const result = migrate?.(devV4State) as ReturnType<typeof getInitialParamsState> & Record<string, unknown>;
+
- expect(result._version).toBe(5);
++ expect(result._version).toBe(6);
+ // The branch's own v4 values must survive untouched.
+ expect((result.flux2VaeModel as { key: string } | null)?.key).toBe('flux2-vae');
+ expect(result.pidMode).toBe('off');
+ expect(result.pidDecoderModel).toBeNull();
+ expect(result.gemma2EncoderModel).toBeNull();
+ expect(result.pidSteps).toBe(4);
+ expect(result.positivePrompt).toBe('a fluffy cat');
+ });
+
++ it('backfills the MiniMax H3 fields when migrating from v5 and preserves existing params', () => {
++ // main shipped its own v4 -> v5 (the FLUX.2 [dev] VAE/encoder merge) before this branch
++ // landed, so the H3 step runs as v5 -> v6. A v5 blob written by a released build has no H3
++ // keys, and they are required with no default -- if this step did not run, zParamsState.parse()
++ // would throw and the whole slice would be wiped on upgrade.
++ expect(migrate).toBeDefined();
++
++ const initial = getInitialParamsState();
++ const v5State: Record<string, unknown> = {
++ ...initial,
++ _version: 5,
+ positivePrompt: 'preserve this prompt',
+ seed: 4242,
+ dimensions: { ...initial.dimensions, width: 1344, height: 768 },
+ };
++ delete v5State.minimaxH3DurationSeconds;
++ delete v5State.minimaxH3OutputMode;
++
++ const result = migrate?.(v5State) as ReturnType<typeof getInitialParamsState>;
++
++ expect(result._version).toBe(6);
++ expect(result.minimaxH3DurationSeconds).toBe(5);
++ expect(result.minimaxH3OutputMode).toBe('video');
++ expect(result.positivePrompt).toBe('preserve this prompt');
++ expect(result.seed).toBe(4242);
++ expect(result.dimensions).toMatchObject({ width: 1344, height: 768 });
++ });
++
++ it('carries a v4 blob through both the flux2 and MiniMax H3 steps in one pass', () => {
++ // The regression this guards: with both steps written as v4 -> v5, the flux2 block sets
++ // _version = 5 and the H3 block never runs, so the parse below throws and the slice is wiped.
++ expect(migrate).toBeDefined();
++
++ const initial = getInitialParamsState();
++ const v4State: Record<string, unknown> = {
++ ...initial,
++ _version: 4,
++ positivePrompt: 'preserve this prompt',
++ };
+ delete v4State.minimaxH3DurationSeconds;
+ delete v4State.minimaxH3OutputMode;
++ delete v4State.flux2VaeModel;
++ delete v4State.flux2DevMistralEncoderModel;
+
+ const result = migrate?.(v4State) as ReturnType<typeof getInitialParamsState>;
+
- expect(result._version).toBe(5);
++ expect(result._version).toBe(6);
+ expect(result.minimaxH3DurationSeconds).toBe(5);
+ expect(result.minimaxH3OutputMode).toBe('video');
++ expect(result.flux2DevMistralEncoderModel).toBeNull();
+ expect(result.positivePrompt).toBe('preserve this prompt');
- expect(result.seed).toBe(4242);
- expect(result.dimensions).toMatchObject({ width: 1344, height: 768 });
+ });
+
it('backfills the ERNIE-Image fields from their zod defaults without a version bump', () => {
// The ERNIE-Image fields are additive with `.default()`, so there is no migration branch for
// them. A persisted state written before they existed must still parse -- if it throws, the
diff --cc invokeai/frontend/web/src/features/controlLayers/store/paramsSlice.ts
index a005d980ba,7bb2e9781c..135a6a4c2f
--- a/invokeai/frontend/web/src/features/controlLayers/store/paramsSlice.ts
+++ b/invokeai/frontend/web/src/features/controlLayers/store/paramsSlice.ts
@@@ -1022,12 -1027,25 +1043,40 @@@ export const paramsSliceConfig: SliceCo
}
if (state._version === 4) {
- // v4 -> v5, add the MiniMax H3 duration and output-mode fields
+ // v4 -> v5, merge the separate Klein / [dev] FLUX.2 VAE slots into one shared
+ // flux2VaeModel (both drew from the same FLUX.2 VAE pool — keep whichever was set) and
+ // seed the new standalone [dev] Mistral encoder slot. Both parents of the FLUX.2 [dev]
+ // merge shipped incompatible schemas under _version 4 (main added the PiD fields; the
+ // [dev] branch added the flux2 fields), so a v4 blob may be missing either side's keys —
+ // every seed here is conditional, and the PiD keys are re-seeded for blobs written by
+ // pre-merge [dev] builds. All are nullable-with-no-default, so any missing key would
+ // fail zParamsState.parse() and wipe the whole slice.
state._version = 5;
+ state.flux2VaeModel = state.flux2VaeModel ?? state.kleinVaeModel ?? state.flux2DevVaeModel ?? null;
+ state.flux2DevMistralEncoderModel = state.flux2DevMistralEncoderModel ?? null;
+ delete state.kleinVaeModel;
+ delete state.flux2DevVaeModel;
+ state.pidMode = state.pidMode ?? 'off';
+ state.pidDecoderModel = state.pidDecoderModel ?? null;
+ state.gemma2EncoderModel = state.gemma2EncoderModel ?? null;
+ state.pidSteps = state.pidSteps ?? 4;
+ }
+
++ if (state._version === 5) {
++ // v5 -> v6, add the MiniMax H3 duration and output-mode fields.
++ //
++ // This step was written as v4 -> v5 on this branch, but main landed its own v4 -> v5
++ // (the FLUX.2 [dev] VAE/encoder merge) first. Keeping both as v4 -> v5 silently breaks
++ // the migration: the block above sets _version = 5, so a v4 blob would skip this one
++ // and reach zParamsState.parse() without the H3 keys — which are required with no
++ // default, so the parse throws and the whole params slice is wiped on upgrade. Running
++ // as v5 -> v6 covers both a v4 blob (via main's step) and any v5 blob already written
++ // by a released build.
++ state._version = 6;
+ state.minimaxH3DurationSeconds = 5;
+ state.minimaxH3OutputMode = 'video';
+ }
+
if (!('hiDiffusionEnabled' in state)) {
state.hiDiffusionEnabled = false;
}
diff --cc invokeai/frontend/web/src/features/controlLayers/store/types.ts
index ce5aa6df09,898587a3f1..fe865343bc
--- a/invokeai/frontend/web/src/features/controlLayers/store/types.ts
+++ b/invokeai/frontend/web/src/features/controlLayers/store/types.ts
@@@ -831,7 -817,7 +831,7 @@@ const zPidMode = z.enum(['off', 'fit',
export type PidMode = z.infer<typeof zPidMode>;
export const zParamsState = z.object({
-- _version: z.literal(5),
++ _version: z.literal(6),
maskBlur: z.number(),
maskBlurMethod: zParameterMaskBlurMethod,
canvasCoherenceMode: zParameterCanvasCoherenceMode,
@@@ -969,7 -955,7 +973,7 @@@
});
export type ParamsState = z.infer<typeof zParamsState>;
export const getInitialParamsState = (): ParamsState => ({
-- _version: 5,
++ _version: 6,
maskBlur: 16,
maskBlurMethod: 'box',
canvasCoherenceMode: 'Gaussian Blur',
diff --cc invokeai/frontend/web/src/features/metadata/parsing.tsx
index 52bc2eedcb,86ca976a19..ce08a70131
--- a/invokeai/frontend/web/src/features/metadata/parsing.tsx
+++ b/invokeai/frontend/web/src/features/metadata/parsing.tsx
@@@ -16,11 -18,8 +18,10 @@@ import
imageSizeChanged,
isValidKrea2RebalanceWeights,
kleinQwen3EncoderModelSelected,
- kleinVaeModelSelected,
krea2Qwen3VlEncoderModelSelected,
krea2VaeModelSelected,
+ minimaxH3DurationSecondsChanged,
+ minimaxH3OutputModeChanged,
negativePromptChanged,
openaiBackgroundChanged,
openaiInputFidelityChanged,
diff --cc invokeai/frontend/web/src/features/settingsAccordions/components/GenerationSettingsAccordion/GenerationSettingsAccordion.tsx
index 080418a97f,6693b97ee0..2fa325ff9e
--- a/invokeai/frontend/web/src/features/settingsAccordions/components/GenerationSettingsAccordion/GenerationSettingsAccordion.tsx
+++ b/invokeai/frontend/web/src/features/settingsAccordions/components/GenerationSettingsAccordion/GenerationSettingsAccordion.tsx
@@@ -12,9 -12,9 +12,10 @@@ import
selectIsExternal,
selectIsFLUX,
selectIsFlux2,
+ selectIsFlux2Dev,
selectIsIdeogram4,
selectIsKrea2,
+ selectIsMiniMaxH3,
selectIsQwenImage,
selectIsWan,
selectIsZImage,
@@@ -128,10 -126,9 +130,11 @@@ export const GenerationSettingsAccordio
{!isExternal && isFLUX && modelConfig && !isFluxFillMainModelModelConfig(modelConfig) && (
<ParamGuidance />
)}
+ {!isExternal && isFlux2Dev && <ParamGuidance />}
- {!isExternal && !isFLUX && !isFlux2 && !isIdeogram4 && <ParamCFGScale />}
+ {!isExternal && !isFLUX && !isFlux2 && !isIdeogram4 && !isMiniMaxH3 && <ParamCFGScale />}
{!isExternal && isWan && <ParamWanGuidanceScaleLowNoise />}
+ {!isExternal && isMiniMaxH3 && <ParamMiniMaxH3OutputMode />}
+ {!isExternal && isMiniMaxH3 && <ParamMiniMaxH3Duration />}
{!isExternal && isZImage && <ParamZImageShift />}
{!isExternal && isQwenImage && <ParamQwenImageShift />}
{!isExternal && isFLUX && <ParamFluxDypePreset />}