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): close empty VAE filter hole

joshistoast7b0b72aba500
diff --git a/invokeai/frontend/webv2/src/features/generation/core/baseGenerationPolicies.ts b/invokeai/frontend/webv2/src/features/generation/core/baseGenerationPolicies.ts
index 0cc66d71a2..c5a220c64c 100644
--- a/invokeai/frontend/webv2/src/features/generation/core/baseGenerationPolicies.ts
+++ b/invokeai/frontend/webv2/src/features/generation/core/baseGenerationPolicies.ts
@@ -1128,7 +1128,10 @@ const getBaseComponentSectionPolicy = (
missingMessage: 'Generate needs a Qwen3 Encoder for Z-Image models.',
},
{
- ...vaeSlot('Required unless a Diffusers component source is available.', isVaeForBases(['flux'])),
+ ...vaeSlot(
+ 'Z-Image decodes with the FLUX VAE, so FLUX-base VAEs are listed here — they are fully compatible.',
+ isVaeForBases(['flux'])
+ ),
required: (ctx) => !isBundledOrDiffusersSourceSatisfied(ctx),
missingMessage: 'Generate needs a VAE for Z-Image models.',
},
@@ -1138,7 +1141,10 @@ const getBaseComponentSectionPolicy = (
// both submodels must be selected. Diffusers models bundle them, hence optional there.
return createPolicy(model.format !== 'diffusers', [
{
- ...vaeSlot('Required for non-Diffusers Krea-2 models. Qwen-Image VAEs are used.', isKrea2Vae),
+ ...vaeSlot(
+ 'Krea-2 decodes with the Qwen-Image 16-channel VAE; the same VAE may be installed under the Qwen-Image or Anima base, so both are listed.',
+ isKrea2Vae
+ ),
required: (ctx) => ctx.model.format !== 'diffusers',
missingMessage: 'Generate needs a VAE for non-Diffusers Krea-2 models.',
},
@@ -1176,7 +1182,10 @@ const getBaseComponentSectionPolicy = (
missingMessage: 'Generate needs a Qwen3 Encoder for Anima models.',
},
{
- ...vaeSlot('Required for Anima models. Qwen Image and FLUX VAEs are supported.', isAnimaVae),
+ ...vaeSlot(
+ 'Anima accepts VAEs installed under the Anima, Qwen-Image, or FLUX base — the same physical VAE ships under any of the three.',
+ isAnimaVae
+ ),
required: () => true,
missingMessage: 'Generate needs a VAE for Anima models.',
},
diff --git a/invokeai/frontend/webv2/src/features/generation/core/componentCompatibility.test.ts b/invokeai/frontend/webv2/src/features/generation/core/componentCompatibility.test.ts
index 8a00a7d44c..d4abdac056 100644
--- a/invokeai/frontend/webv2/src/features/generation/core/componentCompatibility.test.ts
+++ b/invokeai/frontend/webv2/src/features/generation/core/componentCompatibility.test.ts
@@ -11,6 +11,7 @@ import {
isFlux2Qwen3EncoderForModel,
isNonAnimaQwen3Encoder,
isVaeCompatibleWithGenerateModel,
+ isVaeForBases,
type GenerateComponentCandidate,
} from './componentCompatibility';
@@ -102,3 +103,20 @@ describe('Generate component compatibility', () => {
expect(getCompatibleSelectedComponentKey(staleVae, isAnimaVae)).toBeNull();
});
});
+
+const vae = (base: string) => ({ base, type: 'vae' }) as Parameters<ReturnType<typeof isVaeForBases>>[0];
+
+describe('isVaeForBases', () => {
+ it('matches a VAE whose base is listed', () => {
+ expect(isVaeForBases(['flux'])(vae('flux'))).toBe(true);
+ expect(isVaeForBases(['flux'])(vae('sdxl'))).toBe(false);
+ });
+
+ it('an empty base list matches nothing (no all-pass escape hatch)', () => {
+ expect(isVaeForBases([])(vae('flux'))).toBe(false);
+ });
+
+ it('never matches a non-vae model', () => {
+ expect(isVaeForBases(['flux'])({ base: 'flux', type: 'main' } as never)).toBe(false);
+ });
+});
diff --git a/invokeai/frontend/webv2/src/features/generation/core/componentCompatibility.ts b/invokeai/frontend/webv2/src/features/generation/core/componentCompatibility.ts
index e6e8bbc8db..02c88f862a 100644
--- a/invokeai/frontend/webv2/src/features/generation/core/componentCompatibility.ts
+++ b/invokeai/frontend/webv2/src/features/generation/core/componentCompatibility.ts
@@ -30,7 +30,7 @@ export const isDiffusersMainForBase =
export const isVaeForBases =
(bases: readonly string[]): GenerateComponentFilter =>
(model) =>
- model.type === 'vae' && (bases.length === 0 || bases.includes(model.base));
+ model.type === 'vae' && bases.length > 0 && bases.includes(model.base);
export const isClipVariant =
(variant: string): GenerateComponentFilter =>