mirror of
https://github.com/invoke-ai/InvokeAI
synced 2024-08-30 20:32:17 +00:00
cleanup
This commit is contained in:
parent
888c47d37b
commit
2933d81118
@ -16,17 +16,15 @@ import { forEach } from 'lodash-es';
|
|||||||
import { PropsWithChildren, useCallback, useMemo, useRef } from 'react';
|
import { PropsWithChildren, useCallback, useMemo, useRef } from 'react';
|
||||||
import { useGetTextualInversionModelsQuery } from 'services/api/endpoints/models';
|
import { useGetTextualInversionModelsQuery } from 'services/api/endpoints/models';
|
||||||
import { PARAMETERS_PANEL_WIDTH } from 'theme/util/constants';
|
import { PARAMETERS_PANEL_WIDTH } from 'theme/util/constants';
|
||||||
import { useFeatureStatus } from '../../system/hooks/useFeatureStatus';
|
|
||||||
|
|
||||||
type Props = PropsWithChildren & {
|
type Props = PropsWithChildren & {
|
||||||
onSelect: (v: string) => void;
|
onSelect: (v: string) => void;
|
||||||
isOpen: boolean;
|
isOpen: boolean;
|
||||||
onClose: () => void;
|
onClose: () => void;
|
||||||
enabled?: boolean;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const ParamEmbeddingPopover = (props: Props) => {
|
const ParamEmbeddingPopover = (props: Props) => {
|
||||||
const { onSelect, isOpen, onClose, children, enabled } = props;
|
const { onSelect, isOpen, onClose, children } = props;
|
||||||
const { data: embeddingQueryData } = useGetTextualInversionModelsQuery();
|
const { data: embeddingQueryData } = useGetTextualInversionModelsQuery();
|
||||||
const inputRef = useRef<HTMLInputElement>(null);
|
const inputRef = useRef<HTMLInputElement>(null);
|
||||||
|
|
||||||
|
@ -108,11 +108,11 @@ const ParamPositiveConditioning = () => {
|
|||||||
dispatch(clampSymmetrySteps());
|
dispatch(clampSymmetrySteps());
|
||||||
dispatch(userInvoked(activeTabName));
|
dispatch(userInvoked(activeTabName));
|
||||||
}
|
}
|
||||||
if (e.key === '<') {
|
if (isTiEmbeddingEnabled && e.key === '<') {
|
||||||
onOpen();
|
onOpen();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
[isReady, dispatch, activeTabName, onOpen]
|
[isReady, dispatch, activeTabName, onOpen, isTiEmbeddingEnabled]
|
||||||
);
|
);
|
||||||
|
|
||||||
const isTiEmbeddingEnabled = useFeatureStatus('tiEmbedding').isFeatureEnabled;
|
const isTiEmbeddingEnabled = useFeatureStatus('tiEmbedding').isFeatureEnabled;
|
||||||
@ -137,9 +137,9 @@ const ParamPositiveConditioning = () => {
|
|||||||
value={prompt}
|
value={prompt}
|
||||||
placeholder={t('parameters.positivePromptPlaceholder')}
|
placeholder={t('parameters.positivePromptPlaceholder')}
|
||||||
onChange={handleChangePrompt}
|
onChange={handleChangePrompt}
|
||||||
|
onKeyDown={handleKeyDown}
|
||||||
resize="vertical"
|
resize="vertical"
|
||||||
minH={32}
|
minH={32}
|
||||||
{...(isTiEmbeddingEnabled && { onKeyDown: handleKeyDown })}
|
|
||||||
/>
|
/>
|
||||||
</ParamEmbeddingPopover>
|
</ParamEmbeddingPopover>
|
||||||
</FormControl>
|
</FormControl>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user