mirror of
https://github.com/invoke-ai/InvokeAI
synced 2024-08-30 20:32:17 +00:00
add ability to disable lora, ti, dynamic prompts, vae selection (#3677)
This commit is contained in:
commit
bdbdcabcdf
@ -93,7 +93,8 @@ export type AppFeature =
|
|||||||
| 'discordLink'
|
| 'discordLink'
|
||||||
| 'bugLink'
|
| 'bugLink'
|
||||||
| 'localization'
|
| 'localization'
|
||||||
| 'consoleLogging';
|
| 'consoleLogging'
|
||||||
|
| 'dynamicPrompting';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A disable-able Stable Diffusion feature
|
* A disable-able Stable Diffusion feature
|
||||||
@ -104,7 +105,10 @@ export type SDFeature =
|
|||||||
| 'variation'
|
| 'variation'
|
||||||
| 'symmetry'
|
| 'symmetry'
|
||||||
| 'seamless'
|
| 'seamless'
|
||||||
| 'hires';
|
| 'hires'
|
||||||
|
| 'lora'
|
||||||
|
| 'embedding'
|
||||||
|
| 'vae';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Configuration options for the InvokeAI UI.
|
* Configuration options for the InvokeAI UI.
|
||||||
|
@ -7,6 +7,7 @@ import IAICollapse from 'common/components/IAICollapse';
|
|||||||
import ParamDynamicPromptsCombinatorial from './ParamDynamicPromptsCombinatorial';
|
import ParamDynamicPromptsCombinatorial from './ParamDynamicPromptsCombinatorial';
|
||||||
import ParamDynamicPromptsToggle from './ParamDynamicPromptsEnabled';
|
import ParamDynamicPromptsToggle from './ParamDynamicPromptsEnabled';
|
||||||
import ParamDynamicPromptsMaxPrompts from './ParamDynamicPromptsMaxPrompts';
|
import ParamDynamicPromptsMaxPrompts from './ParamDynamicPromptsMaxPrompts';
|
||||||
|
import { useFeatureStatus } from '../../system/hooks/useFeatureStatus';
|
||||||
|
|
||||||
const selector = createSelector(
|
const selector = createSelector(
|
||||||
stateSelector,
|
stateSelector,
|
||||||
@ -21,6 +22,13 @@ const selector = createSelector(
|
|||||||
const ParamDynamicPromptsCollapse = () => {
|
const ParamDynamicPromptsCollapse = () => {
|
||||||
const { activeLabel } = useAppSelector(selector);
|
const { activeLabel } = useAppSelector(selector);
|
||||||
|
|
||||||
|
const isDynamicPromptingEnabled =
|
||||||
|
useFeatureStatus('dynamicPrompting').isFeatureEnabled;
|
||||||
|
|
||||||
|
if (!isDynamicPromptingEnabled) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<IAICollapse label="Dynamic Prompts" activeLabel={activeLabel}>
|
<IAICollapse label="Dynamic Prompts" activeLabel={activeLabel}>
|
||||||
<Flex sx={{ gap: 2, flexDir: 'column' }}>
|
<Flex sx={{ gap: 2, flexDir: 'column' }}>
|
||||||
|
@ -8,6 +8,7 @@ import { size } from 'lodash-es';
|
|||||||
import { memo } from 'react';
|
import { memo } from 'react';
|
||||||
import ParamLoraList from './ParamLoraList';
|
import ParamLoraList from './ParamLoraList';
|
||||||
import ParamLoraSelect from './ParamLoraSelect';
|
import ParamLoraSelect from './ParamLoraSelect';
|
||||||
|
import { useFeatureStatus } from '../../system/hooks/useFeatureStatus';
|
||||||
|
|
||||||
const selector = createSelector(
|
const selector = createSelector(
|
||||||
stateSelector,
|
stateSelector,
|
||||||
@ -23,6 +24,12 @@ const selector = createSelector(
|
|||||||
const ParamLoraCollapse = () => {
|
const ParamLoraCollapse = () => {
|
||||||
const { activeLabel } = useAppSelector(selector);
|
const { activeLabel } = useAppSelector(selector);
|
||||||
|
|
||||||
|
const isLoraEnabled = useFeatureStatus('lora').isFeatureEnabled;
|
||||||
|
|
||||||
|
if (!isLoraEnabled) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<IAICollapse label={'LoRA'} activeLabel={activeLabel}>
|
<IAICollapse label={'LoRA'} activeLabel={activeLabel}>
|
||||||
<Flex sx={{ flexDir: 'column', gap: 2 }}>
|
<Flex sx={{ flexDir: 'column', gap: 2 }}>
|
||||||
|
@ -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);
|
|
@ -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);
|
@ -8,6 +8,7 @@ import { setNegativePrompt } from 'features/parameters/store/generationSlice';
|
|||||||
import { ChangeEvent, KeyboardEvent, useCallback, useRef } from 'react';
|
import { ChangeEvent, KeyboardEvent, useCallback, useRef } from 'react';
|
||||||
import { flushSync } from 'react-dom';
|
import { flushSync } from 'react-dom';
|
||||||
import { useTranslation } from 'react-i18next';
|
import { useTranslation } from 'react-i18next';
|
||||||
|
import { useFeatureStatus } from '../../../../system/hooks/useFeatureStatus';
|
||||||
|
|
||||||
const ParamNegativeConditioning = () => {
|
const ParamNegativeConditioning = () => {
|
||||||
const negativePrompt = useAppSelector(
|
const negativePrompt = useAppSelector(
|
||||||
@ -71,6 +72,8 @@ const ParamNegativeConditioning = () => {
|
|||||||
[dispatch, onClose, negativePrompt]
|
[dispatch, onClose, negativePrompt]
|
||||||
);
|
);
|
||||||
|
|
||||||
|
const isEmbeddingEnabled = useFeatureStatus('embedding').isFeatureEnabled;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<FormControl>
|
<FormControl>
|
||||||
<ParamEmbeddingPopover
|
<ParamEmbeddingPopover
|
||||||
@ -85,13 +88,13 @@ const ParamNegativeConditioning = () => {
|
|||||||
value={negativePrompt}
|
value={negativePrompt}
|
||||||
placeholder={t('parameters.negativePromptPlaceholder')}
|
placeholder={t('parameters.negativePromptPlaceholder')}
|
||||||
onChange={handleChangePrompt}
|
onChange={handleChangePrompt}
|
||||||
onKeyDown={handleKeyDown}
|
|
||||||
resize="vertical"
|
resize="vertical"
|
||||||
fontSize="sm"
|
fontSize="sm"
|
||||||
minH={16}
|
minH={16}
|
||||||
|
{...(isEmbeddingEnabled && { onKeyDown: handleKeyDown })}
|
||||||
/>
|
/>
|
||||||
</ParamEmbeddingPopover>
|
</ParamEmbeddingPopover>
|
||||||
{!isOpen && (
|
{!isOpen && isEmbeddingEnabled && (
|
||||||
<Box
|
<Box
|
||||||
sx={{
|
sx={{
|
||||||
position: 'absolute',
|
position: 'absolute',
|
||||||
|
@ -19,6 +19,7 @@ import { isEqual } from 'lodash-es';
|
|||||||
import { flushSync } from 'react-dom';
|
import { flushSync } from 'react-dom';
|
||||||
import { useHotkeys } from 'react-hotkeys-hook';
|
import { useHotkeys } from 'react-hotkeys-hook';
|
||||||
import { useTranslation } from 'react-i18next';
|
import { useTranslation } from 'react-i18next';
|
||||||
|
import { useFeatureStatus } from '../../../../system/hooks/useFeatureStatus';
|
||||||
|
|
||||||
const promptInputSelector = createSelector(
|
const promptInputSelector = createSelector(
|
||||||
[stateSelector, activeTabNameSelector],
|
[stateSelector, activeTabNameSelector],
|
||||||
@ -101,6 +102,8 @@ const ParamPositiveConditioning = () => {
|
|||||||
[dispatch, onClose, prompt]
|
[dispatch, onClose, prompt]
|
||||||
);
|
);
|
||||||
|
|
||||||
|
const isEmbeddingEnabled = useFeatureStatus('embedding').isFeatureEnabled;
|
||||||
|
|
||||||
const handleKeyDown = useCallback(
|
const handleKeyDown = useCallback(
|
||||||
(e: KeyboardEvent<HTMLTextAreaElement>) => {
|
(e: KeyboardEvent<HTMLTextAreaElement>) => {
|
||||||
if (e.key === 'Enter' && e.shiftKey === false && isReady) {
|
if (e.key === 'Enter' && e.shiftKey === false && isReady) {
|
||||||
@ -108,11 +111,11 @@ const ParamPositiveConditioning = () => {
|
|||||||
dispatch(clampSymmetrySteps());
|
dispatch(clampSymmetrySteps());
|
||||||
dispatch(userInvoked(activeTabName));
|
dispatch(userInvoked(activeTabName));
|
||||||
}
|
}
|
||||||
if (e.key === '<') {
|
if (isEmbeddingEnabled && e.key === '<') {
|
||||||
onOpen();
|
onOpen();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
[isReady, dispatch, activeTabName, onOpen]
|
[isReady, dispatch, activeTabName, onOpen, isEmbeddingEnabled]
|
||||||
);
|
);
|
||||||
|
|
||||||
// const handleSelect = (e: MouseEvent<HTMLTextAreaElement>) => {
|
// const handleSelect = (e: MouseEvent<HTMLTextAreaElement>) => {
|
||||||
@ -141,7 +144,7 @@ const ParamPositiveConditioning = () => {
|
|||||||
/>
|
/>
|
||||||
</ParamEmbeddingPopover>
|
</ParamEmbeddingPopover>
|
||||||
</FormControl>
|
</FormControl>
|
||||||
{!isOpen && (
|
{!isOpen && isEmbeddingEnabled && (
|
||||||
<Box
|
<Box
|
||||||
sx={{
|
sx={{
|
||||||
position: 'absolute',
|
position: 'absolute',
|
||||||
|
@ -6,8 +6,7 @@ import IAICollapse from 'common/components/IAICollapse';
|
|||||||
import ParamCFGScale from 'features/parameters/components/Parameters/Core/ParamCFGScale';
|
import ParamCFGScale from 'features/parameters/components/Parameters/Core/ParamCFGScale';
|
||||||
import ParamHeight from 'features/parameters/components/Parameters/Core/ParamHeight';
|
import ParamHeight from 'features/parameters/components/Parameters/Core/ParamHeight';
|
||||||
import ParamIterations from 'features/parameters/components/Parameters/Core/ParamIterations';
|
import ParamIterations from 'features/parameters/components/Parameters/Core/ParamIterations';
|
||||||
import ParamModelandVAE from 'features/parameters/components/Parameters/Core/ParamModelandVAE';
|
import ParamModelandVAEandScheduler from 'features/parameters/components/Parameters/Core/ParamModelandVAEandScheduler';
|
||||||
import ParamScheduler from 'features/parameters/components/Parameters/Core/ParamScheduler';
|
|
||||||
import ParamSteps from 'features/parameters/components/Parameters/Core/ParamSteps';
|
import ParamSteps from 'features/parameters/components/Parameters/Core/ParamSteps';
|
||||||
import ParamWidth from 'features/parameters/components/Parameters/Core/ParamWidth';
|
import ParamWidth from 'features/parameters/components/Parameters/Core/ParamWidth';
|
||||||
import ImageToImageFit from 'features/parameters/components/Parameters/ImageToImage/ImageToImageFit';
|
import ImageToImageFit from 'features/parameters/components/Parameters/ImageToImage/ImageToImageFit';
|
||||||
@ -48,7 +47,7 @@ const ImageToImageTabCoreParameters = () => {
|
|||||||
>
|
>
|
||||||
{shouldUseSliders ? (
|
{shouldUseSliders ? (
|
||||||
<>
|
<>
|
||||||
<ParamModelandVAE />
|
<ParamModelandVAEandScheduler />
|
||||||
<Box pt={2}>
|
<Box pt={2}>
|
||||||
<ParamSeedFull />
|
<ParamSeedFull />
|
||||||
</Box>
|
</Box>
|
||||||
@ -65,8 +64,7 @@ const ImageToImageTabCoreParameters = () => {
|
|||||||
<ParamSteps />
|
<ParamSteps />
|
||||||
<ParamCFGScale />
|
<ParamCFGScale />
|
||||||
</Flex>
|
</Flex>
|
||||||
<ParamModelandVAE />
|
<ParamModelandVAEandScheduler />
|
||||||
<ParamScheduler />
|
|
||||||
<Box pt={2}>
|
<Box pt={2}>
|
||||||
<ParamSeedFull />
|
<ParamSeedFull />
|
||||||
</Box>
|
</Box>
|
||||||
|
@ -7,8 +7,7 @@ import IAICollapse from 'common/components/IAICollapse';
|
|||||||
import ParamCFGScale from 'features/parameters/components/Parameters/Core/ParamCFGScale';
|
import ParamCFGScale from 'features/parameters/components/Parameters/Core/ParamCFGScale';
|
||||||
import ParamHeight from 'features/parameters/components/Parameters/Core/ParamHeight';
|
import ParamHeight from 'features/parameters/components/Parameters/Core/ParamHeight';
|
||||||
import ParamIterations from 'features/parameters/components/Parameters/Core/ParamIterations';
|
import ParamIterations from 'features/parameters/components/Parameters/Core/ParamIterations';
|
||||||
import ParamModelandVAE from 'features/parameters/components/Parameters/Core/ParamModelandVAE';
|
import ParamModelandVAEandScheduler from 'features/parameters/components/Parameters/Core/ParamModelandVAEandScheduler';
|
||||||
import ParamScheduler from 'features/parameters/components/Parameters/Core/ParamScheduler';
|
|
||||||
import ParamSteps from 'features/parameters/components/Parameters/Core/ParamSteps';
|
import ParamSteps from 'features/parameters/components/Parameters/Core/ParamSteps';
|
||||||
import ParamWidth from 'features/parameters/components/Parameters/Core/ParamWidth';
|
import ParamWidth from 'features/parameters/components/Parameters/Core/ParamWidth';
|
||||||
import ParamSeedFull from 'features/parameters/components/Parameters/Seed/ParamSeedFull';
|
import ParamSeedFull from 'features/parameters/components/Parameters/Seed/ParamSeedFull';
|
||||||
@ -44,7 +43,7 @@ const TextToImageTabCoreParameters = () => {
|
|||||||
>
|
>
|
||||||
{shouldUseSliders ? (
|
{shouldUseSliders ? (
|
||||||
<>
|
<>
|
||||||
<ParamModelandVAE />
|
<ParamModelandVAEandScheduler />
|
||||||
<Box pt={2}>
|
<Box pt={2}>
|
||||||
<ParamSeedFull />
|
<ParamSeedFull />
|
||||||
</Box>
|
</Box>
|
||||||
@ -61,8 +60,7 @@ const TextToImageTabCoreParameters = () => {
|
|||||||
<ParamSteps />
|
<ParamSteps />
|
||||||
<ParamCFGScale />
|
<ParamCFGScale />
|
||||||
</Flex>
|
</Flex>
|
||||||
<ParamModelandVAE />
|
<ParamModelandVAEandScheduler />
|
||||||
<ParamScheduler />
|
|
||||||
<Box pt={2}>
|
<Box pt={2}>
|
||||||
<ParamSeedFull />
|
<ParamSeedFull />
|
||||||
</Box>
|
</Box>
|
||||||
|
@ -8,8 +8,7 @@ import ParamBoundingBoxHeight from 'features/parameters/components/Parameters/Ca
|
|||||||
import ParamBoundingBoxWidth from 'features/parameters/components/Parameters/Canvas/BoundingBox/ParamBoundingBoxWidth';
|
import ParamBoundingBoxWidth from 'features/parameters/components/Parameters/Canvas/BoundingBox/ParamBoundingBoxWidth';
|
||||||
import ParamCFGScale from 'features/parameters/components/Parameters/Core/ParamCFGScale';
|
import ParamCFGScale from 'features/parameters/components/Parameters/Core/ParamCFGScale';
|
||||||
import ParamIterations from 'features/parameters/components/Parameters/Core/ParamIterations';
|
import ParamIterations from 'features/parameters/components/Parameters/Core/ParamIterations';
|
||||||
import ParamModelandVAE from 'features/parameters/components/Parameters/Core/ParamModelandVAE';
|
import ParamModelandVAEandScheduler from 'features/parameters/components/Parameters/Core/ParamModelandVAEandScheduler';
|
||||||
import ParamScheduler from 'features/parameters/components/Parameters/Core/ParamScheduler';
|
|
||||||
import ParamSteps from 'features/parameters/components/Parameters/Core/ParamSteps';
|
import ParamSteps from 'features/parameters/components/Parameters/Core/ParamSteps';
|
||||||
import ImageToImageStrength from 'features/parameters/components/Parameters/ImageToImage/ImageToImageStrength';
|
import ImageToImageStrength from 'features/parameters/components/Parameters/ImageToImage/ImageToImageStrength';
|
||||||
import ParamSeedFull from 'features/parameters/components/Parameters/Seed/ParamSeedFull';
|
import ParamSeedFull from 'features/parameters/components/Parameters/Seed/ParamSeedFull';
|
||||||
@ -45,7 +44,7 @@ const UnifiedCanvasCoreParameters = () => {
|
|||||||
>
|
>
|
||||||
{shouldUseSliders ? (
|
{shouldUseSliders ? (
|
||||||
<>
|
<>
|
||||||
<ParamModelandVAE />
|
<ParamModelandVAEandScheduler />
|
||||||
<Box pt={2}>
|
<Box pt={2}>
|
||||||
<ParamSeedFull />
|
<ParamSeedFull />
|
||||||
</Box>
|
</Box>
|
||||||
@ -62,8 +61,7 @@ const UnifiedCanvasCoreParameters = () => {
|
|||||||
<ParamSteps />
|
<ParamSteps />
|
||||||
<ParamCFGScale />
|
<ParamCFGScale />
|
||||||
</Flex>
|
</Flex>
|
||||||
<ParamModelandVAE />
|
<ParamModelandVAEandScheduler />
|
||||||
<ParamScheduler />
|
|
||||||
<Box pt={2}>
|
<Box pt={2}>
|
||||||
<ParamSeedFull />
|
<ParamSeedFull />
|
||||||
</Box>
|
</Box>
|
||||||
|
Loading…
Reference in New Issue
Block a user