fix(ui): schema parsing now that node_pack is guaranteed to be present

This commit is contained in:
psychedelicious 2024-08-28 21:31:15 +10:00
parent 06fe14e1fc
commit 312093cbb0
5 changed files with 10 additions and 2 deletions

View File

@ -163,6 +163,7 @@ export const collect: InvocationTemplate = {
},
},
useCache: true,
nodePack: 'invokeai',
classification: 'stable',
};
@ -480,6 +481,7 @@ const iterate: InvocationTemplate = {
},
},
useCache: true,
nodePack: 'invokeai',
classification: 'stable',
};
@ -1152,6 +1154,7 @@ export const schema = {
type: 'object',
required: ['type', 'id'],
title: 'CollectInvocation',
node_pack: 'invokeai',
description: 'Collects values into a collection',
classification: 'stable',
version: '1.0.0',
@ -1513,6 +1516,7 @@ export const schema = {
title: 'IterateInvocation',
description: 'Iterates over a list of items',
classification: 'stable',
node_pack: 'invokeai',
version: '1.1.0',
output: {
$ref: '#/components/schemas/IterateInvocationOutput',

View File

@ -16,7 +16,7 @@ const zInvocationTemplate = z.object({
outputType: z.string().min(1),
version: zSemVer,
useCache: z.boolean(),
nodePack: z.string().min(1).nullish(),
nodePack: z.string().min(1).default('invokeai'),
classification: zClassification,
});
export type InvocationTemplate = z.infer<typeof zInvocationTemplate>;
@ -26,7 +26,7 @@ export type InvocationTemplate = z.infer<typeof zInvocationTemplate>;
export const zInvocationNodeData = z.object({
id: z.string().trim().min(1),
version: zSemVer,
nodePack: z.string().min(1).nullish(),
nodePack: z.string().min(1).default('invokeai'),
label: z.string(),
notes: z.string(),
type: z.string().trim().min(1),

View File

@ -38,6 +38,7 @@ export const buildInvocationNode = (position: XYPosition, template: InvocationTe
isOpen: true,
isIntermediate: type === 'save_image' ? false : true,
useCache: template.useCache,
nodePack: template.nodePack,
inputs,
},
};

View File

@ -85,6 +85,7 @@ export const graphToWorkflow = (graph: NonNullableGraph, autoLayout = true): Wor
isOpen: true,
isIntermediate: node.is_intermediate ?? false,
useCache: node.use_cache ?? true,
nodePack: template.nodePack,
inputs,
},
});

View File

@ -28,6 +28,7 @@ describe('validateWorkflow', () => {
isOpen: true,
isIntermediate: true,
useCache: true,
nodePack: 'invokeai',
inputs: {
model: {
name: 'model',
@ -56,6 +57,7 @@ describe('validateWorkflow', () => {
isOpen: true,
isIntermediate: true,
useCache: true,
nodePack: 'invokeai',
inputs: {
board: {
name: 'board',