From d5a55789f9f1335f375d628b52fa7e2958bc2c74 Mon Sep 17 00:00:00 2001 From: Mary Hipp Date: Wed, 21 Aug 2024 13:26:08 -0400 Subject: [PATCH] fix(ui): only exclude flux main models from linear UI dropdown, not model manager list --- .../parameters/components/MainModel/ParamMainModelSelect.tsx | 4 ++-- invokeai/frontend/web/src/services/api/hooks/modelsByType.ts | 4 +++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/invokeai/frontend/web/src/features/parameters/components/MainModel/ParamMainModelSelect.tsx b/invokeai/frontend/web/src/features/parameters/components/MainModel/ParamMainModelSelect.tsx index c9410dd7a4..89f7b0bc4d 100644 --- a/invokeai/frontend/web/src/features/parameters/components/MainModel/ParamMainModelSelect.tsx +++ b/invokeai/frontend/web/src/features/parameters/components/MainModel/ParamMainModelSelect.tsx @@ -8,7 +8,7 @@ import { modelSelected } from 'features/parameters/store/actions'; import { selectGenerationSlice } from 'features/parameters/store/generationSlice'; import { memo, useCallback, useMemo } from 'react'; import { useTranslation } from 'react-i18next'; -import { useMainModels } from 'services/api/hooks/modelsByType'; +import { useSDMainModels } from 'services/api/hooks/modelsByType'; import type { MainModelConfig } from 'services/api/types'; const selectModel = createMemoizedSelector(selectGenerationSlice, (generation) => generation.model); @@ -17,7 +17,7 @@ const ParamMainModelSelect = () => { const dispatch = useAppDispatch(); const { t } = useTranslation(); const selectedModel = useAppSelector(selectModel); - const [modelConfigs, { isLoading }] = useMainModels(); + const [modelConfigs, { isLoading }] = useSDMainModels(); const tooltipLabel = useMemo(() => { if (!modelConfigs.length || !selectedModel) { return; diff --git a/invokeai/frontend/web/src/services/api/hooks/modelsByType.ts b/invokeai/frontend/web/src/services/api/hooks/modelsByType.ts index 273db5a9de..6daddf7c4e 100644 --- a/invokeai/frontend/web/src/services/api/hooks/modelsByType.ts +++ b/invokeai/frontend/web/src/services/api/hooks/modelsByType.ts @@ -9,6 +9,7 @@ import { isFluxMainModelModelConfig, isIPAdapterModelConfig, isLoRAModelConfig, + isNonRefinerMainModelConfig, isNonRefinerNonFluxMainModelConfig, isNonSDXLMainModelConfig, isRefinerMainModelModelConfig, @@ -35,7 +36,8 @@ const buildModelsHook = return [modelConfigs, result] as const; }; -export const useMainModels = buildModelsHook(isNonRefinerNonFluxMainModelConfig); +export const useSDMainModels = buildModelsHook(isNonRefinerNonFluxMainModelConfig); +export const useMainModels = buildModelsHook(isNonRefinerMainModelConfig); export const useNonSDXLMainModels = buildModelsHook(isNonSDXLMainModelConfig); export const useRefinerModels = buildModelsHook(isRefinerMainModelModelConfig); export const useFluxModels = buildModelsHook(isFluxMainModelModelConfig);