custom_node provided blueprints (#6172)

Frontend implementation for a system to allow custom_nodes to provide a
set of subgraph blueprints.

Requires comfyanonymous/ComfyUI#10438, but handles gracefully in unavailable.

┆Issue is synchronized with this [Notion
page](https://www.notion.so/PR-6172-Early-POC-custom_node-provided-blueprints-2926d73d3650814982ecd43f12abd873)
by [Unito](https://www.unito.io)

---------

Co-authored-by: Christian Byrne <cbyrne@comfy.org>
This commit is contained in:
AustinMroz
2025-10-24 08:24:34 -07:00
committed by GitHub
parent 8ed9be20a9
commit a108c52572
4 changed files with 77 additions and 23 deletions

View File

@@ -83,11 +83,11 @@ export class ComfyWorkflow extends UserFile {
* @param force Whether to force loading the content even if it is already loaded.
* @returns this
*/
override async load({
force = false
}: { force?: boolean } = {}): Promise<LoadedComfyWorkflow> {
override async load({ force = false }: { force?: boolean } = {}): Promise<
this & LoadedComfyWorkflow
> {
await super.load({ force })
if (!force && this.isLoaded) return this as LoadedComfyWorkflow
if (!force && this.isLoaded) return this as this & LoadedComfyWorkflow
if (!this.originalContent) {
throw new Error('[ASSERT] Workflow content should be loaded')
@@ -100,7 +100,7 @@ export class ComfyWorkflow extends UserFile {
/* initialState= */ JSON.parse(this.originalContent)
)
)
return this as LoadedComfyWorkflow
return this as this & LoadedComfyWorkflow
}
override unload(): void {