[API Nodes] Apply yellow color to api nodes by default (#3766)

This commit is contained in:
Chenlei Hu
2025-05-05 13:56:11 -04:00
committed by Chenlei Hu
parent 1215a23393
commit 9f2aecf052

View File

@@ -1,5 +1,6 @@
import {
type IContextMenuValue,
LGraphCanvas,
LGraphEventMode,
LGraphNode,
LiteGraph,
@@ -79,6 +80,13 @@ export const useLitegraphService = () => {
this.#addOutputs(ComfyNode.nodeData.outputs)
this.#setInitialSize()
this.serialize_widgets = true
// Mark API Nodes yellow by default to distinguish with other nodes.
if (ComfyNode.nodeData.api_node) {
this.color = LGraphCanvas.node_colors.yellow.color
this.bgcolor = LGraphCanvas.node_colors.yellow.bgcolor
}
void extensionService.invokeExtensionsAsync('nodeCreated', this)
}