mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-02-22 07:44:11 +00:00
Add subgraph skeleton classes (#997)
Allows downstream consumers to use subgraph types ahead of impl.
This commit is contained in:
@@ -48,13 +48,17 @@ export interface LGraphConfig {
|
||||
links_ontop?: any
|
||||
}
|
||||
|
||||
export interface BaseLGraph {
|
||||
readonly rootGraph: LGraph
|
||||
}
|
||||
|
||||
/**
|
||||
* LGraph is the class that contain a full graph. We instantiate one and add nodes to it, and then we can run the execution loop.
|
||||
* supported callbacks:
|
||||
* + onNodeAdded: when a new node is added to the graph
|
||||
* + onNodeRemoved: when a node inside this graph is removed
|
||||
*/
|
||||
export class LGraph implements LinkNetwork, Serialisable<SerialisableGraph> {
|
||||
export class LGraph implements LinkNetwork, BaseLGraph, Serialisable<SerialisableGraph> {
|
||||
static serialisedSchemaVersion = 1 as const
|
||||
|
||||
static STATUS_STOPPED = 1
|
||||
@@ -147,6 +151,14 @@ export class LGraph implements LinkNetwork, Serialisable<SerialisableGraph> {
|
||||
return this.#reroutes
|
||||
}
|
||||
|
||||
get rootGraph(): LGraph {
|
||||
return this
|
||||
}
|
||||
|
||||
get isRootGraph(): boolean {
|
||||
return this.rootGraph === this
|
||||
}
|
||||
|
||||
/** @deprecated See {@link state}.{@link LGraphState.lastNodeId lastNodeId} */
|
||||
get last_node_id() {
|
||||
return this.state.lastNodeId
|
||||
|
||||
Reference in New Issue
Block a user