@@ -34,10 +34,7 @@ import type {
3434 ComfyWorkflowJSON ,
3535 NodeId
3636} from '@/schemas/comfyWorkflowSchema'
37- import {
38- type ComfyNodeDef ,
39- validateComfyNodeDef
40- } from '@/schemas/nodeDefSchema'
37+ import type { ComfyNodeDef } from '@/schemas/nodeDefSchema'
4138import { WorkflowTemplates } from '@/types/workflowTemplateTypes'
4239
4340interface QueuePromptRequestBody {
@@ -605,31 +602,9 @@ export class ComfyApi extends EventTarget {
605602 * Loads node object definitions for the graph
606603 * @returns The node definitions
607604 */
608- async getNodeDefs ( { validate = false } : { validate ?: boolean } = { } ) : Promise <
609- Record < string , ComfyNodeDef >
610- > {
605+ async getNodeDefs ( ) : Promise < Record < string , ComfyNodeDef > > {
611606 const resp = await this . fetchApi ( '/object_info' , { cache : 'no-store' } )
612- const objectInfoUnsafe = await resp . json ( )
613- if ( ! validate ) {
614- return objectInfoUnsafe
615- }
616- // Validate node definitions against zod schema. (slow)
617- const objectInfo : Record < string , ComfyNodeDef > = { }
618- for ( const key in objectInfoUnsafe ) {
619- const validatedDef = validateComfyNodeDef (
620- objectInfoUnsafe [ key ] ,
621- /* onError=*/ ( errorMessage : string ) => {
622- console . warn (
623- `Skipping invalid node definition: ${ key } . See debug log for more information.`
624- )
625- console . debug ( errorMessage )
626- }
627- )
628- if ( validatedDef !== null ) {
629- objectInfo [ key ] = validatedDef
630- }
631- }
632- return objectInfo
607+ return await resp . json ( )
633608 }
634609
635610 /**
0 commit comments