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): video recall clears the H3 hybrid base; slot listed last

Lincoln Stein87eacdaecd8c
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 d18cdac581..10b5ba3d87 100644
--- a/invokeai/frontend/webv2/src/features/video/core/videoPolicies.test.ts
+++ b/invokeai/frontend/webv2/src/features/video/core/videoPolicies.test.ts
@@ -703,13 +703,14 @@ describe('component section policy', () => {
const settings = settingsFor(ref2va);
const policy = getVideoComponentSectionPolicy(ref2va, settings);
+ // Last: optional tuning sits below the slots the panel needs to run.
expect(policy.slots.map((slot) => slot.key)).toEqual([
- 'h3HybridBaseModel',
'componentSourceModel',
'h3TextEncoderModel',
+ 'h3HybridBaseModel',
]);
- const slot = policy.slots[0];
+ const slot = policy.slots.find((candidate) => candidate.key === 'h3HybridBaseModel');
const ctx = { model: ref2va, selectedComponents: settings, settings };
// Optional: the panel is complete without it.
diff --git a/invokeai/frontend/webv2/src/features/video/core/videoPolicies.ts b/invokeai/frontend/webv2/src/features/video/core/videoPolicies.ts
index 1640cb91b3..c562c25177 100644
--- a/invokeai/frontend/webv2/src/features/video/core/videoPolicies.ts
+++ b/invokeai/frontend/webv2/src/features/video/core/videoPolicies.ts
@@ -1161,23 +1161,6 @@ export const getVideoComponentSectionPolicy = (
}
return createComponentPolicy(true, [
- // The hybrid is a Ref2VA-only option: an FL2VA checkpoint stands in for
- // every weight but the AdaLN projections, whose task-defining half stays
- // the selected Ref2VA main's. Offered on the Ref2VA selection so the
- // panel's reference mode (decided by the top model) is unaffected.
- ...(model.variant === 'ref2va'
- ? [
- {
- filter: isH3HybridBaseCandidate,
- helpText:
- 'Optional: an FL2VA transformer to run with this Ref2VA model’s AdaLN projections (the per-block time-conditioning layers) from the chosen block onward — FL2VA’s output quality, references still routed. Same file kind as the model (pruned with pruned).',
- key: 'h3HybridBaseModel',
- label: 'Hybrid quality base (FL2VA)',
- modelTypes: ['main'],
- valueKind: 'main',
- } satisfies VideoComponentSlotPolicy,
- ]
- : []),
{
filter: (candidate) =>
candidate.type === 'main' && candidate.base === 'minimax-h3' && candidate.format === 'diffusers',
@@ -1202,6 +1185,24 @@ export const getVideoComponentSectionPolicy = (
required: (ctx) => !isH3TextEncoderSatisfied(ctx),
valueKind: 'component',
},
+ // The hybrid is a Ref2VA-only option: an FL2VA checkpoint stands in for
+ // every weight but the AdaLN projections, whose task-defining half stays
+ // the selected Ref2VA main's. Offered on the Ref2VA selection so the
+ // panel's reference mode (decided by the top model) is unaffected. Listed
+ // last: optional tuning sits below the slots the panel needs to run.
+ ...(model.variant === 'ref2va'
+ ? [
+ {
+ filter: isH3HybridBaseCandidate,
+ helpText:
+ 'Optional: an FL2VA transformer to run with this Ref2VA model’s AdaLN projections (the per-block time-conditioning layers) from the chosen block onward — FL2VA’s output quality, references still routed. Same file kind as the model (pruned with pruned).',
+ key: 'h3HybridBaseModel',
+ label: 'Hybrid quality base (FL2VA)',
+ modelTypes: ['main'],
+ valueKind: 'main',
+ } satisfies VideoComponentSlotPolicy,
+ ]
+ : []),
]);
};
diff --git a/invokeai/frontend/webv2/src/workbench/image-actions/videoRecall.test.ts b/invokeai/frontend/webv2/src/workbench/image-actions/videoRecall.test.ts
index c7ed9464aa..02f02fbf76 100644
--- a/invokeai/frontend/webv2/src/workbench/image-actions/videoRecall.test.ts
+++ b/invokeai/frontend/webv2/src/workbench/image-actions/videoRecall.test.ts
@@ -541,7 +541,9 @@ describe('model-position recall shapes', () => {
expect(gone?.values.h3HybridBaseModel).toBeNull();
expect(gone?.values.h3HybridStartBlock).toBe(currentValues.h3HybridStartBlock);
- // Nor onto a different base the panel already holds: base Y's block 30 must not land on base X.
+ // A base the panel already holds does not stand in for the uninstalled recorded one: the
+ // recall reproduces the run, which cannot run that hybrid any more. Base Y's block 30 must
+ // not land on base X either.
const otherBase: MainModelConfig = { ...fl2vaBase, key: 'h3-fl2va-other', name: 'Another FL2VA' };
const holding = { ...currentValues, h3HybridBaseModel: otherBase, h3HybridStartBlock: 12 };
const onto = buildVideoRecallSettings({
@@ -551,10 +553,80 @@ describe('model-position recall shapes', () => {
models: [...catalog, otherBase],
});
- expect(onto?.values.h3HybridBaseModel?.key).toBe(otherBase.key);
+ expect(onto?.fields).toContain('components');
+ expect(onto?.values.h3HybridBaseModel).toBeNull();
expect(onto?.values.h3HybridStartBlock).toBe(12);
});
+ it.each(['all', 'remix'] as const)(
+ 'clears the hybrid quality base on a %s recall of a run recorded without it',
+ (kind) => {
+ const fl2vaBase: MainModelConfig = {
+ base: 'minimax-h3',
+ format: 'checkpoint',
+ key: 'h3-fl2va-ckpt',
+ name: 'MiniMax H3 FL2VA Transformer (int8, pruned)',
+ type: 'main',
+ variant: 'fl2va',
+ };
+ // No component source recorded either, so the cleared base is the only component change.
+ const metadata = {
+ generation_mode: 'minimax_h3_ref2v',
+ minimax_h3_references: [{ detail: 'max', image_name: 'ref.png', kind: 'image' }],
+ model: { key: checkpoint.key },
+ num_frames: 124,
+ };
+ const holding = { ...currentValues, h3HybridBaseModel: fl2vaBase, h3HybridStartBlock: 12 };
+ const result = buildVideoRecallSettings({
+ currentValues: holding,
+ kind,
+ metadata,
+ models: [...catalog, fl2vaBase],
+ });
+
+ expect(result?.fields).toContain('components');
+ expect(result?.values.model?.key).toBe(checkpoint.key);
+ expect(result?.values.h3HybridBaseModel).toBeNull();
+ // The block is hidden without a base and only means something with one; it is left alone.
+ expect(result?.values.h3HybridStartBlock).toBe(12);
+
+ // A panel without a base has nothing to clear, and the toast must not claim a component change.
+ const bare = buildVideoRecallSettings({ currentValues, kind, metadata, models: [...catalog, fl2vaBase] });
+
+ expect(bare?.values.h3HybridBaseModel).toBeNull();
+ expect(bare?.fields).not.toContain('components');
+
+ // A recall that moves the panel to a main without the hybrid slot drops the base in the
+ // model transition; that is still this recall clearing it, so the toast says so.
+ const toFl2va = buildVideoRecallSettings({
+ currentValues: holding,
+ kind,
+ metadata: {
+ ...metadata,
+ generation_mode: 'minimax_h3_t2v',
+ minimax_h3_references: undefined,
+ model: { key: fl2vaBase.key },
+ },
+ models: [...catalog, fl2vaBase],
+ });
+
+ expect(toFl2va?.values.model?.key).toBe(fl2vaBase.key);
+ expect(toFl2va?.values.h3HybridBaseModel).toBeNull();
+ expect(toFl2va?.fields).toContain('components');
+
+ // A seed recall never reaches the components: the held base survives it.
+ const seedOnly = buildVideoRecallSettings({
+ currentValues: holding,
+ kind: 'seed',
+ metadata: { ...metadata, seed: 7 },
+ models: [...catalog, fl2vaBase],
+ });
+
+ expect(seedOnly?.fields).toEqual(['seed']);
+ expect(seedOnly?.values.h3HybridBaseModel).toEqual(fl2vaBase);
+ }
+ );
+
it('recalls the recorded component source for a checkpoint-main recording', () => {
const result = buildVideoRecallSettings({
currentValues,
diff --git a/invokeai/frontend/webv2/src/workbench/image-actions/videoRecall.ts b/invokeai/frontend/webv2/src/workbench/image-actions/videoRecall.ts
index 07ca9dd111..7eb44378a4 100644
--- a/invokeai/frontend/webv2/src/workbench/image-actions/videoRecall.ts
+++ b/invokeai/frontend/webv2/src/workbench/image-actions/videoRecall.ts
@@ -551,6 +551,21 @@ export const buildVideoRecallSettings = ({
}
}
+ // The hybrid base reproduces the recorded run exactly: it comes back when
+ // the run recorded a still-installed one, and is CLEARED otherwise — a run
+ // without the hybrid (or one whose base is gone) must not keep the panel's
+ // base, which would misrepresent the run. The required components (source
+ // install, text encoder) keep the panel's pick on absence instead: they are
+ // what makes the main runnable, not a record of the run. Reported against
+ // the ORIGINAL panel state, like media: a base the model transition above
+ // already dropped was still cleared by this recall.
+ if (!hybridBaseRecalled) {
+ if (values.h3HybridBaseModel) {
+ values = { ...values, h3HybridBaseModel: null };
+ }
+ componentsRecalled ||= currentValues.h3HybridBaseModel !== null;
+ }
+
// The hybrid's start block belongs to the recorded base: it only comes back
// with it, never onto a base the panel happened to hold already.
const hybridStartBlock = getInteger(metadata, 'minimax_h3_hybrid_start_block');