Skip to content

A single ComfyUI node for executing arbitrary Python code with arbitrary inputs of any types

License

Notifications You must be signed in to change notification settings

mozhaa/ComfyUI-Execute-Python

Repository files navigation

ComfyUI-Execute-Python

A single node for executing arbitrary Python code with arbitrary inputs of any types

Preview

output_new_min_best image

Installation

Choose one of these options:

  1. Install via ComfyUI-Manager (search for "Execute Python")
  2. Use Custom Nodes Manager > Install via Git URL in ComfyUI-Manager
  3. Clone the repository into custom_nodes/ manually and install dependency from requirements.txt (or download .zip from GitHub and unpack it to custom_nodes/)

Usage

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

About

A single ComfyUI node for executing arbitrary Python code with arbitrary inputs of any types

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors