mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-02-01 13:59:54 +00:00
Allow defining spec by property
This commit is contained in:
@@ -132,7 +132,7 @@ const zCustomInputSpec = zBaseInputOptions.extend({
|
||||
isOptional: z.boolean().optional()
|
||||
})
|
||||
|
||||
const zInputSpec = z.union([
|
||||
export const zInputSpec = z.union([
|
||||
zIntInputSpec,
|
||||
zFloatInputSpec,
|
||||
zBooleanInputSpec,
|
||||
|
||||
@@ -36,6 +36,7 @@ import type { NodeId } from '@/platform/workflow/validation/schemas/workflowSche
|
||||
import { useCanvasStore } from '@/renderer/core/canvas/canvasStore'
|
||||
import { useDialogService } from '@/services/dialogService'
|
||||
import { transformInputSpecV2ToV1 } from '@/schemas/nodeDef/migration'
|
||||
import { zInputSpec } from '@/schemas/nodeDef/nodeDefSchemaV2'
|
||||
import type {
|
||||
ComfyNodeDef as ComfyNodeDefV2,
|
||||
InputSpec,
|
||||
@@ -465,6 +466,8 @@ export const useLitegraphService = () => {
|
||||
: output
|
||||
}
|
||||
)
|
||||
const maybeDef = zInputSpec.safeParse(data.properties?.dynamicSpec).data
|
||||
if (maybeDef) addNodeInput(this, maybeDef)
|
||||
|
||||
data.widgets_values = migrateWidgetsValues(
|
||||
ComfyNode.nodeData.inputs,
|
||||
|
||||
Reference in New Issue
Block a user