diff --git a/invokeai/frontend/web/src/features/parameters/components/MainModel/ParamMainModelSelect.tsx b/invokeai/frontend/web/src/features/parameters/components/MainModel/ParamMainModelSelect.tsx deleted file mode 100644 index 404ebfbd95..0000000000 --- a/invokeai/frontend/web/src/features/parameters/components/MainModel/ParamMainModelSelect.tsx +++ /dev/null @@ -1,116 +0,0 @@ -import { Box, Combobox, Flex, FormControl, FormLabel, Icon, Tooltip } from '@invoke-ai/ui-library'; -import { useAppDispatch, useAppSelector } from 'app/store/storeHooks'; -import { InformationalPopover } from 'common/components/InformationalPopover/InformationalPopover'; -import { useGroupedModelCombobox } from 'common/hooks/useGroupedModelCombobox'; -import { selectModelKey } from 'features/controlLayers/store/paramsSlice'; -import { zModelIdentifierField } from 'features/nodes/types/common'; -import { NavigateToModelManagerButton } from 'features/parameters/components/MainModel/NavigateToModelManagerButton'; -import { UseDefaultSettingsButton } from 'features/parameters/components/MainModel/UseDefaultSettingsButton'; -import { modelSelected } from 'features/parameters/store/actions'; -import { selectActiveTab } from 'features/ui/store/uiSelectors'; -import { memo, useCallback, useMemo } from 'react'; -import { useTranslation } from 'react-i18next'; -import { MdMoneyOff } from 'react-icons/md'; -import { useMainModels } from 'services/api/hooks/modelsByType'; -import { type AnyModelConfig, isCheckpointMainModelConfig, type MainModelConfig } from 'services/api/types'; - -import { DisabledModelWarning } from './DisabledModelWarning'; - -const ParamMainModelSelect = () => { - const dispatch = useAppDispatch(); - const { t } = useTranslation(); - const activeTabName = useAppSelector(selectActiveTab); - const selectedModelKey = useAppSelector(selectModelKey); - // const selectedModel = useAppSelector(selectModel); - const [modelConfigs, { isLoading }] = useMainModels(); - - const selectedModel = useMemo(() => { - if (!modelConfigs) { - return null; - } - if (selectedModelKey === null) { - return null; - } - const modelConfig = modelConfigs.find((model) => model.key === selectedModelKey); - - if (!modelConfig) { - return null; - } - - return modelConfig; - }, [modelConfigs, selectedModelKey]); - - const tooltipLabel = useMemo(() => { - if (!modelConfigs.length || !selectedModel) { - return; - } - return modelConfigs.find((m) => m.key === selectedModel?.key)?.description; - }, [modelConfigs, selectedModel]); - - const _onChange = useCallback( - (model: MainModelConfig | null) => { - if (!model) { - return; - } - try { - dispatch(modelSelected(zModelIdentifierField.parse(model))); - } catch { - // no-op - } - }, - [dispatch] - ); - - const getIsDisabled = useCallback( - (model: AnyModelConfig): boolean => { - return activeTabName === 'upscaling' && model.base === 'flux'; - }, - [activeTabName] - ); - - const { options, value, onChange, placeholder, noOptionsMessage } = useGroupedModelCombobox({ - modelConfigs, - selectedModel, - onChange: _onChange, - isLoading, - getIsDisabled, - }); - - const isFluxDevSelected = useMemo(() => { - return selectedModel && isCheckpointMainModelConfig(selectedModel) && selectedModel.config_path === 'flux-dev'; - }, [selectedModel]); - - return ( - <> - - - - {t('modelManager.model')} - - {isFluxDevSelected && ( - - - - - - )} - - - - - - - - - - ); -}; - -export default memo(ParamMainModelSelect); diff --git a/invokeai/frontend/web/src/index.ts b/invokeai/frontend/web/src/index.ts index 9279599613..1396bf7f5e 100644 --- a/invokeai/frontend/web/src/index.ts +++ b/invokeai/frontend/web/src/index.ts @@ -2,7 +2,6 @@ export { default as InvokeAIUI } from './app/components/InvokeAIUI'; export type { StudioInitAction } from './app/hooks/useStudioInitAction'; export type { LoggingOverrides } from './app/logging/logger'; export type { PartialAppConfig } from './app/types/invokeai'; -export { default as ParamMainModelSelect } from './features/parameters/components/MainModel/ParamMainModelSelect'; export { default as HotkeysModal } from './features/system/components/HotkeysModal/HotkeysModal'; export { default as InvokeAiLogoComponent } from './features/system/components/InvokeAILogoComponent'; export { default as SettingsModal } from './features/system/components/SettingsModal/SettingsModal';