Skip to content

Commit 0868fc2

Browse files
Merge branch 'main' into depth-anything
2 parents 92fb09c + b4cf549 commit 0868fc2

File tree

8 files changed

+24
-14
lines changed

8 files changed

+24
-14
lines changed

invokeai/frontend/web/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@
5757
"@dnd-kit/core": "^6.1.0",
5858
"@dnd-kit/utilities": "^3.2.2",
5959
"@fontsource-variable/inter": "^5.0.16",
60-
"@invoke-ai/ui": "0.0.12",
60+
"@invoke-ai/ui": "0.0.13",
6161
"@mantine/form": "6.0.21",
6262
"@nanostores/react": "^0.7.1",
6363
"@reduxjs/toolkit": "2.0.1",

invokeai/frontend/web/pnpm-lock.yaml

Lines changed: 6 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

invokeai/frontend/web/src/app/store/middleware/listenerMiddleware/listeners/promptChanged.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,14 +46,14 @@ export const addDynamicPromptsListener = () => {
4646

4747
if (cachedPrompts) {
4848
dispatch(promptsChanged(cachedPrompts.prompts));
49+
dispatch(parsingErrorChanged(cachedPrompts.error));
4950
return;
5051
}
5152

5253
if (!getShouldProcessPrompt(state.generation.positivePrompt)) {
53-
if (state.dynamicPrompts.isLoading) {
54-
dispatch(isLoadingChanged(false));
55-
}
5654
dispatch(promptsChanged([state.generation.positivePrompt]));
55+
dispatch(parsingErrorChanged(undefined));
56+
dispatch(isErrorChanged(false));
5757
return;
5858
}
5959

@@ -78,7 +78,6 @@ export const addDynamicPromptsListener = () => {
7878
dispatch(promptsChanged(res.prompts));
7979
dispatch(parsingErrorChanged(res.error));
8080
dispatch(isErrorChanged(false));
81-
dispatch(isLoadingChanged(false));
8281
} catch {
8382
dispatch(isErrorChanged(true));
8483
dispatch(isLoadingChanged(false));

invokeai/frontend/web/src/features/dynamicPrompts/components/ParamDynamicPromptsPreview.tsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,12 @@ const ParamDynamicPromptsPreview = () => {
6161
}
6262

6363
return (
64-
<FormControl orientation="vertical" w="full" h="full">
64+
<FormControl
65+
orientation="vertical"
66+
w="full"
67+
h="full"
68+
isInvalid={Boolean(parsingError || isError)}
69+
>
6570
<InformationalPopover feature="dynamicPrompts" inPortal={false}>
6671
<FormLabel>{label}</FormLabel>
6772
</InformationalPopover>

invokeai/frontend/web/src/features/dynamicPrompts/components/ShowDynamicPromptsPreviewButton.tsx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,11 @@ const loadingStyles: SystemStyleObject = {
1313
export const ShowDynamicPromptsPreviewButton = memo(() => {
1414
const { t } = useTranslation();
1515
const isLoading = useAppSelector((s) => s.dynamicPrompts.isLoading);
16+
const isError = useAppSelector((s) =>
17+
Boolean(s.dynamicPrompts.isError || s.dynamicPrompts.parsingError)
18+
);
1619
const { isOpen, onOpen } = useDynamicPromptsModal();
20+
1721
return (
1822
<Tooltip
1923
label={
@@ -30,6 +34,7 @@ export const ShowDynamicPromptsPreviewButton = memo(() => {
3034
icon={<BsBracesAsterisk />}
3135
onClick={onOpen}
3236
sx={isLoading ? loadingStyles : undefined}
37+
colorScheme={isError && !isLoading ? 'error' : 'base'}
3338
/>
3439
</Tooltip>
3540
);

invokeai/frontend/web/src/features/dynamicPrompts/store/dynamicPromptsSlice.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ export const dynamicPromptsSlice = createSlice({
4747
},
4848
promptsChanged: (state, action: PayloadAction<string[]>) => {
4949
state.prompts = action.payload;
50+
state.isLoading = false;
5051
},
5152
parsingErrorChanged: (
5253
state,
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
const hasOpenCloseCurlyBracesRegex = /.*\{.*\}.*/;
1+
const hasOpenCloseCurlyBracesRegex = /.*\{[\s\S]*\}.*/;
22
export const getShouldProcessPrompt = (prompt: string): boolean =>
33
hasOpenCloseCurlyBracesRegex.test(prompt);

invokeai/frontend/web/src/features/nodes/types/common.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ export const zModelType = z.enum([
6565
'controlnet',
6666
'embedding',
6767
]);
68-
export const zModelName = z.string().trim().min(1);
68+
export const zModelName = z.string().min(3);
6969
export const zModelIdentifier = z.object({
7070
model_name: zModelName,
7171
base_model: zBaseModel,

0 commit comments

Comments
 (0)