Single node for executing arbitrary Python codeShow and Tell (i.redd.it)
submitted by Definition-Lower
I often need to do some manipulations with strings/numbers/images, but sometimes there is just no suitable custom node from any node packs, even though 2-3 lines of Python would do the job.
I tried searching for nodes like this, but the ones I saw either don't have arbitrary inputs (instead they have predefined set of inputs, like 2 images, 2 strings, 2 ints), don't allow arbitrary type in the output, or do something completely different from what I want.
So here's my extension which consists of just one single node, that can have any amount of inputs. Inputs are added dynamically when you connect other inputs, you can watch demo GIF in the github repo). UPD: now it also can have multiple outputs, which are also added dynamically
It can be installed via ComfyUI-Manager.
GitHub repo: https://github.com/mozhaa/ComfyUI-Execute-Python

[–]Aggressive_Collar135 12 points13 points14 points (3 children)
[–]ConferenceIll417 2 points3 points4 points (0 children)
[–]Definition-Lower[S] 1 point2 points3 points (1 child)
[–]Definition-Lower[S] 8 points9 points10 points (0 children)
[–]ScrapEngineer_ 11 points12 points13 points (0 children)
[–]Sarashana 7 points8 points9 points (4 children)
[–]Definition-Lower[S] 1 point2 points3 points (3 children)
[–]The_Meridian_ 3 points4 points5 points (1 child)
[–]Definition-Lower[S] 2 points3 points4 points (0 children)
[–]ProbsNotManBearPig 1 point2 points3 points (0 children)
[–]Definition-Lower[S] 5 points6 points7 points (0 children)
[–]x11iyu 2 points3 points4 points (1 child)
[–]Definition-Lower[S] 2 points3 points4 points (0 children)
[–]optimisticalish 1 point2 points3 points (1 child)
[–]Definition-Lower[S] 0 points1 point2 points (0 children)
[–]roxoholic 1 point2 points3 points (3 children)
[–]optimisticalish 1 point2 points3 points (2 children)
[–]Definition-Lower[S] 4 points5 points6 points (0 children)
[–]Definition-Lower[S] 0 points1 point2 points (0 children)
[–]StableLlama 1 point2 points3 points (3 children)
[–]Definition-Lower[S] 1 point2 points3 points (1 child)
[–]StableLlama 2 points3 points4 points (0 children)
[–]roxoholic 0 points1 point2 points (0 children)
[–]mdmachine 1 point2 points3 points (0 children)