diff --git a/invokeai/frontend/web/src/features/modelManagerV2/subpanels/AddModelPanel/ImportQueue/ImportQueueBadge.tsx b/invokeai/frontend/web/src/features/modelManagerV2/subpanels/AddModelPanel/ImportQueue/ImportQueueBadge.tsx index 54a4eeaeb5..bbd0421d37 100644 --- a/invokeai/frontend/web/src/features/modelManagerV2/subpanels/AddModelPanel/ImportQueue/ImportQueueBadge.tsx +++ b/invokeai/frontend/web/src/features/modelManagerV2/subpanels/AddModelPanel/ImportQueue/ImportQueueBadge.tsx @@ -15,7 +15,7 @@ const STATUSES = { const ImportQueueBadge = ({ status, errorReason }: { status?: ModelInstallStatus; errorReason?: string | null }) => { const { t } = useTranslation(); - if (!status) { + if (!status || !Object.keys(STATUSES).includes(status)) { return <>; } diff --git a/invokeai/frontend/web/src/features/parameters/components/MainModel/NavigateToModelManagerButton.tsx b/invokeai/frontend/web/src/features/parameters/components/MainModel/NavigateToModelManagerButton.tsx new file mode 100644 index 0000000000..733fb83826 --- /dev/null +++ b/invokeai/frontend/web/src/features/parameters/components/MainModel/NavigateToModelManagerButton.tsx @@ -0,0 +1,36 @@ +import type { IconButtonProps } from '@invoke-ai/ui-library'; +import { IconButton } from '@invoke-ai/ui-library'; +import { useAppDispatch, useAppSelector } from 'app/store/storeHooks'; +import { setActiveTab } from 'features/ui/store/uiSlice'; +import { memo, useCallback, useMemo } from 'react'; +import { useTranslation } from 'react-i18next'; +import { PiGearSixBold } from 'react-icons/pi'; + +export const NavigateToModelManagerButton = memo((props: Omit) => { + const { t } = useTranslation(); + const dispatch = useAppDispatch(); + const disabledTabs = useAppSelector((s) => s.config.disabledTabs); + const shouldShowButton = useMemo(() => !disabledTabs.includes('modelManager'), [disabledTabs]); + + const handleClick = useCallback(() => { + dispatch(setActiveTab('modelManager')); + }, [dispatch]); + + if (!shouldShowButton) { + return null; + } + + return ( + } + tooltip={t('modelManager.modelManager')} + aria-label={t('modelManager.modelManager')} + onClick={handleClick} + size="sm" + variant="ghost" + {...props} + /> + ); +}); + +NavigateToModelManagerButton.displayName = 'NavigateToModelManagerButton'; diff --git a/invokeai/frontend/web/src/features/settingsAccordions/components/GenerationSettingsAccordion/GenerationSettingsAccordion.tsx b/invokeai/frontend/web/src/features/settingsAccordions/components/GenerationSettingsAccordion/GenerationSettingsAccordion.tsx index 9d1bf9eb83..1258189f40 100644 --- a/invokeai/frontend/web/src/features/settingsAccordions/components/GenerationSettingsAccordion/GenerationSettingsAccordion.tsx +++ b/invokeai/frontend/web/src/features/settingsAccordions/components/GenerationSettingsAccordion/GenerationSettingsAccordion.tsx @@ -10,6 +10,7 @@ import { SyncModelsIconButton } from 'features/modelManagerV2/components/SyncMod import ParamCFGScale from 'features/parameters/components/Core/ParamCFGScale'; import ParamScheduler from 'features/parameters/components/Core/ParamScheduler'; import ParamSteps from 'features/parameters/components/Core/ParamSteps'; +import { NavigateToModelManagerButton } from 'features/parameters/components/MainModel/NavigateToModelManagerButton'; import ParamMainModelSelect from 'features/parameters/components/MainModel/ParamMainModelSelect'; import { useExpanderToggle } from 'features/settingsAccordions/hooks/useExpanderToggle'; import { useStandaloneAccordionToggle } from 'features/settingsAccordions/hooks/useStandaloneAccordionToggle'; @@ -56,7 +57,10 @@ export const GenerationSettingsAccordion = memo(() => { - + + + +