Skip to content

custom_data_types

chrisgoringe edited this page Dec 1, 2023 · 5 revisions

Can I create my own data types?

If you just want to pass python objects between two custom nodes, you don't have to do anything complicated. Just pick a (unique) string (say, CHEESE), and use it to describe the RETURN_TYPE and INPUT_TYPE. ComfyUI (both in the python backend, execution.py, and the JavaScript front end) just checks that the string is the same - so you'll be able to connect the nodes together, and your python object will be passed through.

drago87 found that you need to do a forceInput if you want to use a custom type as a required input:

"required": {
                "info": ("CHEESE",{"forceInput": True})
            }

If you want a widget that creates the new data type, you'll need a custom widget.

Clone this wiki locally