diff --git a/invokeai/frontend/web/public/locales/en.json b/invokeai/frontend/web/public/locales/en.json index f791e6e4f5..8fc600d6c9 100644 --- a/invokeai/frontend/web/public/locales/en.json +++ b/invokeai/frontend/web/public/locales/en.json @@ -1644,14 +1644,15 @@ "upscaling": { "creativity": "Creativity", "structure": "Structure", - "toInstall": "to install", "upscaleModel": "Upscale Model", "scale": "Scale", - "visit": "Visit", - "warningNoMainModel": "a model", - "warningNoTile": "a {{base_model}} tile controlnet required by this feature", - "warningNoTileOrUpscaleModel": "an upscaler model and {{base_model}} tile controlnet required by this feature", - "warningNoUpscaleModel": "an upscaler model required by this feature" + "missingModelsWarning": "Visit the Model Manager to install the required models:", + "mainModelDesc": "Main model (SD1.5 or SDXL architecture)", + "tileControlNetModelDesc": "Tile ControlNet model for the chosen main model architecture", + "upscaleModelDesc": "Upscale (image to image) model", + "missingUpscaleInitialImage": "Missing initial image for upscaling", + "missingUpscaleModel": "Missing upscale model", + "missingTileControlNetModel": "No valid tile ControlNet models installed" }, "ui": { "tabs": { diff --git a/invokeai/frontend/web/src/common/hooks/useIsReadyToEnqueue.ts b/invokeai/frontend/web/src/common/hooks/useIsReadyToEnqueue.ts index 9c465bb3cc..ba2117f207 100644 --- a/invokeai/frontend/web/src/common/hooks/useIsReadyToEnqueue.ts +++ b/invokeai/frontend/web/src/common/hooks/useIsReadyToEnqueue.ts @@ -208,14 +208,13 @@ const createSelector = (templates: Templates) => }); } else if (activeTabName === 'upscaling') { if (!upscale.upscaleInitialImage) { - reasons.push({ content: 'No Initial image' }); + reasons.push({ content: i18n.t('upscaling.missingUpscaleInitialImage') }); } if (!upscale.upscaleModel) { - reasons.push({ content: 'No upscale model selected' }); + reasons.push({ content: i18n.t('upscaling.missingUpscaleModel') }); } - if (!upscale.tileControlnetModel) { - reasons.push({ content: 'No valid tile controlnet available' }); + reasons.push({ content: i18n.t('upscaling.missingTileControlNetModel') }); } } else { // Handling for all other tabs diff --git a/invokeai/frontend/web/src/features/settingsAccordions/components/UpscaleSettingsAccordion/MultidiffusionWarning.tsx b/invokeai/frontend/web/src/features/settingsAccordions/components/UpscaleSettingsAccordion/MultidiffusionWarning.tsx index 84b8432aec..f3e2aa6604 100644 --- a/invokeai/frontend/web/src/features/settingsAccordions/components/UpscaleSettingsAccordion/MultidiffusionWarning.tsx +++ b/invokeai/frontend/web/src/features/settingsAccordions/components/UpscaleSettingsAccordion/MultidiffusionWarning.tsx @@ -1,10 +1,10 @@ -import { Flex, Link, Text } from '@invoke-ai/ui-library'; +import { Button, Flex, ListItem, Text, UnorderedList } from '@invoke-ai/ui-library'; import { useAppDispatch, useAppSelector } from 'app/store/storeHooks'; +import { $installModelsTab } from 'features/modelManagerV2/subpanels/InstallModels'; import { tileControlnetModelChanged } from 'features/parameters/store/upscaleSlice'; -import { MODEL_TYPE_SHORT_MAP } from 'features/parameters/types/constants'; import { setActiveTab } from 'features/ui/store/uiSlice'; import { useCallback, useEffect, useMemo } from 'react'; -import { useTranslation } from 'react-i18next'; +import { Trans, useTranslation } from 'react-i18next'; import { useControlNetModels } from 'services/api/hooks/modelsByType'; export const MultidiffusionWarning = () => { @@ -23,38 +23,46 @@ export const MultidiffusionWarning = () => { dispatch(tileControlnetModelChanged(validModel || null)); }, [model?.base, modelConfigs, dispatch]); - const warningText = useMemo(() => { + const warnings = useMemo(() => { + const _warnings: string[] = []; if (!model) { - return t('upscaling.warningNoMainModel'); - } - if (!upscaleModel && !tileControlnetModel) { - return t('upscaling.warningNoTileOrUpscaleModel', { base_model: MODEL_TYPE_SHORT_MAP[model.base] }); - } - if (!upscaleModel) { - return t('upscaling.warningNoUpscaleModel'); + _warnings.push(t('upscaling.mainModelDesc')); } if (!tileControlnetModel) { - return t('upscaling.warningNoTile', { base_model: MODEL_TYPE_SHORT_MAP[model.base] }); + _warnings.push(t('upscaling.tileControlNetModelDesc')); } + if (!upscaleModel) { + _warnings.push(t('upscaling.upscaleModelDesc')); + } + return _warnings; }, [model, upscaleModel, tileControlnetModel, t]); const handleGoToModelManager = useCallback(() => { dispatch(setActiveTab('models')); + $installModelsTab.set(3); }, [dispatch]); - if (!warningText || isLoading || !shouldShowButton) { - return <>; + if (!warnings.length || isLoading || !shouldShowButton) { + return null; } return ( - - - {t('upscaling.visit')}{' '} - - {t('modelManager.modelManager')} - {' '} - {t('upscaling.toInstall')} {warningText}. + + + + ), + }} + /> + + {warnings.map((warning) => ( + {warning} + ))} + ); };