A single node for executing arbitrary Python code with arbitrary inputs of any types
Choose one of these options:
- Install via ComfyUI-Manager (search for "Execute Python")
- Use
Custom Nodes Manager > Install via Git URLin ComfyUI-Manager - Clone the repository into
custom_nodes/manually and install dependency fromrequirements.txt(or download .zip from GitHub and unpack it tocustom_nodes/)
Write your Python code in the widget (it may include imports, functions and any other language features) and assign result variable somewhere in the code. If you use multiple outputs, use a tuple (for example result = 1, 2, 3).
Important
For safety reasons, this node can't be used from shared workflows, which means that it would only work if you created it yourself.
Warning
The code is executed with a simple exec, so execute only trusted Python code

