chaiNNer-org/chaiNNer

add an option to save our node in python file format

Closed this issue · 2 comments

Hi, I would like you to add an option to save our nodes in a python code format, this would make the tool much better for those who need to have the application in code.

I don't quite understand what you mean by that.

If you meant that you want to the source code of a node, then you can look it up because chainner is open source (be mindful of our license if you copy anything).

If you meant that you want to save a chain as a .py file instead of a .chn file, then the answer is no. We do not plan to have an API for nodes, so we can't support this, nor do I think that we should support this. See the next paragraph for more info.

If you meant that you want to use chainner nodes from within your python code, then the answer is currently no. We have no plans of providing a stable API for our nodes. However, when we add support for nodes from external plugins, we will convert our internal packages (which contain all nodes) into packages you can install with pip. We still won't provide an API for our nodes, but we do plan to provide an API for the functionality implemented by those nodes.

The reason we won't provide nodes directly is API stability. Chainner nodes have different criteria for what is a breaking change than python functions. E.g. reordering inputs is not a breaking change for chainner node, but it is for python functions. Since we do not what chainner's nodes to be limited by python, we will not provide a python API for them. So instead of providing an API for nodes, we plan to expose some of our internal functionality that is used to implement nodes. So you won't have access to e.g. the PyTorch Upscale Image node, but you will have access to the functions used to implement the node.
That's the plan anyway. It will still take some time until we get there.

So in summary: We do not and likely will never provide direct access to our nodes, but will provide the functions we use to implement our nodes in the future.

If I understand correctly, the OP wants to be able to save an entire chain as python code. That will also never be supported, because that's just so unrealistic to ever implement