mirror of
https://github.com/invoke-ai/InvokeAI
synced 2024-08-30 20:32:17 +00:00
updated upscale warning to work for simple upscale
This commit is contained in:
parent
154e8f6e78
commit
bc1d9748ce
@ -12,6 +12,7 @@ import { upscaleRequested } from 'app/store/middleware/listenerMiddleware/listen
|
|||||||
import { useAppDispatch } from 'app/store/storeHooks';
|
import { useAppDispatch } from 'app/store/storeHooks';
|
||||||
import { useIsAllowedToUpscale } from 'features/parameters/hooks/useIsAllowedToUpscale';
|
import { useIsAllowedToUpscale } from 'features/parameters/hooks/useIsAllowedToUpscale';
|
||||||
import { useIsQueueMutationInProgress } from 'features/queue/hooks/useIsQueueMutationInProgress';
|
import { useIsQueueMutationInProgress } from 'features/queue/hooks/useIsQueueMutationInProgress';
|
||||||
|
import { UpscaleWarning } from 'features/settingsAccordions/components/UpscaleSettingsAccordion/UpscaleWarning';
|
||||||
import { memo, useCallback } from 'react';
|
import { memo, useCallback } from 'react';
|
||||||
import { useTranslation } from 'react-i18next';
|
import { useTranslation } from 'react-i18next';
|
||||||
import { PiFrameCornersBold } from 'react-icons/pi';
|
import { PiFrameCornersBold } from 'react-icons/pi';
|
||||||
@ -51,6 +52,7 @@ const ParamUpscalePopover = (props: Props) => {
|
|||||||
<PopoverBody minW={96}>
|
<PopoverBody minW={96}>
|
||||||
<Flex flexDirection="column" gap={4}>
|
<Flex flexDirection="column" gap={4}>
|
||||||
<ParamESRGANModel />
|
<ParamESRGANModel />
|
||||||
|
<UpscaleWarning usesTile={false} />
|
||||||
<Button
|
<Button
|
||||||
tooltip={detail}
|
tooltip={detail}
|
||||||
size="sm"
|
size="sm"
|
||||||
|
@ -11,8 +11,8 @@ import { useStandaloneAccordionToggle } from 'features/settingsAccordions/hooks/
|
|||||||
import { memo } from 'react';
|
import { memo } from 'react';
|
||||||
import { useTranslation } from 'react-i18next';
|
import { useTranslation } from 'react-i18next';
|
||||||
|
|
||||||
import { MultidiffusionWarning } from './MultidiffusionWarning';
|
|
||||||
import { UpscaleInitialImage } from './UpscaleInitialImage';
|
import { UpscaleInitialImage } from './UpscaleInitialImage';
|
||||||
|
import { UpscaleWarning } from './UpscaleWarning';
|
||||||
|
|
||||||
const selector = createMemoizedSelector([selectUpscalelice], (upscaleSlice) => {
|
const selector = createMemoizedSelector([selectUpscalelice], (upscaleSlice) => {
|
||||||
const { upscaleModel, upscaleInitialImage, scale } = upscaleSlice;
|
const { upscaleModel, upscaleInitialImage, scale } = upscaleSlice;
|
||||||
@ -58,7 +58,7 @@ export const UpscaleSettingsAccordion = memo(() => {
|
|||||||
<UpscaleScaleSlider />
|
<UpscaleScaleSlider />
|
||||||
</Flex>
|
</Flex>
|
||||||
</Flex>
|
</Flex>
|
||||||
<MultidiffusionWarning />
|
<UpscaleWarning usesTile={true} />
|
||||||
</Flex>
|
</Flex>
|
||||||
<Expander label={t('accordions.advanced.options')} isOpen={isOpenExpander} onToggle={onToggleExpander}>
|
<Expander label={t('accordions.advanced.options')} isOpen={isOpenExpander} onToggle={onToggleExpander}>
|
||||||
<Flex gap={4} pb={4} flexDir="column">
|
<Flex gap={4} pb={4} flexDir="column">
|
||||||
|
@ -7,7 +7,11 @@ import { useCallback, useEffect, useMemo } from 'react';
|
|||||||
import { Trans, useTranslation } from 'react-i18next';
|
import { Trans, useTranslation } from 'react-i18next';
|
||||||
import { useControlNetModels } from 'services/api/hooks/modelsByType';
|
import { useControlNetModels } from 'services/api/hooks/modelsByType';
|
||||||
|
|
||||||
export const MultidiffusionWarning = () => {
|
interface Props {
|
||||||
|
usesTile: boolean;
|
||||||
|
}
|
||||||
|
|
||||||
|
export const UpscaleWarning = ({ usesTile }: Props) => {
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
const model = useAppSelector((s) => s.generation.model);
|
const model = useAppSelector((s) => s.generation.model);
|
||||||
const { tileControlnetModel, upscaleModel } = useAppSelector((s) => s.upscale);
|
const { tileControlnetModel, upscaleModel } = useAppSelector((s) => s.upscale);
|
||||||
@ -28,14 +32,14 @@ export const MultidiffusionWarning = () => {
|
|||||||
if (!model) {
|
if (!model) {
|
||||||
_warnings.push(t('upscaling.mainModelDesc'));
|
_warnings.push(t('upscaling.mainModelDesc'));
|
||||||
}
|
}
|
||||||
if (!tileControlnetModel) {
|
if (!tileControlnetModel && usesTile) {
|
||||||
_warnings.push(t('upscaling.tileControlNetModelDesc'));
|
_warnings.push(t('upscaling.tileControlNetModelDesc'));
|
||||||
}
|
}
|
||||||
if (!upscaleModel) {
|
if (!upscaleModel) {
|
||||||
_warnings.push(t('upscaling.upscaleModelDesc'));
|
_warnings.push(t('upscaling.upscaleModelDesc'));
|
||||||
}
|
}
|
||||||
return _warnings;
|
return _warnings;
|
||||||
}, [model, upscaleModel, tileControlnetModel, t]);
|
}, [model, upscaleModel, tileControlnetModel, usesTile, t]);
|
||||||
|
|
||||||
const handleGoToModelManager = useCallback(() => {
|
const handleGoToModelManager = useCallback(() => {
|
||||||
dispatch(setActiveTab('models'));
|
dispatch(setActiveTab('models'));
|
Loading…
Reference in New Issue
Block a user