From 0cfc1c5f86573b9af1ff62d8750a8bed6dd496bc Mon Sep 17 00:00:00 2001 From: psychedelicious <4822129+psychedelicious@users.noreply.github.com> Date: Mon, 25 Sep 2023 23:15:09 +1000 Subject: [PATCH 1/2] fix(ui): save cache setting to workflow Do not strip out unknown values. Quick fix, probably not the best way to handle this. --- .../web/src/features/nodes/types/types.ts | 30 ++++++++++--------- 1 file changed, 16 insertions(+), 14 deletions(-) diff --git a/invokeai/frontend/web/src/features/nodes/types/types.ts b/invokeai/frontend/web/src/features/nodes/types/types.ts index fc8fe10ccc..22e5d78634 100644 --- a/invokeai/frontend/web/src/features/nodes/types/types.ts +++ b/invokeai/frontend/web/src/features/nodes/types/types.ts @@ -1210,20 +1210,22 @@ export const zParsedSemver = zSemVer.transform((val) => { export type SemVer = z.infer; -export const zInvocationNodeData = z.object({ - id: z.string().trim().min(1), - // no easy way to build this dynamically, and we don't want to anyways, because this will be used - // to validate incoming workflows, and we want to allow community nodes. - type: z.string().trim().min(1), - inputs: z.record(zInputFieldValue), - outputs: z.record(zOutputFieldValue), - label: z.string(), - isOpen: z.boolean(), - notes: z.string(), - embedWorkflow: z.boolean(), - isIntermediate: z.boolean(), - version: zSemVer.optional(), -}); +export const zInvocationNodeData = z + .object({ + id: z.string().trim().min(1), + // no easy way to build this dynamically, and we don't want to anyways, because this will be used + // to validate incoming workflows, and we want to allow community nodes. + type: z.string().trim().min(1), + inputs: z.record(zInputFieldValue), + outputs: z.record(zOutputFieldValue), + label: z.string(), + isOpen: z.boolean(), + notes: z.string(), + embedWorkflow: z.boolean(), + isIntermediate: z.boolean(), + version: zSemVer.optional(), + }) + .passthrough(); export const zInvocationNodeDataV2 = z.preprocess( (arg) => { From 50d254fdb78c4ae1c1a24429ce5fc1e9b0a040ff Mon Sep 17 00:00:00 2001 From: psychedelicious <4822129+psychedelicious@users.noreply.github.com> Date: Tue, 26 Sep 2023 10:29:54 +1000 Subject: [PATCH 2/2] fix(ui): fix types for cache setting --- .../web/src/features/nodes/types/types.ts | 31 +++++++++---------- 1 file changed, 15 insertions(+), 16 deletions(-) diff --git a/invokeai/frontend/web/src/features/nodes/types/types.ts b/invokeai/frontend/web/src/features/nodes/types/types.ts index 22e5d78634..0033e462cb 100644 --- a/invokeai/frontend/web/src/features/nodes/types/types.ts +++ b/invokeai/frontend/web/src/features/nodes/types/types.ts @@ -1210,22 +1210,21 @@ export const zParsedSemver = zSemVer.transform((val) => { export type SemVer = z.infer; -export const zInvocationNodeData = z - .object({ - id: z.string().trim().min(1), - // no easy way to build this dynamically, and we don't want to anyways, because this will be used - // to validate incoming workflows, and we want to allow community nodes. - type: z.string().trim().min(1), - inputs: z.record(zInputFieldValue), - outputs: z.record(zOutputFieldValue), - label: z.string(), - isOpen: z.boolean(), - notes: z.string(), - embedWorkflow: z.boolean(), - isIntermediate: z.boolean(), - version: zSemVer.optional(), - }) - .passthrough(); +export const zInvocationNodeData = z.object({ + id: z.string().trim().min(1), + // no easy way to build this dynamically, and we don't want to anyways, because this will be used + // to validate incoming workflows, and we want to allow community nodes. + type: z.string().trim().min(1), + inputs: z.record(zInputFieldValue), + outputs: z.record(zOutputFieldValue), + label: z.string(), + isOpen: z.boolean(), + notes: z.string(), + embedWorkflow: z.boolean(), + isIntermediate: z.boolean(), + useCache: z.boolean().optional(), + version: zSemVer.optional(), +}); export const zInvocationNodeDataV2 = z.preprocess( (arg) => {