Theme
Design your own
On this page (3)

§Headline studio

Drag a node by its title, drag from a port to another to connect (compatible ports grow), click a connection to inspect it. Add nodes from Nodes by click or drag. Run executes the steps in the page - each step waits a moment so you can watch the states. ⌘Z undoes, F fits.

§How it works

The graph lives in a store on the main thread: every edit is a transaction of new values that is checked whole - port types, how many connections a port takes, cycles - and rolled back whole when it fails, so the graph is never half changed. The worker keeps a derived scene of node boxes and connection curves in a spatial hash; each frame it draws what is in view into an OffscreenCanvas and hands the bitmap back. The page meanwhile moves at most 150 HTML cards with the camera, so panning never waits on the worker.

flowchart LR
    Edit["edit:<br/>drag, connect, type"] -->|"patches"| Store["store:<br/>checks, history"]
    Store -->|"changed geometry"| Worker["worker:<br/>scene, spatial hash"]
    Worker -->|"ImageBitmap"| Canvas["canvas:<br/>connections, far nodes"]
    Store --> Cards["HTML cards:<br/>at most 150 near the view"]
    Canvas --> Frame["one animation frame"]
    Cards --> Frame
Fig 1. An edit becomes a transaction in the store; the worker redraws the scene; the cards and the bitmap meet in one animation frame.

§Topics

Large Workflows - 10,000 nodes and 100,000 connections, the render budget and what it samples. Node Types & Fields - declaring node types, the card controls and custom card bodies. Editing & Structure - connecting, moving, groups, subworkflows and the keys. Running Workflows - run handlers in the page, an execution adapter for a server, the node states. Formats & Import - the JSON document, ComfyUI and Gradio, import and export.

Comments, ideas or improvements? Edit this page's source on GitHub