SkillAgentSearch skills...

Litegraph.js

⛔ ARCHIVED (See README). A graph node engine and editor written in Javascript similar to PD or UDK Blueprints, comes with its own editor in HTML5 Canvas2D. The engine can run client side or server side using Node. It allows to export graphs as JSONs to be included in applications independently.

Install / Use

/learn @Comfy-Org/Litegraph.js
About this skill

Quality Score

0/100

Supported Platforms

Universal

README

⛔ ARCHIVED - Comfy-Org/litegraph.js has been merged into ComfyUI Frontend

This repository is archived and no longer maintained. The code has been integrated directly into the ComfyUI Frontend repository.

🚀 New Location

As of August 5, 2025, Comfy-Org/litegraph.js is now part of the ComfyUI Frontend monorepo:

  • Source Code: https://github.com/Comfy-Org/ComfyUI_frontend/tree/main/src/lib/litegraph
  • Repository: https://github.com/Comfy-Org/ComfyUI_frontend
  • Pull Request: https://github.com/Comfy-Org/ComfyUI_frontend/pull/4667
  • Architecture Decision: https://github.com/Comfy-Org/ComfyUI_frontend/blob/main/docs/adr/0001-merge-litegraph-into-frontend.md

📝 For Developers

  • Report Issues: Please report any issues at https://github.com/Comfy-Org/ComfyUI_frontend/issues
  • Contribute: All contributions should be made to the ComfyUI Frontend repository
  • Import Path: Changed from @comfyorg/litegraph to @/lib/litegraph within ComfyUI

🔄 Migration Details

The complete git history has been preserved using git subtree merge. All commits, authors, and timestamps remain intact in the new location.

❓ Why Was This Archived?

Comfy-Org/litegraph.js was only used by ComfyUI, and maintaining it as a separate package created unnecessary complexity. The integration enables:

  • Faster development cycles
  • Better architectural refactoring
  • Simplified maintenance
  • No more version mismatch issues

For more details, see the Architecture Decision Record.

@ComfyOrg/litegraph

This is the litegraph version used in ComfyUI_frontend.

It is a fork of the original litegraph.js. Some APIs may by unchanged, however it is largely incompatible with the original.

Some early highlights:

Install

npm i @comfyorg/litegraph

litegraph.js

A TypeScript library to create graphs in the browser similar to Unreal Blueprints.

<details> <summary>Description of the original litegraph.js</summary>

A library in Javascript to create graphs in the browser similar to Unreal Blueprints. Nodes can be programmed easily and it includes an editor to construct and tests the graphs.

It can be integrated easily in any existing web applications and graphs can be run without the need of the editor.

</details>

Node Graph

Features

  • Renders on Canvas2D (zoom in/out and panning, easy to render complex interfaces, can be used inside a WebGLTexture)
  • Easy to use editor (searchbox, keyboard shortcuts, multiple selection, context menu, ...)
  • Optimized to support hundreds of nodes per graph (on editor but also on execution)
  • Customizable theme (colors, shapes, background)
  • Callbacks to personalize every action/drawing/event of nodes
  • Graphs can be executed in NodeJS
  • Highly customizable nodes (color, shape, widgets, custom rendering)
  • Easy to integrate in any JS application (one single file, no dependencies)
  • Typescript support

Installation

You can install it using npm

npm install @comfyorg/litegraph

How to code a new Node type

Here is an example of how to build a node that sums two inputs:

import { LiteGraph, LGraphNode } from "./litegraph"

class MyAddNode extends LGraphNode {
  // Name to show
  title = "Sum"

  constructor() {
    this.addInput("A", "number")
    this.addInput("B", "number")
    this.addOutput("A+B", "number")
    this.properties.precision = 1
  }

  // Function to call when the node is executed
  onExecute() {
    var A = this.getInputData(0)
    if (A === undefined) A = 0
    var B = this.getInputData(1)
    if (B === undefined) B = 0
    this.setOutputData(0, A + B)
  }
}

// Register the node type
LiteGraph.registerNodeType("basic/sum", MyAddNode)

Server side

It also works server-side using NodeJS although some nodes do not work in server (audio, graphics, input, etc).

import { LiteGraph, LGraph } from "./litegraph.js"

const graph = new LGraph()

const firstNode = LiteGraph.createNode("basic/sum")
graph.add(firstNode)

const secondNode = LiteGraph.createNode("basic/sum")
graph.add(secondNode)

firstNode.connect(0, secondNode, 1)

graph.start()

Projects using it

ComfyUI

ComfyUI default workflow

Projects using the original litegraph.js

<details> <summary>Click to expand</summary>

webglstudio.org

WebGLStudio

MOI Elephant

MOI Elephant

Mynodes

MyNodes

</details>

Feedback

Please open an issue on the GitHub repo.

Development

Litegraph has no runtime dependencies. The build tooling has been tested on Node.JS 20.18.x

Releasing

Use GitHub actions to release normal versions.

  1. Run the Release a New Version action, selecting the version incrment type
  2. Merge the resultion PR
  3. A GitHub release is automatically published on merge

Pre-release

The action directly translates Version increment type to the npm version command. Pre-release ID (suffix) is the option for the --preid argument.

e.g. Use prerelease increment type to automatically bump the patch version and create a pre-release version. Subsequent runs of prerelease will update the prerelease version only. Use patch when ready to remove the pre-release suffix.

Contributors

You can find the current list of contributors on GitHub.

Contributors (pre-fork)

  • atlasan
  • kriffe
  • rappestad
  • InventivetalentDev
  • NateScarlet
  • coderofsalvation
  • ilyabesk
  • gausszhou

Related Skills

View on GitHub
GitHub Stars245
CategoryDevelopment
Updated3d ago
Forks64

Languages

TypeScript

Security Score

95/100

Audited on Mar 26, 2026

No findings