Subgraph ergonomic improvements & node def types

This commit is contained in:
space-nuko
2023-05-16 17:02:11 -05:00
parent 979f6eaeed
commit 0143b6430f
6 changed files with 115 additions and 33 deletions

View File

@@ -4,6 +4,7 @@ import EventEmitter from "events";
import type { ComfyExecutionResult, ComfyImageLocation } from "./nodes/ComfyWidgetNodes";
import type { SerializedLGraph, UUID } from "@litegraph-ts/core";
import type { SerializedLayoutState } from "./stores/layoutState";
import type { ComfyNodeDef } from "./ComfyNodeDef";
export type ComfyPromptRequest = {
client_id?: string,
@@ -226,7 +227,7 @@ export default class ComfyAPI {
* Loads node object definitions for the graph
* @returns The node definitions
*/
async getNodeDefs(): Promise<any> {
async getNodeDefs(): Promise<Record<ComfyNodeID, ComfyNodeDef>> {
return fetch(this.getBackendUrl() + "/object_info", { cache: "no-store" })
.then(resp => resp.json())
}