Skip to content

Instantly share code, notes, and snippets.

View christian-byrne's full-sized avatar

bymyself christian-byrne

  • 12:51 (UTC -07:00)
View GitHub Profile
@christian-byrne
christian-byrne / patch-node-name.js
Last active July 17, 2024 19:20
Patch node properties without breaking users' saved workflows
import { app } from "../../scripts/app.js";
app.registerExtension({
name: "Extension Name",
beforeConfigureGraph: (graphData, missingNodeTypes) => {
for (let node of graphData.nodes) {
if (node.type === "Old Name") {
node.type = "New Name";
}
}
},
"""Edit the constants below and run the script to live-edit your code.
The EXEC_CMD is re-run anytime a file in the WATCH_DIR is changed.
For best results, create a development virtual environment with minimal
extensions/nodes/dependcies."""
import subprocess
import os
import time