add ability to disable lora, ti, dynamic prompts, vae selection

This commit is contained in:
Mary Hipp
2023-07-07 11:13:42 -04:00
parent 2cbe98b1b1
commit 888c47d37b
11 changed files with 74 additions and 41 deletions

View File

@ -1,19 +0,0 @@
import { Box, Flex } from '@chakra-ui/react';
import ModelSelect from 'features/system/components/ModelSelect';
import VAESelect from 'features/system/components/VAESelect';
import { memo } from 'react';
const ParamModelandVAE = () => {
return (
<Flex gap={3} w="full">
<Box w="full">
<ModelSelect />
</Box>
<Box w="full">
<VAESelect />
</Box>
</Flex>
);
};
export default memo(ParamModelandVAE);

View File

@ -0,0 +1,31 @@
import { Box, Flex } from '@chakra-ui/react';
import ModelSelect from 'features/system/components/ModelSelect';
import VAESelect from 'features/system/components/VAESelect';
import { memo } from 'react';
import { useFeatureStatus } from '../../../../system/hooks/useFeatureStatus';
import ParamScheduler from './ParamScheduler';
const ParamModelandVAEandScheduler = () => {
const isVaeEnabled = useFeatureStatus('vae').isFeatureEnabled;
return (
<Flex gap={3} w="full" flexWrap={isVaeEnabled ? 'wrap' : 'nowrap'}>
<Flex gap={3} w="full">
<Box w="full">
<ModelSelect />
</Box>
{isVaeEnabled && (
<Box w="full">
<VAESelect />
</Box>
)}
</Flex>
<Box w="full">
<ParamScheduler />
</Box>
</Flex>
);
};
export default memo(ParamModelandVAEandScheduler);

View File

@ -8,6 +8,7 @@ import { setNegativePrompt } from 'features/parameters/store/generationSlice';
import { ChangeEvent, KeyboardEvent, useCallback, useRef } from 'react';
import { flushSync } from 'react-dom';
import { useTranslation } from 'react-i18next';
import { useFeatureStatus } from '../../../../system/hooks/useFeatureStatus';
const ParamNegativeConditioning = () => {
const negativePrompt = useAppSelector(
@ -71,6 +72,8 @@ const ParamNegativeConditioning = () => {
[dispatch, onClose, negativePrompt]
);
const isTiEmbeddingEnabled = useFeatureStatus('tiEmbedding').isFeatureEnabled;
return (
<FormControl>
<ParamEmbeddingPopover
@ -85,13 +88,13 @@ const ParamNegativeConditioning = () => {
value={negativePrompt}
placeholder={t('parameters.negativePromptPlaceholder')}
onChange={handleChangePrompt}
onKeyDown={handleKeyDown}
resize="vertical"
fontSize="sm"
minH={16}
{...(isTiEmbeddingEnabled && { onKeyDown: handleKeyDown })}
/>
</ParamEmbeddingPopover>
{!isOpen && (
{!isOpen && isTiEmbeddingEnabled && (
<Box
sx={{
position: 'absolute',

View File

@ -20,6 +20,7 @@ import { isEqual } from 'lodash-es';
import { flushSync } from 'react-dom';
import { useHotkeys } from 'react-hotkeys-hook';
import { useTranslation } from 'react-i18next';
import { useFeatureStatus } from '../../../../system/hooks/useFeatureStatus';
const promptInputSelector = createSelector(
[(state: RootState) => state.generation, activeTabNameSelector],
@ -114,6 +115,8 @@ const ParamPositiveConditioning = () => {
[isReady, dispatch, activeTabName, onOpen]
);
const isTiEmbeddingEnabled = useFeatureStatus('tiEmbedding').isFeatureEnabled;
// const handleSelect = (e: MouseEvent<HTMLTextAreaElement>) => {
// const target = e.target as HTMLTextAreaElement;
// setCaret({ start: target.selectionStart, end: target.selectionEnd });
@ -134,13 +137,13 @@ const ParamPositiveConditioning = () => {
value={prompt}
placeholder={t('parameters.positivePromptPlaceholder')}
onChange={handleChangePrompt}
onKeyDown={handleKeyDown}
resize="vertical"
minH={32}
{...(isTiEmbeddingEnabled && { onKeyDown: handleKeyDown })}
/>
</ParamEmbeddingPopover>
</FormControl>
{!isOpen && (
{!isOpen && isTiEmbeddingEnabled && (
<Box
sx={{
position: 'absolute',