wasasquatch / asterr Goto Github PK
View Code? Open in Web Editor NEWAbstract Syntax Trees Evaluated Restricted Run (ASTERR) is a Python Script executor for ComfyUI
License: MIT License
Abstract Syntax Trees Evaluated Restricted Run (ASTERR) is a Python Script executor for ComfyUI
License: MIT License
I can pass data from one node directly to ASTERR normally, but if I use reroute, it doesn't work:
a
), nothing will happena
, create reroute), then I will have reroute that outputs into ASTERR, but have no input. Then if I connect reroute input to existing node's output(latent empty image for example), reroute output will disconnect from ASTERR node.I was hitting a python recursion limit on other nodes and just tracked it down to ASTERR changing the system recursion limit down to 100 by default. No big deal now that I understand what's happening, but I wonder if it would be better for ASTERR the store the system recursion limit and restore it when it's done? I haven't looked at the code to see if that would cause other problems or not. For now I'm just setting it to my system default of 1000 in the config.json.
Inside functions, we must import our modules as they are scoped from the main script
tensor2pil() and pil2tensor() are built-in methods to help withIMAGE
input
The current implementation in ASTERR calls exec() with an empty dictionary for the global namespace and the self.params dictionary as the local namespace. As these are different, "the code will be executed as if it were embedded in a class definition", and, as you mention, modules need to be imported inside function definitions. More inconveniently, our functions cannot easily call other functions defined in the code block assembled by ASTERR without having to pass around a bunch of function objects.
I assume this was done to avoid passing the real globals() in, which would allow access to various imports that are not on the whitelist, but is there any risk in providing self.params as both the local and global namespace (including via the shorthand signature for exec)? This allows the code to execute at 'module level', and would allow me to move imports out of function bodies (while still being checked by ast) wile also making my considerably more readable.
According to the reference code, this node can output one processed image. If I have more than one to output, how do I accomplish this?
I tried to create a function that returns a list of pillow objects and got an error in the pil2tensor function.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.