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 { useIsAllowedToUpscale } from 'features/parameters/hooks/useIsAllowedToUpscale';
|
||||
import { useIsQueueMutationInProgress } from 'features/queue/hooks/useIsQueueMutationInProgress';
|
||||
import { UpscaleWarning } from 'features/settingsAccordions/components/UpscaleSettingsAccordion/UpscaleWarning';
|
||||
import { memo, useCallback } from 'react';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import { PiFrameCornersBold } from 'react-icons/pi';
|
||||
@ -51,6 +52,7 @@ const ParamUpscalePopover = (props: Props) => {
|
||||
<PopoverBody minW={96}>
|
||||
<Flex flexDirection="column" gap={4}>
|
||||
<ParamESRGANModel />
|
||||
<UpscaleWarning usesTile={false} />
|
||||
<Button
|
||||
tooltip={detail}
|
||||
size="sm"
|
||||
|
@ -11,8 +11,8 @@ import { useStandaloneAccordionToggle } from 'features/settingsAccordions/hooks/
|
||||
import { memo } from 'react';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
|
||||
import { MultidiffusionWarning } from './MultidiffusionWarning';
|
||||
import { UpscaleInitialImage } from './UpscaleInitialImage';
|
||||
import { UpscaleWarning } from './UpscaleWarning';
|
||||
|
||||
const selector = createMemoizedSelector([selectUpscalelice], (upscaleSlice) => {
|
||||
const { upscaleModel, upscaleInitialImage, scale } = upscaleSlice;
|
||||
@ -58,7 +58,7 @@ export const UpscaleSettingsAccordion = memo(() => {
|
||||
<UpscaleScaleSlider />
|
||||
</Flex>
|
||||
</Flex>
|
||||
<MultidiffusionWarning />
|
||||
<UpscaleWarning usesTile={true} />
|
||||
</Flex>
|
||||
<Expander label={t('accordions.advanced.options')} isOpen={isOpenExpander} onToggle={onToggleExpander}>
|
||||
<Flex gap={4} pb={4} flexDir="column">
|
||||
|
@ -7,7 +7,11 @@ import { useCallback, useEffect, useMemo } from 'react';
|
||||
import { Trans, useTranslation } from 'react-i18next';
|
||||
import { useControlNetModels } from 'services/api/hooks/modelsByType';
|
||||
|
||||
export const MultidiffusionWarning = () => {
|
||||
interface Props {
|
||||
usesTile: boolean;
|
||||
}
|
||||
|
||||
export const UpscaleWarning = ({ usesTile }: Props) => {
|
||||
const { t } = useTranslation();
|
||||
const model = useAppSelector((s) => s.generation.model);
|
||||
const { tileControlnetModel, upscaleModel } = useAppSelector((s) => s.upscale);
|
||||
@ -28,14 +32,14 @@ export const MultidiffusionWarning = () => {
|
||||
if (!model) {
|
||||
_warnings.push(t('upscaling.mainModelDesc'));
|
||||
}
|
||||
if (!tileControlnetModel) {
|
||||
if (!tileControlnetModel && usesTile) {
|
||||
_warnings.push(t('upscaling.tileControlNetModelDesc'));
|
||||
}
|
||||
if (!upscaleModel) {
|
||||
_warnings.push(t('upscaling.upscaleModelDesc'));
|
||||
}
|
||||
return _warnings;
|
||||
}, [model, upscaleModel, tileControlnetModel, t]);
|
||||
}, [model, upscaleModel, tileControlnetModel, usesTile, t]);
|
||||
|
||||
const handleGoToModelManager = useCallback(() => {
|
||||
dispatch(setActiveTab('models'));
|
Loading…
Reference in New Issue
Block a user