Use consistent NodeId and SlotIndex in schema (#359)

* Use consistent NodeId and SlotIndex in schema

* Add test
This commit is contained in:
Chenlei Hu
2024-08-10 14:15:00 -04:00
committed by GitHub
parent 3c76554bec
commit fe0d63e16c
3 changed files with 39 additions and 10 deletions

View File

@@ -88,4 +88,20 @@ describe('parseComfyWorkflow', () => {
const validatedWorkflow = await validateComfyWorkflow(workflow)
expect(validatedWorkflow.nodes[0].widgets_values).toEqual({ foo: 'bar' })
})
it('workflow.links', async () => {
const workflow = JSON.parse(JSON.stringify(defaultGraph))
workflow.links = [
[
1, // Link id
'100:1', // Node id of source node
'12', // Output slot# of source node
'100:2', // Node id of destination node
15, // Input slot# of destination node
'INT' // Data type
]
]
expect(await validateComfyWorkflow(workflow)).not.toBeNull()
})
})