comfyui-lib-generator packages the ComfyUI graph DSL together with a CLI that regenerates the node binding files from a local object_info.json. The idea is that you publish this repository to GitHub (and later to JSR) so that end users can run the generator against their own ComfyUI installation and get a tailor-made lib/comfy-ui directory.
src/cli.ts— entry point invoked viadeno task generateordeno run -A jsr:@scope/comfyui-lib-generator.src/generator.ts— the logic that readsobject_info.jsonand emits thegenerated/*.gen.tsfiles.src/templates/lib/comfy-ui— static runtime files (graph builder, type helpers, etc.) that are copied into the user's destination directory before generation.deno.json— configure the package name/version and expose the CLI on JSR.
You can rename the scope/package inside deno.json before publishing.
-
Make sure you have a fresh
object_info.jsonfrom the target machine's ComfyUI installation. -
Run the generator and point it to the file and the installation path you want to populate:
deno task generate --object-info ../object_info.json --out lib/comfy-ui
--object-infodefaults to./object_info.json.--outdefaults to./lib/comfy-ui.--forcereinstalls the static template files before regenerating types.
-
Commit the resulting
lib/comfy-ui(including thegenerateddirectory) wherever you need it.
To run type checking on the source files:
deno task type-checkTo verify the generator produces valid type definitions:
deno task testThis will:
- Generate bindings using test fixtures (
test/fixtures/object_info.json) - Run type checking on all generated files
The test output is written to test/output/ (gitignored).
- Update
deno.jsonwith your chosen package name (for example@cou723/comfyui-lib-generator) and bumpversion. - Run
deno task generateonce so the template files are present (JSR uploads the files on disk). - Double-check the package contents:
deno publish --dry-runorjsr publish --dry-run. jsr publishwhen ready.
Consumers can then run deno run -A jsr:@cou723/comfyui-lib-generator --object-info /path/to/object_info.json --out lib/comfy-ui.
deno x jsr@latest publish