[Schema] Add api_node flag to node def schema (#3586)

This commit is contained in:
Chenlei Hu
2025-04-23 10:47:08 -04:00
committed by GitHub
parent 59cbe90fd3
commit 9e10e55633
4 changed files with 30 additions and 2 deletions

View File

@@ -77,7 +77,8 @@ export const zComfyNodeDef = z.object({
output_node: z.boolean(),
python_module: z.string(),
deprecated: z.boolean().optional(),
experimental: z.boolean().optional()
experimental: z.boolean().optional(),
api_node: z.boolean().optional()
})
// Export types

View File

@@ -222,7 +222,13 @@ export const zComfyNodeDef = z.object({
output_node: z.boolean(),
python_module: z.string(),
deprecated: z.boolean().optional(),
experimental: z.boolean().optional()
experimental: z.boolean().optional(),
/**
* Whether the node is an API node. Running API nodes requires login to
* Comfy Org account.
* https://www.comfy.org/faq
*/
api_node: z.boolean().optional()
})
// `/object_info`

View File

@@ -41,6 +41,7 @@ export class ComfyNodeDefImpl
readonly deprecated: boolean
readonly experimental: boolean
readonly output_node: boolean
readonly api_node: boolean
/**
* @deprecated Use `inputs` instead
*/
@@ -121,6 +122,7 @@ export class ComfyNodeDefImpl
this.experimental =
obj.experimental ?? obj.category.startsWith('_for_testing')
this.output_node = obj.output_node
this.api_node = !!obj.api_node
this.input = obj.input ?? {}
this.output = obj.output ?? []
this.output_is_list = obj.output_is_list