ComfyUI icon indicating copy to clipboard operation
ComfyUI copied to clipboard

[Feature Request] Custom API node IDs

Open wcurti opened this issue 2 years ago • 3 comments

Currently, all nodes are accessible by an ID that is, strangely, a string of an int based on the order in which they were added to the UI.

This isn't ideal, obviously, because when scripting to an API with common processes for multiple workflows, you need to go in to the json and manually change all the node IDs to match, which means changing all the inherited IDs in other nodes that use their output.

If we could set custom IDs in the UI like, say "global_inputs", we could just spit out the API json format and run with it.

wcurti avatar Aug 25 '23 12:08 wcurti

I found recently that you might not want to rely on these IDs numbers either, as when I saved the API json one ID didn't match the one in the UI json. I had to triple check that I had saved them both correctly!

oxysoft avatar Aug 26 '23 15:08 oxysoft

setting them manually and otherwise using uuid would be an option? Are there other ideas or workarounds in the meantime to reliably integrate the api json format into other apps?

philmaas avatar Dec 12 '23 22:12 philmaas

using uuid would be an option?

This would probably introduce breaking changes for multiple extensions.

Trung0246 avatar Dec 26 '23 10:12 Trung0246

It already somewhat works.

in ComfyUI prompts, Ids can be whatever string you want. and can include the node name if you want. in https://github.com/rvion/CushyStudio , I have various ID serialization strategy when generating comfyUI workflows, one of them doing that.

The current problem is that some custom nodes rely on node IDs being numbers, and crash otherwise.

rvion avatar Jan 07 '24 18:01 rvion