@gausszhou/litegraph-core / Subgraph
Class: Subgraph
Defined in: packages/core/src/nodes/Subgraph.ts:119
https://github.com/jagenjo/litegraph.js/blob/master/guides/README.md#lgraphnode
Extends
Constructors
Constructor
new Subgraph(title?, graphFactory?): Subgraph;Defined in: packages/core/src/nodes/Subgraph.ts:147
Parameters
title?
string
graphFactory?
() => LGraph
Returns
Subgraph
Overrides
Properties
_collapsed_width?
_collapsed_width?: number;Defined in: packages/core/src/LGraphNode.ts:222
Inherited from
_level
_level: number;Defined in: packages/core/src/LGraphNode.ts:204
Inherited from
_relative_id
_relative_id: string | number | null = null;Defined in: packages/core/src/LGraphNode.ts:203
Inherited from
action_call
action_call: string | null = null;Defined in: packages/core/src/LGraphNode.ts:224
Inherited from
action_triggered
action_triggered: number = 0;Defined in: packages/core/src/LGraphNode.ts:228
the nFrames it will be used (-- each step), means "how old" is the event
Inherited from
bgcolor
bgcolor: string;Defined in: packages/core/src/LGraphNode.ts:192
Inherited from
block_delete
block_delete: boolean = false;Defined in: packages/core/src/LGraphNode.ts:198
Inherited from
boxcolor
boxcolor: string;Defined in: packages/core/src/LGraphNode.ts:193
Inherited from
category
category: string | null;Defined in: packages/core/src/LGraphNode.ts:152
Inherited from
class
class: new () => LGraphNode;Defined in: packages/core/src/LGraphNode.ts:169
Returns
Inherited from
clip_area
clip_area: boolean;Defined in: packages/core/src/LGraphNode.ts:214
if you render outside the node, it will be clipped
Inherited from
clonable
clonable: boolean = true;Defined in: packages/core/src/LGraphNode.ts:166
Inherited from
collapsable
collapsable: boolean = true;Defined in: packages/core/src/LGraphNode.ts:167
Inherited from
color
color: string;Defined in: packages/core/src/LGraphNode.ts:191
Inherited from
connections
connections: INodeConnection[];Defined in: packages/core/src/LGraphNode.ts:179
Inherited from
desc
desc: string = "";Defined in: packages/core/src/LGraphNode.ts:150
Inherited from
enabled
enabled: boolean = true;Defined in: packages/core/src/nodes/Subgraph.ts:144
exec_version
exec_version: number = 0;Defined in: packages/core/src/LGraphNode.ts:223
Inherited from
execute_triggered
execute_triggered: number = 0;Defined in: packages/core/src/LGraphNode.ts:226
the nFrames it will be used (-- each step), means "how old" is the event
Inherited from
flags
flags: Partial<{
collapsed: boolean;
pinned: boolean;
skip_repeated_outputs: boolean;
}>;Defined in: packages/core/src/LGraphNode.ts:185
Inherited from
graph
graph: LGraph | null;Defined in: packages/core/src/LGraphNode.ts:155
Inherited from
graph_version
graph_version: number;Defined in: packages/core/src/LGraphNode.ts:156
Inherited from
has_errors?
has_errors?: boolean;Defined in: packages/core/src/LGraphNode.ts:220
if true, the node will show the bgcolor as 'red'
Inherited from
hide_in_node_lists
hide_in_node_lists: boolean = false;Defined in: packages/core/src/LGraphNode.ts:197
Inherited from
horizontal
horizontal: boolean;Defined in: packages/core/src/LGraphNode.ts:218
slots are distributed horizontally
Inherited from
id
id: NodeID;Defined in: packages/core/src/LGraphNode.ts:171
Inherited from
ignore_remove
ignore_remove: boolean = false;Defined in: packages/core/src/LGraphNode.ts:199
Inherited from
inputs
inputs: INodeInputSlot[];Defined in: packages/core/src/LGraphNode.ts:177
Inherited from
is_selected
is_selected: boolean;Defined in: packages/core/src/LGraphNode.ts:159
Inherited from
last_serialization?
last_serialization?:
| SerializedLGraphNode<LGraphNode>
| null = null;Defined in: packages/core/src/LGraphNode.ts:201
Inherited from
mode?
mode?: NodeMode;Defined in: packages/core/src/LGraphNode.ts:207
Used in LGraphCanvas.onMenuNodeMode
Inherited from
mouseOver
mouseOver: boolean;Defined in: packages/core/src/LGraphNode.ts:160
Inherited from
order
order: number;Defined in: packages/core/src/LGraphNode.ts:163
Inherited from
outputs
outputs: INodeOutputSlot[];Defined in: packages/core/src/LGraphNode.ts:178
Inherited from
pos
pos: Vector2;Defined in: packages/core/src/LGraphNode.ts:154
Inherited from
priority
priority: number = 0;Defined in: packages/core/src/LGraphNode.ts:162
computeExecutionOrder sorts by priority first, then order if priorities are the same
Inherited from
properties
properties: SubgraphProperties;Defined in: packages/core/src/nodes/Subgraph.ts:123
Overrides
properties_info
properties_info: IProperty[];Defined in: packages/core/src/LGraphNode.ts:183
Inherited from
redraw_on_mouse
redraw_on_mouse: boolean;Defined in: packages/core/src/LGraphNode.ts:164
Inherited from
removable
removable: boolean = true;Defined in: packages/core/src/LGraphNode.ts:165
Inherited from
resizable
resizable: boolean;Defined in: packages/core/src/LGraphNode.ts:216
if set to false it wont be resizable with the mouse
Inherited from
serialize_widgets
serialize_widgets: boolean = false;Defined in: packages/core/src/LGraphNode.ts:196
Inherited from
shape
shape: number;Defined in: packages/core/src/LGraphNode.ts:194
Inherited from
size
size: Vector2;Defined in: packages/core/src/nodes/Subgraph.ts:142
Overrides
skip_subgraph_button
skip_subgraph_button: boolean = false;Defined in: packages/core/src/LGraphNode.ts:158
Inherited from
LGraphNode.skip_subgraph_button
subgraph
subgraph: LGraph;Defined in: packages/core/src/nodes/Subgraph.ts:145
Overrides
title
title: string;Defined in: packages/core/src/LGraphNode.ts:149
Inherited from
titleMode
titleMode: TitleMode = TitleMode.NORMAL_TITLE;Defined in: packages/core/src/LGraphNode.ts:168
Inherited from
type
type: string | null;Defined in: packages/core/src/LGraphNode.ts:151
Inherited from
widgets
widgets:
| IWidget<any, any>[]
| null
| undefined;Defined in: packages/core/src/LGraphNode.ts:173
Inherited from
widgets_start_y
widgets_start_y: number;Defined in: packages/core/src/LGraphNode.ts:212
widgets start at y distance from the top of the node
Inherited from
widgets_up
widgets_up: boolean;Defined in: packages/core/src/LGraphNode.ts:210
If set to true widgets do not start after the slots
Inherited from
widgets_values?
widgets_values?: any[];Defined in: packages/core/src/LGraphNode.ts:174
Inherited from
default_lgraph_factory
static default_lgraph_factory: () => LGraph;Defined in: packages/core/src/nodes/Subgraph.ts:121
Returns
MAX_CONSOLE
static MAX_CONSOLE: number = 100;Defined in: packages/core/src/LGraphNode.ts:2787
Inherited from
optionalSlots
static optionalSlots: OptionalSlots;Defined in: packages/core/src/nodes/Subgraph.ts:136
propertyLayout
static propertyLayout: PropertyLayout;Defined in: packages/core/src/nodes/Subgraph.ts:132
slotLayout
static slotLayout: SlotLayout;Defined in: packages/core/src/nodes/Subgraph.ts:127
title
static title: string;Defined in: packages/core/src/LGraphNode.ts:120
Inherited from
title_color
static title_color: string;Defined in: packages/core/src/LGraphNode.ts:119
Inherited from
type
static type: string | null;Defined in: packages/core/src/LGraphNode.ts:121
Inherited from
widgets_up
static widgets_up: boolean;Defined in: packages/core/src/LGraphNode.ts:122
Inherited from
Accessors
slotLayout
Get Signature
get slotLayout(): SlotLayout | null;Defined in: packages/core/src/LGraphNode.ts:112
Returns
SlotLayout | null
Inherited from
Methods
actionDo()
actionDo(
action,
param,
options?
): void;Defined in: packages/core/src/LGraphNode.ts:1145
Triggers an action, wrapped by logics to control execution flow
Parameters
action
any
name
param
any
options?
LActionOptions = {}
Returns
void
Method
actionDo
Inherited from
addConnection()
addConnection(
name,
type,
pos,
direction
): INodeConnection;Defined in: packages/core/src/LGraphNode.ts:1555
add an special connection to this node (used for special kinds of graphs)
Parameters
name
string
type
string
string defining the input type ("vec3","number",...)
pos
position of the connection inside the node
direction
string
if is input or output
Returns
Inherited from
addCustomWidget()
addCustomWidget<T>(customWidget): T;Defined in: packages/core/src/LGraphNode.ts:1762
Type Parameters
T
T extends IWidget<any, any>
Parameters
customWidget
T
Returns
T
Inherited from
addGraphInput()
addGraphInput(
name,
type,
pos?
): SubgraphInputPair | null;Defined in: packages/core/src/nodes/Subgraph.ts:682
Parameters
name
string
type
pos?
Returns
SubgraphInputPair | null
addGraphOutput()
addGraphOutput(
name,
type,
pos?
): SubgraphOutputPair | null;Defined in: packages/core/src/nodes/Subgraph.ts:717
Parameters
name
string
type
pos?
Returns
SubgraphOutputPair | null
addInput()
addInput(
name,
type?,
extra_info?
): INodeInputSlot;Defined in: packages/core/src/LGraphNode.ts:1459
add a new input slot to use in this node
Parameters
name
string
type?
SlotType = BuiltInSlotType.DEFAULT
string defining the input type ("vec3","number",...), it its a generic one use 0
extra_info?
Partial<INodeInputSlot>
this can be used to have special properties of an input (label, color, position, etc)
Returns
Inherited from
addOnExecutedOutput()
addOnExecutedOutput(): number;Defined in: packages/core/src/LGraphNode.ts:1065
Returns
number
Inherited from
LGraphNode.addOnExecutedOutput
addOnTriggerInput()
addOnTriggerInput(): number;Defined in: packages/core/src/LGraphNode.ts:1056
Returns
number
Inherited from
addOutput()
addOutput(
name,
type?,
extra_info?
): INodeOutputSlot;Defined in: packages/core/src/LGraphNode.ts:1351
add a new output slot to use in this node
Parameters
name
string
type?
SlotType = BuiltInSlotType.DEFAULT
string defining the output type ("vec3","number",...)
extra_info?
Partial<INodeOutputSlot>
this can be used to have special properties of an output (label, special color, position, etc)
Returns
Inherited from
addProperty()
addProperty(
name,
default_value,
type?,
extra_info?
): IProperty;Defined in: packages/core/src/LGraphNode.ts:1322
add a new property to this node
Parameters
name
string
default_value
any
type?
string
string defining the output type ("vec3","number",...)
extra_info?
Partial<IPropertyInfo>
this can be used to have special properties of the property (like values, etc)
Returns
Inherited from
addWidget()
addWidget<T>(
type,
name,
value,
callback?,
options?
): T;Defined in: packages/core/src/LGraphNode.ts:1707
https://github.com/jagenjo/litegraph.js/blob/master/guides/README.md#node-widgets
Type Parameters
T
T extends IWidget<any, any>
Parameters
type
T["type"]
name
string
value
T["value"]
callback?
string | WidgetCallback<T>
options?
T["options"]
Returns
T
created widget
Inherited from
alignToGrid()
alignToGrid(): void;Defined in: packages/core/src/LGraphNode.ts:2776
Force align to grid
Returns
void
Inherited from
buildFromNodes()
buildFromNodes(nodes): void;Defined in: packages/core/src/nodes/Subgraph.ts:507
Parameters
nodes
Returns
void
captureInput()
captureInput(v): void;Defined in: packages/core/src/LGraphNode.ts:2824
Allows to get onMouseMove and onMouseUp events even if the mouse is out of focus
Parameters
v
any
Returns
void
Inherited from
changeMode()
changeMode(modeTo): boolean;Defined in: packages/core/src/LGraphNode.ts:1086
Parameters
modeTo
Returns
boolean
Inherited from
clearTriggeredSlot()
clearTriggeredSlot(slot, link_id?): void;Defined in: packages/core/src/LGraphNode.ts:1273
clears the trigger slot animation
Parameters
slot
number
the index of the output slot
link_id?
in case you want to trigger and specific output link in a slot
Returns
void
Inherited from
clone()
clone(cloneData?): LGraphNode;Defined in: packages/core/src/nodes/Subgraph.ts:476
Creates a clone of this node
Parameters
cloneData?
LGraphNodeCloneData = ...
Returns
Overrides
collapse()
collapse(force?): void;Defined in: packages/core/src/LGraphNode.ts:2853
Collapse the node to make it smaller on the canvas
Parameters
force?
boolean = false
Returns
void
Inherited from
computeSize()
computeSize(): Vector2;Defined in: packages/core/src/nodes/Subgraph.ts:317
computes the size of a node according to its inputs and output slots
Returns
Overrides
configure()
configure(info): void;Defined in: packages/core/src/LGraphNode.ts:237
configure a node from an object containing the serialized info
Parameters
info
Returns
void
Inherited from
connect()
connect<T>(
slot,
targetNode,
targetSlot
): T | null;Defined in: packages/core/src/LGraphNode.ts:2196
connect this node output to the input of another node
Type Parameters
T
T = any
Parameters
slot
string | number
(could be the number of the slot or the string with the name of the slot)
targetNode
the target node
targetSlot
string | number
the input slot of the target node (could be the number of the slot or the string with the name of the slot, or -1 to connect a trigger)
Returns
T | null
the linkInfo is created, otherwise null
Inherited from
connectByTypeInput()
connectByTypeInput(
slot,
targetNode,
targetSlotType,
optsIn?
): any;Defined in: packages/core/src/LGraphNode.ts:2061
connect this node output to the input of another node BY TYPE
Parameters
slot
(could be the number of the slot or the string with the name of the slot)
targetNode
targetSlotType
optsIn?
createEventInCase?
boolean
firstFreeIfOutputGeneralInCase?
boolean
generalTypeInCase?
boolean
Returns
any
the link_info is created, otherwise null
Method
connectByType
Inherited from
connectByTypeOutput()
connectByTypeOutput(
slot,
sourceNode,
sourceSlotType,
optsIn?
): any;Defined in: packages/core/src/LGraphNode.ts:2131
connect this node input to the output of another node BY TYPE
Parameters
slot
(could be the number of the slot or the string with the name of the slot)
sourceNode
sourceSlotType
optsIn?
createEventInCase?
boolean
firstFreeIfOutputGeneralInCase?
boolean
generalTypeInCase?
boolean
Returns
any
the link_info is created, otherwise null
Method
connectByType
Inherited from
LGraphNode.connectByTypeOutput
convertNodesToSubgraphInputs()
convertNodesToSubgraphInputs(nodes): void;Defined in: packages/core/src/nodes/Subgraph.ts:921
Parameters
nodes
Returns
void
convertNodesToSubgraphOutputs()
convertNodesToSubgraphOutputs(nodes): void;Defined in: packages/core/src/nodes/Subgraph.ts:993
Parameters
nodes
Returns
void
disconnectInput()
disconnectInput(slot, options?): boolean;Defined in: packages/core/src/LGraphNode.ts:2597
disconnect one input
Parameters
slot
(could be the number of the slot or the string with the name of the slot)
options?
doProcessChange?
boolean
Returns
boolean
if it was disconnected successfully
Inherited from
disconnectOutput()
disconnectOutput(
slot,
targetNode?,
options?
): boolean;Defined in: packages/core/src/LGraphNode.ts:2430
disconnect one output to an specific node
Parameters
slot
(could be the number of the slot or the string with the name of the slot)
targetNode?
the target node to which this slot is connected [Optional, if not targetNode is specified all nodes will be disconnected]
options?
object
Returns
boolean
if it was disconnected successfully
Inherited from
doExecute()
doExecute(param?, options?): void;Defined in: packages/core/src/LGraphNode.ts:1113
Parameters
param?
any
options?
LActionOptions = {}
Returns
void
Inherited from
findInputSlotByName()
findInputSlotByName(
name?,
onlyFree?,
typesNotAccepted?
): INodeInputSlot | null;Defined in: packages/core/src/LGraphNode.ts:1906
Parameters
name?
string
onlyFree?
boolean = false
typesNotAccepted?
SlotType[]
Returns
INodeInputSlot | null
Inherited from
LGraphNode.findInputSlotByName
findInputSlotByType()
findInputSlotByType(
type,
preferFreeSlot?,
doNotUseOccupied?
): INodeInputSlot | null;Defined in: packages/core/src/LGraphNode.ts:1982
findSlotByType for INPUTS
Parameters
type
preferFreeSlot?
boolean = false
doNotUseOccupied?
boolean = false
Returns
INodeInputSlot | null
Inherited from
LGraphNode.findInputSlotByType
findInputSlotIndexByName()
findInputSlotIndexByName(
name?,
onlyFree?,
typesNotAccepted?
): number;Defined in: packages/core/src/LGraphNode.ts:1888
returns the input slot with a given name (used for dynamic slots), -1 if not found
Parameters
name?
string
the name of the slot
onlyFree?
boolean = false
typesNotAccepted?
SlotType[]
Returns
number
the slot (-1 if not found)
Inherited from
LGraphNode.findInputSlotIndexByName
findInputSlotIndexByType()
findInputSlotIndexByType(
type,
preferFreeSlot?,
doNotUseOccupied?
): number;Defined in: packages/core/src/LGraphNode.ts:1968
findSlotByType for INPUTS
Parameters
type
preferFreeSlot?
boolean = false
doNotUseOccupied?
boolean = false
Returns
number
Inherited from
LGraphNode.findInputSlotIndexByType
findOutputSlotByName()
findOutputSlotByName(
name?,
onlyFree?,
typesNotAccepted?
): INodeOutputSlot | null;Defined in: packages/core/src/LGraphNode.ts:1947
Parameters
name?
string
onlyFree?
boolean = false
typesNotAccepted?
SlotType[]
Returns
INodeOutputSlot | null
Inherited from
LGraphNode.findOutputSlotByName
findOutputSlotByType()
findOutputSlotByType(
type,
preferFreeSlot?,
doNotUseOccupied?
): INodeOutputSlot | null;Defined in: packages/core/src/LGraphNode.ts:1989
findSlotByType for OUTPUTS
Parameters
type
preferFreeSlot?
boolean = false
doNotUseOccupied?
boolean = false
Returns
INodeOutputSlot | null
Inherited from
LGraphNode.findOutputSlotByType
findOutputSlotIndexByName()
findOutputSlotIndexByName(
name?,
onlyFree?,
typesNotAccepted?
): number;Defined in: packages/core/src/LGraphNode.ts:1929
returns the output slot with a given name (used for dynamic slots), -1 if not found
Parameters
name?
string
the name of the slot
onlyFree?
boolean = false
typesNotAccepted?
SlotType[]
Returns
number
the slot (-1 if not found)
Inherited from
LGraphNode.findOutputSlotIndexByName
findOutputSlotIndexByType()
findOutputSlotIndexByType(
type,
preferFreeSlot?,
doNotUseOccupied?
): number;Defined in: packages/core/src/LGraphNode.ts:1975
findSlotByType for OUTPUTS
Parameters
type
preferFreeSlot?
boolean = false
doNotUseOccupied?
boolean = false
Returns
number
Inherited from
LGraphNode.findOutputSlotIndexByType
getBounding()
getBounding(out?): Float32Array;Defined in: packages/core/src/LGraphNode.ts:1780
returns the bounding of the object, used for rendering purposes
Parameters
out?
Float32Array<ArrayBufferLike>
Returns
Float32Array
[x, y, width, height]
Inherited from
getConnectionPos()
getConnectionPos(
is_input,
slotNumber,
out?,
ignore_collapsed?
): Vector2;Defined in: packages/core/src/LGraphNode.ts:2693
returns the center of a connection point in canvas coords
Parameters
is_input
boolean
true if if a input slot, false if it is an output
slotNumber
number
out?
Vector2 = ...
a place to store the output, to free garbage
ignore_collapsed?
boolean = false
Returns
the position
Inherited from
getExtraLinkOptions()?
getExtraLinkOptions?(
graphCanvas,
link,
linkType,
options
): ContextMenuItem[];Defined in: packages/core/src/LGraphNode.ts:3126
Parameters
graphCanvas
link
linkType
options
Returns
Inherited from
LGraphNode.getExtraLinkOptions
getExtraMenuOptions()
getExtraMenuOptions(graphCanvas, options): ContextMenuItem[];Defined in: packages/core/src/nodes/Subgraph.ts:434
Parameters
graphCanvas
options
Returns
Overrides
LGraphNode.getExtraMenuOptions
getInnerGraphInput()
getInnerGraphInput(outerInputName): GraphInput | null;Defined in: packages/core/src/nodes/Subgraph.ts:835
Parameters
outerInputName
string
Returns
GraphInput | null
getInnerGraphInputByIndex()
getInnerGraphInputByIndex(outerInputIndex): GraphInput | null;Defined in: packages/core/src/nodes/Subgraph.ts:851
Parameters
outerInputIndex
number
Returns
GraphInput | null
getInnerGraphOutput()
getInnerGraphOutput(outerOutputName): GraphOutput | null;Defined in: packages/core/src/nodes/Subgraph.ts:826
Parameters
outerOutputName
string
Returns
GraphOutput | null
getInnerGraphOutputByIndex()
getInnerGraphOutputByIndex(outerOutputIndex): GraphOutput | null;Defined in: packages/core/src/nodes/Subgraph.ts:844
Parameters
outerOutputIndex
number
Returns
GraphOutput | null
getInputData()
getInputData<T>(slot, force_update?): T;Defined in: packages/core/src/LGraphNode.ts:688
Retrieves the input data (data traveling through the connection) from one slot
Type Parameters
T
T = any
Parameters
slot
number
force_update?
boolean
if set to true it will force the connected node of this slot to output data into this link
Returns
T
data or if it is not connected returns undefined
Inherited from
getInputDataByName()
getInputDataByName<T>(slot_name, force_update?): T;Defined in: packages/core/src/LGraphNode.ts:763
Retrieves the input data from one slot using its name instead of slot number
Type Parameters
T
T = any
Parameters
slot_name
string
force_update?
boolean
if set to true it will force the connected node of this slot to output data into this link
Returns
T
data or if it is not connected returns null
Inherited from
getInputDataType()
getInputDataType(slot): SlotType | null;Defined in: packages/core/src/LGraphNode.ts:730
Retrieves the input data type (in case this supports multiple input types)
Parameters
slot
number
Returns
SlotType | null
datatype in string format
Inherited from
getInputInfo()
getInputInfo(slot): INodeInputSlot | null;Defined in: packages/core/src/LGraphNode.ts:780
tells you info about an input connection (which node, type, etc)
Parameters
slot
number
Returns
INodeInputSlot | null
Inherited from
getInputLink()
getInputLink(slot): LLink | null;Defined in: packages/core/src/LGraphNode.ts:795
Returns the link info in the connection of an input slot
Parameters
slot
number
Returns
LLink | null
object or null
Inherited from
getInputNode()
getInputNode(slot): LGraphNode | null;Defined in: packages/core/src/LGraphNode.ts:810
returns the node connected in the input slot
Parameters
slot
number
Returns
LGraphNode | null
Inherited from
getInputOrProperty()
getInputOrProperty<T>(name): T;Defined in: packages/core/src/LGraphNode.ts:835
returns the value of an input with this name, otherwise checks if there is a property with that name
Type Parameters
T
T = any
Parameters
name
string
Returns
T
Inherited from
getInputSlotProperty()
getInputSlotProperty(slot, name): any;Defined in: packages/core/src/LGraphNode.ts:503
Parameters
slot
number
name
string
Returns
any
Inherited from
LGraphNode.getInputSlotProperty
getInputSlotsConnectedTo()
getInputSlotsConnectedTo(slot): INodeInputSlot[];Defined in: packages/core/src/LGraphNode.ts:948
Returns the input slots in other nodes that an output in this node is connected to.
Parameters
slot
number
Returns
object or null
Inherited from
LGraphNode.getInputSlotsConnectedTo
getMenuOptions()?
getMenuOptions?(graphCanvas): ContextMenuItem[];Defined in: packages/core/src/LGraphNode.ts:3124
Called by LGraphCanvas.processContextMenu
Parameters
graphCanvas
Returns
Inherited from
getOptionalSlots()
getOptionalSlots(): OptionalSlots | null;Defined in: packages/core/src/LGraphNode.ts:3115
Returns
OptionalSlots | null
Inherited from
getOutputData()
getOutputData<T>(slot): T | null;Defined in: packages/core/src/LGraphNode.ts:910
tells you the last output data that went in that slot
Type Parameters
T
T = any
Parameters
slot
number
Returns
T | null
Inherited from
getOutputInfo()
getOutputInfo(slot): INodeOutputSlot | null;Defined in: packages/core/src/LGraphNode.ts:970
tells you info about an output connection (which node, type, etc)
Parameters
slot
number
Returns
INodeOutputSlot | null
Inherited from
getOutputLinks()
getOutputLinks(slot): LLink[];Defined in: packages/core/src/LGraphNode.ts:927
Returns the link info in the connection of an output slot
Parameters
slot
number
Returns
LLink[]
object or null
Inherited from
getOutputNodes()
getOutputNodes(slot): LGraphNode[];Defined in: packages/core/src/LGraphNode.ts:1006
retrieves all the nodes connected to this output slot
Parameters
slot
number
Returns
Inherited from
getOutputSlotConnectedTo()
getOutputSlotConnectedTo(slot): INodeOutputSlot | null;Defined in: packages/core/src/LGraphNode.ts:886
Returns the output slot in another node that an input in this node is connected to.
Parameters
slot
number
Returns
INodeOutputSlot | null
object or null
Inherited from
LGraphNode.getOutputSlotConnectedTo
getOutputSlotProperty()
getOutputSlotProperty(slot, name): any;Defined in: packages/core/src/LGraphNode.ts:521
Parameters
slot
number
name
string
Returns
any
Inherited from
LGraphNode.getOutputSlotProperty
getPropertyInfo()
getPropertyInfo(property): IPropertyInfo;Defined in: packages/core/src/LGraphNode.ts:1668
returns all the info available about a property of this node.
Parameters
property
string
name of the property
Returns
the object with all the available info
Method
getPropertyInfo
Inherited from
getRootGraph()
getRootGraph(): LGraph | null;Defined in: packages/core/src/LGraphNode.ts:455
Returns
LGraph | null
Inherited from
getSlotInPosition()
getSlotInPosition(x, y): SlotInPosition | null;Defined in: packages/core/src/LGraphNode.ts:1831
checks if a point is inside a node slot, and returns info about which slot
Parameters
x
number
y
number
Returns
SlotInPosition | null
Inherited from
getSlotMenuOptions()?
getSlotMenuOptions?(slot): ContextMenuItem[];Defined in: packages/core/src/LGraphNode.ts:3127
Parameters
slot
Returns
Inherited from
getTitle()
getTitle(): string;Defined in: packages/core/src/LGraphNode.ts:451
get the title string
Returns
string
Inherited from
getValidGraphInputName()
getValidGraphInputName(baseName): string;Defined in: packages/core/src/nodes/Subgraph.ts:802
Parameters
baseName
string
Returns
string
getValidGraphOutputName()
getValidGraphOutputName(baseName): string;Defined in: packages/core/src/nodes/Subgraph.ts:814
Parameters
baseName
string
Returns
string
is()
is<T>(ctor): this is T;Defined in: packages/core/src/LGraphNode.ts:1878
Type Parameters
T
T extends LGraphNode
Parameters
ctor
new () => T
Returns
this is T
Inherited from
isAnyOutputConnected()
isAnyOutputConnected(): boolean;Defined in: packages/core/src/LGraphNode.ts:993
tells you if there is any connection in the output slots
Returns
boolean
Inherited from
LGraphNode.isAnyOutputConnected
isInputConnected()
isInputConnected(slot): boolean;Defined in: packages/core/src/LGraphNode.ts:772
tells you if there is a connection in one input slot
Parameters
slot
number
Returns
boolean
Inherited from
isOutputConnected()
isOutputConnected(slot): boolean;Defined in: packages/core/src/LGraphNode.ts:981
tells you if there is a connection in one output slot
Parameters
slot
number
Returns
boolean
Inherited from
isPointInside()
isPointInside(
x,
y,
margin?,
skipTitle?
): boolean;Defined in: packages/core/src/LGraphNode.ts:1794
checks if a point is inside the shape of a node
Parameters
x
number
y
number
margin?
number = 0
skipTitle?
boolean = false
Returns
boolean
Inherited from
isShowingTitle()
isShowingTitle(mouseOver): boolean;Defined in: packages/core/src/LGraphNode.ts:2843
Parameters
mouseOver
boolean
Returns
boolean
Inherited from
iterateAllLinks()
iterateAllLinks(): Iterable<LLink>;Defined in: packages/core/src/LGraphNode.ts:1034
Returns
Iterable<LLink>
Inherited from
iterateInputInfo()
iterateInputInfo(): Iterable<INodeInputSlot>;Defined in: packages/core/src/LGraphNode.ts:677
Returns
Iterable<INodeInputSlot>
Inherited from
iterateOutputInfo()
iterateOutputInfo(): Iterable<INodeOutputSlot>;Defined in: packages/core/src/LGraphNode.ts:904
Returns
Iterable<INodeOutputSlot>
Inherited from
iterateParentGraphs()
iterateParentGraphs(): Iterable<LGraph>;Defined in: packages/core/src/nodes/Subgraph.ts:188
Returns
Iterable<LGraph>
iterateParentSubgraphNodes()
iterateParentSubgraphNodes(): Iterable<Subgraph>;Defined in: packages/core/src/LGraphNode.ts:467
Returns
Iterable<Subgraph>
Inherited from
LGraphNode.iterateParentSubgraphNodes
loadImage()
loadImage(url): HTMLImageElement;Defined in: packages/core/src/LGraphNode.ts:2812
Parameters
url
string
Returns
HTMLImageElement
Inherited from
localToScreen()
localToScreen(
x,
y,
graphCanvas
): Vector2;Defined in: packages/core/src/LGraphNode.ts:2876
Parameters
x
number
y
number
graphCanvas
Returns
Inherited from
moveInput()
moveInput(slot, newSlot): void;Defined in: packages/core/src/LGraphNode.ts:1520
Parameters
slot
number
newSlot
number
Returns
void
Inherited from
moveNodesToParentGraph()
moveNodesToParentGraph(nodes): Record<NodeID, LGraphNode>;Defined in: packages/core/src/nodes/Subgraph.ts:858
Parameters
nodes
Returns
Record<NodeID, LGraphNode>
moveOutput()
moveOutput(slot, newSlot): void;Defined in: packages/core/src/LGraphNode.ts:1421
Parameters
slot
number
newSlot
number
Returns
void
Inherited from
onAction()
onAction(
action,
param,
options
): void;Defined in: packages/core/src/nodes/Subgraph.ts:203
Parameters
action
any
param
any
options
Returns
void
Overrides
onAdded()?
onAdded?(graph): void;Defined in: packages/core/src/LGraphNode.ts:3003
when added to graph (warning: this is called BEFORE the node is configured when loading) Called by LGraph.add
Parameters
graph
Returns
void
Inherited from
onAddPropertyToPanel()?
onAddPropertyToPanel?(name, panel): boolean;Defined in: packages/core/src/LGraphNode.ts:3084
Parameters
name
string
panel
Returns
boolean
Inherited from
LGraphNode.onAddPropertyToPanel
onAfterExecuteNode()
onAfterExecuteNode(param, options?): void;Defined in: packages/core/src/LGraphNode.ts:1074
Parameters
param
any
options?
object
Returns
void
Inherited from
onBeforeConnectInput()?
onBeforeConnectInput?(inputIndex): number;Defined in: packages/core/src/LGraphNode.ts:3053
Called just before connection (or disconnect - if input is linked). A convenient place to switch to another input, or create new one. This allow for ability to automatically add slots if needed
Parameters
inputIndex
number
Returns
number
selected input slot index, can differ from parameter value
Inherited from
LGraphNode.onBeforeConnectInput
onBounding()?
onBounding?(area): boolean;Defined in: packages/core/src/LGraphNode.ts:2935
Parameters
area
Float32Array
Returns
boolean
Inherited from
onConfigure()
onConfigure(o): void;Defined in: packages/core/src/nodes/Subgraph.ts:457
Called by LGraph.configure
Parameters
o
Returns
void
Overrides
onConnectInput()?
onConnectInput?(
inputIndex,
outputType,
outputSlot,
outputNode,
outputIndex
): boolean;Defined in: packages/core/src/LGraphNode.ts:3020
if returns false the incoming connection will be canceled Called by LGraph.connect
Parameters
inputIndex
number
target input slot number
outputType
type of output slot
outputSlot
output slot object
outputNode
node containing the output
outputIndex
number
index of output slot
Returns
boolean
Inherited from
onConnectionsChange()?
onConnectionsChange?(
type,
slotIndex,
isConnected,
link,
ioSlot
): void;Defined in: packages/core/src/LGraphNode.ts:3059
a connection changed (new one or removed) (LiteGraph.INPUT or LiteGraph.OUTPUT, slot, true if connected, linkInfo, input_info or output_info )
Parameters
type
slotIndex
number
isConnected
boolean
link
ioSlot
| INodeInputSlot | INodeOutputSlot
Returns
void
Inherited from
LGraphNode.onConnectionsChange
onConnectOutput()?
onConnectOutput?(
outputIndex,
inputType,
inputSlot,
inputNode,
inputIndex
): boolean;Defined in: packages/core/src/LGraphNode.ts:3037
if returns false the incoming connection will be canceled Called by LGraph.connect
Parameters
outputIndex
number
target output slot number
inputType
type of input slot
inputSlot
input slot object
inputNode
node containing the input
inputIndex
number
index of input slot
Returns
boolean
Inherited from
onDblClick()
onDblClick(
e,
pos,
graphCanvas
): void;Defined in: packages/core/src/nodes/Subgraph.ts:196
Parameters
e
pos
graphCanvas
Returns
void
Overrides
onDeselected()?
onDeselected?(): void;Defined in: packages/core/src/LGraphNode.ts:2986
Called by LGraphCanvas.deselectNode
Returns
void
Inherited from
onDrawBackground()
onDrawBackground(
ctx,
graphcanvas,
canvas,
pos
): void;Defined in: packages/core/src/nodes/Subgraph.ts:255
Parameters
ctx
CanvasRenderingContext2D
graphcanvas
canvas
HTMLCanvasElement
pos
Returns
void
Overrides
onDrawCollapsed()?
onDrawCollapsed?(ctx, graphCanvas): boolean;Defined in: packages/core/src/LGraphNode.ts:2898
Parameters
ctx
CanvasRenderingContext2D
graphCanvas
Returns
boolean
Inherited from
onDrawForeground()?
onDrawForeground?(
ctx,
graphCanvas,
canvas
): void;Defined in: packages/core/src/LGraphNode.ts:2892
Parameters
ctx
CanvasRenderingContext2D
graphCanvas
canvas
HTMLCanvasElement
Returns
void
Inherited from
onDrawTitle()?
onDrawTitle?(ctx, graphCanvas): boolean;Defined in: packages/core/src/LGraphNode.ts:2930
Parameters
ctx
CanvasRenderingContext2D
graphCanvas
Returns
boolean
Inherited from
onDrawTitleBar()?
onDrawTitleBar?(
ctx,
graphCanvas,
title_height,
size,
scale,
fgColor
): boolean;Defined in: packages/core/src/LGraphNode.ts:2903
Parameters
ctx
CanvasRenderingContext2D
graphCanvas
title_height
number
size
scale
number
fgColor
string
Returns
boolean
Inherited from
onDrawTitleBox()?
onDrawTitleBox?(
ctx,
graphCanvas,
title_height,
size,
scale
): boolean;Defined in: packages/core/src/LGraphNode.ts:2912
Parameters
ctx
CanvasRenderingContext2D
graphCanvas
title_height
number
size
scale
number
Returns
boolean
Inherited from
onDrawTitleText()?
onDrawTitleText?(
ctx,
graphCanvas,
title_height,
size,
scale,
font,
selected
): boolean;Defined in: packages/core/src/LGraphNode.ts:2920
Parameters
ctx
CanvasRenderingContext2D
graphCanvas
title_height
number
size
scale
number
font
string
selected
boolean
Returns
boolean
Inherited from
onDropData()?
onDropData?(
data,
filename,
file
): void;Defined in: packages/core/src/LGraphNode.ts:233
Parameters
data
string | ArrayBuffer
filename
string
file
File
Returns
void
Inherited from
onDropFile()?
onDropFile?(file): void;Defined in: packages/core/src/LGraphNode.ts:232
Parameters
file
File
Returns
void
Inherited from
onDropItem()?
onDropItem?(e): boolean | void;Defined in: packages/core/src/LGraphNode.ts:234
Parameters
e
DragEvent
Returns
boolean | void
Inherited from
onExecute()
onExecute(): void;Defined in: packages/core/src/nodes/Subgraph.ts:221
Called by LGraph.runStep LGraphNode.getInputData
Returns
void
Overrides
onGetPropertyInfo()?
onGetPropertyInfo?(property): IPropertyInfo;Defined in: packages/core/src/LGraphNode.ts:3082
Parameters
property
string
Returns
Inherited from
onInputAdded()?
onInputAdded?(input): void;Defined in: packages/core/src/LGraphNode.ts:3093
Parameters
input
Returns
void
Inherited from
onInputClick()?
onInputClick?(slot, event): void;Defined in: packages/core/src/LGraphNode.ts:3097
Parameters
slot
number
event
Returns
void
Inherited from
onInputDblClick()?
onInputDblClick?(slot, event): void;Defined in: packages/core/src/LGraphNode.ts:3099
Parameters
slot
number
event
Returns
void
Inherited from
onInputRemoved()?
onInputRemoved?(slot, input): void;Defined in: packages/core/src/LGraphNode.ts:3095
Parameters
slot
number
input
Returns
void
Inherited from
onJSPropertyChanged()?
onJSPropertyChanged?(
property,
value,
prevValue?
): boolean | void;Defined in: packages/core/src/LGraphNode.ts:3080
Called when the node's title or other JS property changes
Parameters
property
string
value
any
prevValue?
any
Returns
boolean | void
Inherited from
LGraphNode.onJSPropertyChanged
onKey()?
onKey?(
event,
pos,
graphCanvas
): void;Defined in: packages/core/src/LGraphNode.ts:2975
Parameters
event
KeyboardEvent
pos
graphCanvas
Returns
void
Inherited from
onKeyDown()?
onKeyDown?(event): void;Defined in: packages/core/src/LGraphNode.ts:2976
Parameters
event
KeyboardEvent
Returns
void
Inherited from
onKeyUp()?
onKeyUp?(event): void;Defined in: packages/core/src/LGraphNode.ts:2977
Parameters
event
KeyboardEvent
Returns
void
Inherited from
onMenuNodeInputs()?
onMenuNodeInputs?(item): ContextMenuItem[];Defined in: packages/core/src/LGraphNode.ts:3089
Parameters
item
Returns
Inherited from
onMenuNodeOutputs()?
onMenuNodeOutputs?(item): ContextMenuItem[];Defined in: packages/core/src/LGraphNode.ts:3101
Parameters
item
Returns
Inherited from
onMouseDown()?
onMouseDown?(
event,
pos,
graphCanvas
): boolean | void;Defined in: packages/core/src/LGraphNode.ts:2939
Parameters
event
pos
graphCanvas
Returns
boolean | void
Inherited from
onMouseEnter()?
onMouseEnter?(
event,
pos,
graphCanvas
): void;Defined in: packages/core/src/LGraphNode.ts:2957
Parameters
event
pos
graphCanvas
Returns
void
Inherited from
onMouseLeave()?
onMouseLeave?(
event,
pos,
graphCanvas
): void;Defined in: packages/core/src/LGraphNode.ts:2963
Parameters
event
pos
graphCanvas
Returns
void
Inherited from
onMouseMove()?
onMouseMove?(
event,
pos,
graphCanvas
): void;Defined in: packages/core/src/LGraphNode.ts:2945
Parameters
event
pos
graphCanvas
Returns
void
Inherited from
onMouseUp()?
onMouseUp?(
event,
pos,
graphCanvas
): void;Defined in: packages/core/src/LGraphNode.ts:2951
Parameters
event
pos
graphCanvas
Returns
void
Inherited from
onNodeCreated()?
onNodeCreated?(): void;Defined in: packages/core/src/LGraphNode.ts:230
Returns
void
Inherited from
onNodeOptionalInputAdd()?
onNodeOptionalInputAdd?(value): void;Defined in: packages/core/src/LGraphNode.ts:3091
Parameters
value
any
Returns
void
Inherited from
LGraphNode.onNodeOptionalInputAdd
onNodeOptionalOutputAdd()?
onNodeOptionalOutputAdd?(value): void;Defined in: packages/core/src/LGraphNode.ts:3103
Parameters
value
any
Returns
void
Inherited from
LGraphNode.onNodeOptionalOutputAdd
onOutputAdded()?
onOutputAdded?(output): void;Defined in: packages/core/src/LGraphNode.ts:3107
Parameters
output
Returns
void
Inherited from
onOutputClick()?
onOutputClick?(slot, event): void;Defined in: packages/core/src/LGraphNode.ts:3111
Parameters
slot
number
event
Returns
void
Inherited from
onOutputDblClick()?
onOutputDblClick?(slot, event): void;Defined in: packages/core/src/LGraphNode.ts:3113
Parameters
slot
number
event
Returns
void
Inherited from
onOutputRemoved()?
onOutputRemoved?(slot, output): void;Defined in: packages/core/src/LGraphNode.ts:3109
Parameters
slot
number
output
Returns
void
Inherited from
onPropertyChanged()?
onPropertyChanged?(
property,
value,
prevValue?
): boolean | void;Defined in: packages/core/src/LGraphNode.ts:3075
if returns false, will abort the LGraphNode.setProperty Called when a property is changed
Parameters
property
string
value
any
prevValue?
any
Returns
boolean | void
Inherited from
onReassignID()
onReassignID(): void;Defined in: packages/core/src/nodes/Subgraph.ts:469
Returns
void
Overrides
onRemoved()?
onRemoved?(options?): void;Defined in: packages/core/src/LGraphNode.ts:3009
when removed from graph Called by LGraph.remove LGraph.clear
Parameters
options?
Returns
void
Inherited from
onResize()
onResize(size): void;Defined in: packages/core/src/nodes/Subgraph.ts:446
Parameters
size
Returns
void
Overrides
onSelected()?
onSelected?(): void;Defined in: packages/core/src/LGraphNode.ts:2983
Called by LGraphCanvas.selectNodes
Returns
void
Inherited from
onSerialize()?
onSerialize?(o): void;Defined in: packages/core/src/LGraphNode.ts:2994
Called by LGraph.serialize
Parameters
o
Returns
void
Inherited from
onShowCustomPanelInfo()?
onShowCustomPanelInfo?(panel): void;Defined in: packages/core/src/LGraphNode.ts:3085
Parameters
panel
Returns
void
Inherited from
LGraphNode.onShowCustomPanelInfo
onSlotPropertyChanged()?
onSlotPropertyChanged?(
kind,
slot,
slotInfo,
name,
value,
prev_value?
): boolean;Defined in: packages/core/src/LGraphNode.ts:3119
Parameters
kind
slot
number
slotInfo
| INodeInputSlot | INodeOutputSlot
name
string
value
any
prev_value?
any
Returns
boolean
Inherited from
LGraphNode.onSlotPropertyChanged
onWidgetChanged()?
onWidgetChanged?(widget, oldValue?): void;Defined in: packages/core/src/LGraphNode.ts:3087
Parameters
widget
oldValue?
any
Returns
void
Inherited from
pin()
pin(v?): void;Defined in: packages/core/src/LGraphNode.ts:2867
Forces the node to do not move or realign on Z
Parameters
v?
boolean
Returns
void
Inherited from
removeGraphInput()
removeGraphInput(inputName): void;Defined in: packages/core/src/nodes/Subgraph.ts:752
Parameters
inputName
string
Returns
void
removeGraphOutput()
removeGraphOutput(outputName): void;Defined in: packages/core/src/nodes/Subgraph.ts:777
Parameters
outputName
string
Returns
void
removeInput()
removeInput(slot): void;Defined in: packages/core/src/LGraphNode.ts:1498
remove an existing input slot
Parameters
slot
number
Returns
void
Inherited from
removeOutput()
removeOutput(slot): void;Defined in: packages/core/src/LGraphNode.ts:1393
remove an existing output slot
Parameters
slot
number
Returns
void
Inherited from
sendEventToAllNodes()
sendEventToAllNodes(
eventname,
param,
mode
): void;Defined in: packages/core/src/nodes/Subgraph.ts:249
Parameters
eventname
string
param
any
mode
Returns
void
serialize()
serialize<T>(): T;Defined in: packages/core/src/nodes/Subgraph.ts:450
serialize the content
Type Parameters
T
T extends SerializedLGraphNode
Returns
T
Overrides
setDirtyCanvas()
setDirtyCanvas(fg, bg?): void;Defined in: packages/core/src/LGraphNode.ts:2805
Forces to redraw or the main canvas (LGraphNode) or the bg canvas (links)
Parameters
fg
boolean
bg?
boolean = false
Returns
void
Inherited from
setInputDataType()
setInputDataType(slot, type): void;Defined in: packages/core/src/LGraphNode.ts:853
sets the input data type
Parameters
slot
number
type
Returns
void
Inherited from
setInputSlotProperty()
setInputSlotProperty(
slot,
name,
value
): void;Defined in: packages/core/src/LGraphNode.ts:539
Parameters
slot
number
name
string
value
any
Returns
void
Inherited from
LGraphNode.setInputSlotProperty
setOutputData()
setOutputData(slot, data): void;Defined in: packages/core/src/LGraphNode.ts:602
sets the output data
Parameters
slot
number
data
any
Returns
void
Inherited from
setOutputDataType()
setOutputDataType(slot, type): void;Defined in: packages/core/src/LGraphNode.ts:640
sets the output data
Parameters
slot
number
type
Returns
void
Inherited from
setOutputSlotProperty()
setOutputSlotProperty(
slot,
name,
value
): void;Defined in: packages/core/src/LGraphNode.ts:570
Parameters
slot
number
name
string
value
any
Returns
void
Inherited from
LGraphNode.setOutputSlotProperty
setProperty()
setProperty(name, value): void;Defined in: packages/core/src/LGraphNode.ts:476
sets the value of a property
Parameters
name
string
value
any
Returns
void
Inherited from
setSize()
setSize(size): void;Defined in: packages/core/src/LGraphNode.ts:1309
changes node size and triggers callback
Parameters
size
Returns
void
Method
setSize
Inherited from
setWidgetHidden()
setWidgetHidden(widget, hidden): void;Defined in: packages/core/src/LGraphNode.ts:1771
Parameters
widget
hidden
boolean
Returns
void
Inherited from
toString()
toString(): string;Defined in: packages/core/src/LGraphNode.ts:446
serialize and stringify
Returns
string
Inherited from
trace()
trace(msg): void;Defined in: packages/core/src/LGraphNode.ts:2790
Console output
Parameters
msg
string
Returns
void
Inherited from
trigger()
trigger(
action,
param?,
options?
): void;Defined in: packages/core/src/LGraphNode.ts:1171
Triggers an event in this node, this will trigger any output with the same name
Parameters
action
string
param?
any
options?
Returns
void
Inherited from
triggerSlot()
triggerSlot(
slot,
param?,
link_id?,
options?
): void;Defined in: packages/core/src/LGraphNode.ts:1193
Triggers an slot event in this node
Parameters
slot
number
the index of the output slot
param?
any
link_id?
in case you want to trigger and specific output link in a slot
options?
LActionOptions = {}
Returns
void
Inherited from
updateOutputData()?
updateOutputData?(slot): void;Defined in: packages/core/src/LGraphNode.ts:3105
Parameters
slot
number
Returns
void