mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-04-26 09:19:43 +00:00
Add models information to default workflow. (#321)
* Add models information to default workflow. * Add models to zod schema. * Fix zod schema. * Update schema name. * Add z prefix to modelfile schema name.
This commit is contained in:
@@ -1,6 +1,15 @@
|
||||
import { z } from 'zod'
|
||||
import { fromZodError } from 'zod-validation-error'
|
||||
|
||||
// Definition of an AI model file used in the workflow.
|
||||
const zModelFile = z.object({
|
||||
name: z.string(),
|
||||
url: z.string().url(),
|
||||
hash: z.string(),
|
||||
hash_type: z.string(),
|
||||
directory: z.string()
|
||||
})
|
||||
|
||||
const zComfyLink = z.tuple([
|
||||
z.number(), // Link id
|
||||
z.number(), // Node id of source node
|
||||
@@ -121,7 +130,8 @@ export const zComfyWorkflow = z
|
||||
groups: z.array(zGroup).optional(),
|
||||
config: zConfig.optional().nullable(),
|
||||
extra: zExtra.optional().nullable(),
|
||||
version: z.number()
|
||||
version: z.number(),
|
||||
models: z.array(zModelFile).optional()
|
||||
})
|
||||
.passthrough()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user