Settings

Theme

Show HN: Comfy Nodekit – build/serialize ComfyUI workflows in Python

github.com

11 points by zkanda 2 months ago · 4 comments · 2 min read

Reader

Hello HN!

I made Comfy Nodekit, a small library to make it easier to build and serialize ComfyUI workflows directly in Python.

If you’ve ever tried to hand-craft large ComfyUI graphs or maintain JSON workflows by hand, you probably know how messy it gets once you reach a few dozen nodes. We needed a better way to generate and modify graphs programmatically, so we built this.

Comfy Nodekit lets you create graphs with typed node factories, then export them back to the exact JSON format ComfyUI expects. It also introspects your running ComfyUI server to generate Python bindings for your custom nodes automatically, so you don’t lose compatibility when your setup changes.

We’re using this internally at Katalist to generate complex workflows with hundreds of nodes on the fly, things that would be impossible to manage and version.

Highlights

* Works with custom nodes (via /object_info)

* Type-safe graph composition + JSON export

* MIT license

* No runtime overhead - just Python + JSON

Why not just use ComfyScript or raw JSON? Because we wanted a Python-first, typed model that stays in sync with our ComfyUI server and is focused purely on composition, not on adding another runtime layer.

Happy to answer questions what kinds of workflows we're building for our image generation task.

bryanlyon 2 months ago

This is cool and fixes a very big need I have. I often use Comfy as a shortcut to generating content in a larger pipeline and the JSONified API is OK, but not the easiest to use. Node graphs are just complicated and difficult to edit in the JSON form. Love this! Now if someone would point me toward a way to better pass binary data to/from comfy I'll be a happy camper.

ArturRomanov 2 months ago

Looks awesome gang, how would I go about deploying this?

OneKostas 2 months ago

Sounds awesome! We'd love to try it out

emazgon 2 months ago

Look forward to trying it out!

Keyboard Shortcuts

j
Next item
k
Previous item
o / Enter
Open selected item
?
Show this help
Esc
Close modal / clear selection