mirror of
https://github.com/invoke-ai/InvokeAI.git
synced 2026-02-08 12:35:03 -05:00
Control adapters logic/state/ui is now generalized to hold controlnet, ip_adapter and t2i_adapter. In the future, other control adapter types can be added. TODO: - Limit IP adapter to 1 - Add T2I adapter to linear graphs - Fix autoprocess - T2I metadata saving & recall - Improve on control adapters UI
51 lines
1.2 KiB
TypeScript
51 lines
1.2 KiB
TypeScript
import { ListItem, Text, UnorderedList } from '@chakra-ui/react';
|
|
import { some } from 'lodash-es';
|
|
import { memo } from 'react';
|
|
import { useTranslation } from 'react-i18next';
|
|
import { ImageUsage } from '../store/types';
|
|
|
|
type Props = {
|
|
imageUsage?: ImageUsage;
|
|
topMessage?: string;
|
|
bottomMessage?: string;
|
|
};
|
|
const ImageUsageMessage = (props: Props) => {
|
|
const { t } = useTranslation();
|
|
const {
|
|
imageUsage,
|
|
topMessage = t('gallery.currentlyInUse'),
|
|
bottomMessage = t('gallery.featuresWillReset'),
|
|
} = props;
|
|
|
|
if (!imageUsage) {
|
|
return null;
|
|
}
|
|
|
|
if (!some(imageUsage)) {
|
|
return null;
|
|
}
|
|
|
|
return (
|
|
<>
|
|
<Text>{topMessage}</Text>
|
|
<UnorderedList sx={{ paddingInlineStart: 6 }}>
|
|
{imageUsage.isInitialImage && (
|
|
<ListItem>{t('common.img2img')}</ListItem>
|
|
)}
|
|
{imageUsage.isCanvasImage && (
|
|
<ListItem>{t('common.unifiedCanvas')}</ListItem>
|
|
)}
|
|
{imageUsage.isControlImage && (
|
|
<ListItem>{t('common.controlNet')}</ListItem>
|
|
)}
|
|
{imageUsage.isNodesImage && (
|
|
<ListItem>{t('common.nodeEditor')}</ListItem>
|
|
)}
|
|
</UnorderedList>
|
|
<Text>{bottomMessage}</Text>
|
|
</>
|
|
);
|
|
};
|
|
|
|
export default memo(ImageUsageMessage);
|