mirror of
https://github.com/invoke-ai/InvokeAI
synced 2024-08-30 20:32:17 +00:00
feat(ui): add variant to model edit
Also simplify the layouting for all model view/edit components.
This commit is contained in:
parent
42a159beaa
commit
99e28da19b
@ -1,4 +1,4 @@
|
|||||||
import { Button, Flex, Heading, Text } from '@invoke-ai/ui-library';
|
import { Button, Flex, Heading, SimpleGrid, Text } from '@invoke-ai/ui-library';
|
||||||
import { useAppDispatch, useAppSelector } from 'app/store/storeHooks';
|
import { useAppDispatch, useAppSelector } from 'app/store/storeHooks';
|
||||||
import { useControlNetOrT2IAdapterDefaultSettings } from 'features/modelManagerV2/hooks/useControlNetOrT2IAdapterDefaultSettings';
|
import { useControlNetOrT2IAdapterDefaultSettings } from 'features/modelManagerV2/hooks/useControlNetOrT2IAdapterDefaultSettings';
|
||||||
import { DefaultPreprocessor } from 'features/modelManagerV2/subpanels/ModelPanel/ControlNetOrT2IAdapterDefaultSettings/DefaultPreprocessor';
|
import { DefaultPreprocessor } from 'features/modelManagerV2/subpanels/ModelPanel/ControlNetOrT2IAdapterDefaultSettings/DefaultPreprocessor';
|
||||||
@ -92,13 +92,9 @@ export const ControlNetOrT2IAdapterDefaultSettings = () => {
|
|||||||
</Button>
|
</Button>
|
||||||
</Flex>
|
</Flex>
|
||||||
|
|
||||||
<Flex flexDir="column" gap={8}>
|
<SimpleGrid columns={2} gap={8}>
|
||||||
<Flex gap={8}>
|
|
||||||
<Flex gap={4} w="full">
|
|
||||||
<DefaultPreprocessor control={control} name="preprocessor" />
|
<DefaultPreprocessor control={control} name="preprocessor" />
|
||||||
</Flex>
|
</SimpleGrid>
|
||||||
</Flex>
|
|
||||||
</Flex>
|
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import { Button, Flex, Heading, Text } from '@invoke-ai/ui-library';
|
import { Button, Flex, Heading, SimpleGrid, Text } from '@invoke-ai/ui-library';
|
||||||
import { useAppDispatch, useAppSelector } from 'app/store/storeHooks';
|
import { useAppDispatch, useAppSelector } from 'app/store/storeHooks';
|
||||||
import { useMainModelDefaultSettings } from 'features/modelManagerV2/hooks/useMainModelDefaultSettings';
|
import { useMainModelDefaultSettings } from 'features/modelManagerV2/hooks/useMainModelDefaultSettings';
|
||||||
import { DefaultHeight } from 'features/modelManagerV2/subpanels/ModelPanel/MainModelDefaultSettings/DefaultHeight';
|
import { DefaultHeight } from 'features/modelManagerV2/subpanels/ModelPanel/MainModelDefaultSettings/DefaultHeight';
|
||||||
@ -122,40 +122,16 @@ export const MainModelDefaultSettings = () => {
|
|||||||
</Button>
|
</Button>
|
||||||
</Flex>
|
</Flex>
|
||||||
|
|
||||||
<Flex flexDir="column" gap={8}>
|
<SimpleGrid columns={2} gap={8}>
|
||||||
<Flex gap={8}>
|
|
||||||
<Flex gap={4} w="full">
|
|
||||||
<DefaultVae control={control} name="vae" />
|
<DefaultVae control={control} name="vae" />
|
||||||
</Flex>
|
|
||||||
<Flex gap={4} w="full">
|
|
||||||
<DefaultVaePrecision control={control} name="vaePrecision" />
|
<DefaultVaePrecision control={control} name="vaePrecision" />
|
||||||
</Flex>
|
|
||||||
</Flex>
|
|
||||||
<Flex gap={8}>
|
|
||||||
<Flex gap={4} w="full">
|
|
||||||
<DefaultScheduler control={control} name="scheduler" />
|
<DefaultScheduler control={control} name="scheduler" />
|
||||||
</Flex>
|
|
||||||
<Flex gap={4} w="full">
|
|
||||||
<DefaultSteps control={control} name="steps" />
|
<DefaultSteps control={control} name="steps" />
|
||||||
</Flex>
|
|
||||||
</Flex>
|
|
||||||
<Flex gap={8}>
|
|
||||||
<Flex gap={4} w="full">
|
|
||||||
<DefaultCfgScale control={control} name="cfgScale" />
|
<DefaultCfgScale control={control} name="cfgScale" />
|
||||||
</Flex>
|
|
||||||
<Flex gap={4} w="full">
|
|
||||||
<DefaultCfgRescaleMultiplier control={control} name="cfgRescaleMultiplier" />
|
<DefaultCfgRescaleMultiplier control={control} name="cfgRescaleMultiplier" />
|
||||||
</Flex>
|
|
||||||
</Flex>
|
|
||||||
<Flex gap={8}>
|
|
||||||
<Flex gap={4} w="full">
|
|
||||||
<DefaultWidth control={control} optimalDimension={optimalDimension} />
|
<DefaultWidth control={control} optimalDimension={optimalDimension} />
|
||||||
</Flex>
|
|
||||||
<Flex gap={4} w="full">
|
|
||||||
<DefaultHeight control={control} optimalDimension={optimalDimension} />
|
<DefaultHeight control={control} optimalDimension={optimalDimension} />
|
||||||
</Flex>
|
</SimpleGrid>
|
||||||
</Flex>
|
|
||||||
</Flex>
|
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
@ -6,6 +6,7 @@ import {
|
|||||||
FormLabel,
|
FormLabel,
|
||||||
Heading,
|
Heading,
|
||||||
Input,
|
Input,
|
||||||
|
SimpleGrid,
|
||||||
Text,
|
Text,
|
||||||
Textarea,
|
Textarea,
|
||||||
} from '@invoke-ai/ui-library';
|
} from '@invoke-ai/ui-library';
|
||||||
@ -66,25 +67,21 @@ export const ModelEdit = ({ form }: Props) => {
|
|||||||
<Heading as="h3" fontSize="md" mt="4">
|
<Heading as="h3" fontSize="md" mt="4">
|
||||||
{t('modelManager.modelSettings')}
|
{t('modelManager.modelSettings')}
|
||||||
</Heading>
|
</Heading>
|
||||||
<Flex gap={4}>
|
<SimpleGrid columns={2} gap={4}>
|
||||||
<FormControl flexDir="column" alignItems="flex-start" gap={1}>
|
<FormControl flexDir="column" alignItems="flex-start" gap={1}>
|
||||||
<FormLabel>{t('modelManager.baseModel')}</FormLabel>
|
<FormLabel>{t('modelManager.baseModel')}</FormLabel>
|
||||||
<BaseModelSelect control={form.control} />
|
<BaseModelSelect control={form.control} />
|
||||||
</FormControl>
|
</FormControl>
|
||||||
</Flex>
|
|
||||||
{data.type === 'main' && data.format === 'checkpoint' && (
|
|
||||||
<>
|
|
||||||
<Flex gap={4}>
|
|
||||||
<FormControl flexDir="column" alignItems="flex-start" gap={1}>
|
|
||||||
<FormLabel>{t('modelManager.pathToConfig')}</FormLabel>
|
|
||||||
<Input {...form.register('config_path', stringFieldOptions)} />
|
|
||||||
</FormControl>
|
|
||||||
<FormControl flexDir="column" alignItems="flex-start" gap={1}>
|
<FormControl flexDir="column" alignItems="flex-start" gap={1}>
|
||||||
<FormLabel>{t('modelManager.variant')}</FormLabel>
|
<FormLabel>{t('modelManager.variant')}</FormLabel>
|
||||||
<ModelVariantSelect control={form.control} />
|
<ModelVariantSelect control={form.control} />
|
||||||
</FormControl>
|
</FormControl>
|
||||||
</Flex>
|
{data.type === 'main' && data.format === 'checkpoint' && (
|
||||||
<Flex gap={4}>
|
<>
|
||||||
|
<FormControl flexDir="column" alignItems="flex-start" gap={1}>
|
||||||
|
<FormLabel>{t('modelManager.pathToConfig')}</FormLabel>
|
||||||
|
<Input {...form.register('config_path', stringFieldOptions)} />
|
||||||
|
</FormControl>
|
||||||
<FormControl flexDir="column" alignItems="flex-start" gap={1}>
|
<FormControl flexDir="column" alignItems="flex-start" gap={1}>
|
||||||
<FormLabel>{t('modelManager.predictionType')}</FormLabel>
|
<FormLabel>{t('modelManager.predictionType')}</FormLabel>
|
||||||
<PredictionTypeSelect control={form.control} />
|
<PredictionTypeSelect control={form.control} />
|
||||||
@ -93,9 +90,9 @@ export const ModelEdit = ({ form }: Props) => {
|
|||||||
<FormLabel>{t('modelManager.upcastAttention')}</FormLabel>
|
<FormLabel>{t('modelManager.upcastAttention')}</FormLabel>
|
||||||
<Checkbox {...form.register('upcast_attention')} />
|
<Checkbox {...form.register('upcast_attention')} />
|
||||||
</FormControl>
|
</FormControl>
|
||||||
</Flex>
|
|
||||||
</>
|
</>
|
||||||
)}
|
)}
|
||||||
|
</SimpleGrid>
|
||||||
</Flex>
|
</Flex>
|
||||||
</form>
|
</form>
|
||||||
</Flex>
|
</Flex>
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import { Box, Flex, Text } from '@invoke-ai/ui-library';
|
import { Box, Flex, SimpleGrid, Text } from '@invoke-ai/ui-library';
|
||||||
import { skipToken } from '@reduxjs/toolkit/query';
|
import { skipToken } from '@reduxjs/toolkit/query';
|
||||||
import { useAppSelector } from 'app/store/storeHooks';
|
import { useAppSelector } from 'app/store/storeHooks';
|
||||||
import { ControlNetOrT2IAdapterDefaultSettings } from 'features/modelManagerV2/subpanels/ModelPanel/ControlNetOrT2IAdapterDefaultSettings/ControlNetOrT2IAdapterDefaultSettings';
|
import { ControlNetOrT2IAdapterDefaultSettings } from 'features/modelManagerV2/subpanels/ModelPanel/ControlNetOrT2IAdapterDefaultSettings/ControlNetOrT2IAdapterDefaultSettings';
|
||||||
@ -24,57 +24,32 @@ export const ModelView = () => {
|
|||||||
return (
|
return (
|
||||||
<Flex flexDir="column" h="full" gap={4}>
|
<Flex flexDir="column" h="full" gap={4}>
|
||||||
<Box layerStyle="second" borderRadius="base" p={4}>
|
<Box layerStyle="second" borderRadius="base" p={4}>
|
||||||
<Flex flexDir="column" gap={4}>
|
<SimpleGrid columns={2} gap={4}>
|
||||||
<Flex gap={2}>
|
|
||||||
<ModelAttrView label={t('modelManager.baseModel')} value={data.base} />
|
<ModelAttrView label={t('modelManager.baseModel')} value={data.base} />
|
||||||
<ModelAttrView label={t('modelManager.modelType')} value={data.type} />
|
<ModelAttrView label={t('modelManager.modelType')} value={data.type} />
|
||||||
</Flex>
|
|
||||||
<Flex gap={2}>
|
|
||||||
<ModelAttrView label={t('common.format')} value={data.format} />
|
<ModelAttrView label={t('common.format')} value={data.format} />
|
||||||
<ModelAttrView label={t('modelManager.path')} value={data.path} />
|
<ModelAttrView label={t('modelManager.path')} value={data.path} />
|
||||||
</Flex>
|
{data.type === 'main' && <ModelAttrView label={t('modelManager.variant')} value={data.variant} />}
|
||||||
|
|
||||||
{data.type === 'main' && data.format === 'diffusers' && data.repo_variant && (
|
{data.type === 'main' && data.format === 'diffusers' && data.repo_variant && (
|
||||||
<Flex gap={2}>
|
|
||||||
<ModelAttrView label={t('modelManager.repoVariant')} value={data.repo_variant} />
|
<ModelAttrView label={t('modelManager.repoVariant')} value={data.repo_variant} />
|
||||||
</Flex>
|
|
||||||
)}
|
)}
|
||||||
|
|
||||||
{data.type === 'main' && data.format === 'checkpoint' && (
|
{data.type === 'main' && data.format === 'checkpoint' && (
|
||||||
<>
|
<>
|
||||||
<Flex gap={2}>
|
|
||||||
<ModelAttrView label={t('modelManager.pathToConfig')} value={data.config_path} />
|
<ModelAttrView label={t('modelManager.pathToConfig')} value={data.config_path} />
|
||||||
<ModelAttrView label={t('modelManager.variant')} value={data.variant} />
|
|
||||||
</Flex>
|
|
||||||
<Flex gap={2}>
|
|
||||||
<ModelAttrView label={t('modelManager.predictionType')} value={data.prediction_type} />
|
<ModelAttrView label={t('modelManager.predictionType')} value={data.prediction_type} />
|
||||||
<ModelAttrView label={t('modelManager.upcastAttention')} value={`${data.upcast_attention}`} />
|
<ModelAttrView label={t('modelManager.upcastAttention')} value={`${data.upcast_attention}`} />
|
||||||
</Flex>
|
|
||||||
</>
|
</>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
{data.type === 'ip_adapter' && data.format === 'invokeai' && (
|
{data.type === 'ip_adapter' && data.format === 'invokeai' && (
|
||||||
<Flex gap={2}>
|
|
||||||
<ModelAttrView label={t('modelManager.imageEncoderModelId')} value={data.image_encoder_model_id} />
|
<ModelAttrView label={t('modelManager.imageEncoderModelId')} value={data.image_encoder_model_id} />
|
||||||
</Flex>
|
|
||||||
)}
|
)}
|
||||||
</Flex>
|
</SimpleGrid>
|
||||||
</Box>
|
</Box>
|
||||||
{data.type === 'main' && data.base !== 'sdxl-refiner' && (
|
|
||||||
<Box layerStyle="second" borderRadius="base" p={4}>
|
<Box layerStyle="second" borderRadius="base" p={4}>
|
||||||
<MainModelDefaultSettings />
|
{data.type === 'main' && data.base !== 'sdxl-refiner' && <MainModelDefaultSettings />}
|
||||||
|
{(data.type === 'controlnet' || data.type === 't2i_adapter') && <ControlNetOrT2IAdapterDefaultSettings />}
|
||||||
|
{(data.type === 'main' || data.type === 'lora') && <TriggerPhrases />}
|
||||||
</Box>
|
</Box>
|
||||||
)}
|
|
||||||
{(data.type === 'controlnet' || data.type === 't2i_adapter') && (
|
|
||||||
<Box layerStyle="second" borderRadius="base" p={4}>
|
|
||||||
<ControlNetOrT2IAdapterDefaultSettings />
|
|
||||||
</Box>
|
|
||||||
)}
|
|
||||||
{(data.type === 'main' || data.type === 'lora') && (
|
|
||||||
<Box layerStyle="second" borderRadius="base" p={4}>
|
|
||||||
<TriggerPhrases />
|
|
||||||
</Box>
|
|
||||||
)}
|
|
||||||
</Flex>
|
</Flex>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user