mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-04-26 01:09:46 +00:00
Allow input spec with extra values passthrough (#273)
* Allow input spec extra values passthrough * Refine custom input spec * nit * nit
This commit is contained in:
@@ -27,7 +27,11 @@ describe('validateNodeDef', () => {
|
||||
describe.each([
|
||||
[{ ckpt_name: 'foo' }, ['foo', {}]],
|
||||
[{ ckpt_name: ['foo'] }, ['foo', {}]],
|
||||
[{ ckpt_name: ['foo', { default: 1 }] }, ['foo', { default: 1 }]]
|
||||
[{ ckpt_name: ['foo', { default: 1 }] }, ['foo', { default: 1 }]],
|
||||
// Extra input spec should be preserved
|
||||
[{ ckpt_name: ['foo', { bar: 1 }] }, ['foo', { bar: 1 }]],
|
||||
[{ ckpt_name: ['INT', { bar: 1 }] }, ['INT', { bar: 1 }]],
|
||||
[{ ckpt_name: [[1, 2, 3], { bar: 1 }] }, [[1, 2, 3], { bar: 1 }]]
|
||||
])(
|
||||
'validateComfyNodeDef with various input spec formats',
|
||||
(inputSpec, expected) => {
|
||||
@@ -47,7 +51,9 @@ describe('validateNodeDef', () => {
|
||||
describe.each([
|
||||
[{ ckpt_name: { 'model1.safetensors': 'foo' } }],
|
||||
[{ ckpt_name: ['*', ''] }],
|
||||
[{ ckpt_name: ['foo', { default: 1 }, { default: 2 }] }]
|
||||
[{ ckpt_name: ['foo', { default: 1 }, { default: 2 }] }],
|
||||
// Should reject incorrect default value type.
|
||||
[{ ckpt_name: ['INT', { default: '124' }] }]
|
||||
])(
|
||||
'validateComfyNodeDef rejects with various input spec formats',
|
||||
(inputSpec) => {
|
||||
|
||||
Reference in New Issue
Block a user