Open allo- opened 3 weeks ago
More generally, I think a way to add additional metadata to nodes would be very useful for API usage.
It seems that nodes marked as bypass are also not exported. I guess the export for the API is meant to be some kind of write-only format, but I think it would still be useful to export the full graph and have the bypass functionality so you can conditionally enable/disable parts of the graph in external code. Otherwise, you would have to export all combinations of active/inactive nodes into different API workflows to be able to, for example, change whether a control net is applied or not, instead of just changing the Apply Control Net node to be bypassed.
Feature Idea
Exporting a workflow for using it with the API assigns a numeric ID to each node, which appears to come from the order in which it was created. This makes it difficult to change parts of the workflow later, for example to assign a new prompt. Manually replacing the numbers with custom strings works fine with the API as the numeric IDs are also exported as strings, but the next time the workflow is exported it will have numeric node IDs again.
I suggest adding an optional field to define an ID to be used when exporting to the API, so that one can define IDs such as "prompt", "negative-prompt", "sampler", etc. to later use, for example,
nodes["prompt"]["inputs"]["text"]
for setting a prompt instead ofnodes["7"]["inputs"]["text"]
.Existing Solutions
nodes[i]["_meta"]["title"]
property.