mirror of
https://github.com/invoke-ai/InvokeAI
synced 2024-08-30 20:32:17 +00:00
feat(ui): dynamic prompts loading ux
- Prompt must have an open curly brace followed by a close curly brace to enable dynamic prompts processing - If a the given prompt already had a dynamic prompt cached, do not re-process - If processing is not needed, user may invoke immediately - Invoke button shows loading state when dynamic prompts are processing, tooltip says generating - Dynamic prompts preview icon in prompt box shows loading state when processing, tooltip says generating
This commit is contained in:
committed by
Kent Keirsey
parent
0b4eb888c5
commit
870cc5b733
@ -3,6 +3,7 @@ import { stateSelector } from 'app/store/store';
|
||||
import { useAppSelector } from 'app/store/storeHooks';
|
||||
import { selectControlAdapterAll } from 'features/controlAdapters/store/controlAdaptersSlice';
|
||||
import { isControlNetOrT2IAdapter } from 'features/controlAdapters/store/types';
|
||||
import { getShouldProcessPrompt } from 'features/dynamicPrompts/util/getShouldProcessPrompt';
|
||||
import { isInvocationNode } from 'features/nodes/types/invocation';
|
||||
import { activeTabNameSelector } from 'features/ui/store/uiSelectors';
|
||||
import i18n from 'i18next';
|
||||
@ -22,7 +23,7 @@ const selector = createMemoizedSelector(
|
||||
},
|
||||
activeTabName
|
||||
) => {
|
||||
const { initialImage, model } = generation;
|
||||
const { initialImage, model, positivePrompt } = generation;
|
||||
|
||||
const { isConnected } = system;
|
||||
|
||||
@ -87,7 +88,7 @@ const selector = createMemoizedSelector(
|
||||
});
|
||||
}
|
||||
} else {
|
||||
if (dynamicPrompts.prompts.length === 0) {
|
||||
if (dynamicPrompts.prompts.length === 0 && getShouldProcessPrompt(positivePrompt)) {
|
||||
reasons.push(i18n.t('parameters.invoke.noPrompts'));
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user