From fbaa820643f4ae4459bec6016deaf1ecbfd46dd4 Mon Sep 17 00:00:00 2001 From: Mary Hipp Date: Tue, 20 Aug 2024 20:17:16 -0400 Subject: [PATCH] exclude flux models from main model dropdown --- invokeai/frontend/web/src/services/api/hooks/modelsByType.ts | 4 ++-- invokeai/frontend/web/src/services/api/types.ts | 4 ++++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/invokeai/frontend/web/src/services/api/hooks/modelsByType.ts b/invokeai/frontend/web/src/services/api/hooks/modelsByType.ts index 2d061e3157..273db5a9de 100644 --- a/invokeai/frontend/web/src/services/api/hooks/modelsByType.ts +++ b/invokeai/frontend/web/src/services/api/hooks/modelsByType.ts @@ -9,7 +9,7 @@ import { isFluxMainModelModelConfig, isIPAdapterModelConfig, isLoRAModelConfig, - isNonRefinerMainModelConfig, + isNonRefinerNonFluxMainModelConfig, isNonSDXLMainModelConfig, isRefinerMainModelModelConfig, isSDXLMainModelModelConfig, @@ -35,7 +35,7 @@ const buildModelsHook = return [modelConfigs, result] as const; }; -export const useMainModels = buildModelsHook(isNonRefinerMainModelConfig); +export const useMainModels = buildModelsHook(isNonRefinerNonFluxMainModelConfig); export const useNonSDXLMainModels = buildModelsHook(isNonSDXLMainModelConfig); export const useRefinerModels = buildModelsHook(isRefinerMainModelModelConfig); export const useFluxModels = buildModelsHook(isFluxMainModelModelConfig); diff --git a/invokeai/frontend/web/src/services/api/types.ts b/invokeai/frontend/web/src/services/api/types.ts index 79536606fa..045e150819 100644 --- a/invokeai/frontend/web/src/services/api/types.ts +++ b/invokeai/frontend/web/src/services/api/types.ts @@ -126,6 +126,10 @@ export const isNonRefinerMainModelConfig = (config: AnyModelConfig): config is M return config.type === 'main' && config.base !== 'sdxl-refiner'; }; +export const isNonRefinerNonFluxMainModelConfig = (config: AnyModelConfig): config is MainModelConfig => { + return config.type === 'main' && config.base !== 'sdxl-refiner' && config.base !== 'flux'; +}; + export const isRefinerMainModelModelConfig = (config: AnyModelConfig): config is MainModelConfig => { return config.type === 'main' && config.base === 'sdxl-refiner'; };