In a python based, node graph UI called ComfyUI, I am getting the following error:…
- User
In a python based, node graph UI called ComfyUI, I am getting the following error:
!!! Exception during processing!!! Sorry, GeneratorExp is not available in this evaluator Traceback (most recent call last): File "D:\AI Generation\Software\ComfyUI_windows_portable\python_embeded\Lib\site-packages\simpleeval.py", line 434, in _eval handler = self.nodes[type(node)] ~~~~~~~~~~^^^^^^^^^^^^ KeyError: <class 'ast.GeneratorExp'> During handling of the above exception, another exception occurred: Traceback (most recent call last): File "D:\AI Generation\Software\ComfyUI_windows_portable\ComfyUI\execution.py", line 151, in recursive_execute output_data, output_ui = get_output_data(obj, input_data_all) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "D:\AI Generation\Software\ComfyUI_windows_portable\ComfyUI\execution.py", line 81, in get_output_data return_values = map_node_over_list(obj, input_data_all, obj.FUNCTION, allow_interrupt=True) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "D:\AI Generation\Software\ComfyUI_windows_portable\ComfyUI\execution.py", line 74, in map_node_over_list results.append(getattr(obj, func)(**slice_dict(input_data_all, i))) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "D:\AI Generation\Software\ComfyUI_windows_portable\ComfyUI\custom_nodes\efficiency-nodes-comfyui\efficiency_nodes.py", line 4406, in evaluate result = simpleeval.simple_eval(python_expression, names=variables, functions=functions) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "D:\AI Generation\Software\ComfyUI_windows_portable\python_embeded\Lib\site-packages\simpleeval.py", line 748, in simple_eval return s.eval(expr) ^^^^^^^^^^^^ File "D:\AI Generation\Software\ComfyUI_windows_portable\python_embeded\Lib\site-packages\simpleeval.py", line 428, in eval return self._eval(previously_parsed or self.parse(expr)) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "D:\AI Generation\Software\ComfyUI_windows_portable\python_embeded\Lib\site-packages\simpleeval.py", line 440, in _eval return handler(node) ^^^^^^^^^^^^^ File "D:\AI Generation\Software\ComfyUI_windows_portable\python_embeded\Lib\site-packages\simpleeval.py", line 443, in _eval_expr return self._eval(node.value) ^^^^^^^^^^^^^^^^^^^^^^ File "D:\AI Generation\Software\ComfyUI_windows_portable\python_embeded\Lib\site-packages\simpleeval.py", line 440, in _eval return handler(node) ^^^^^^^^^^^^^ File "D:\AI Generation\Software\ComfyUI_windows_portable\python_embeded\Lib\site-packages\simpleeval.py", line 539, in _eval_call return func( ^^^^^ File "D:\AI Generation\Software\ComfyUI_windows_portable\python_embeded\Lib\site-packages\simpleeval.py", line 540, in <genexpr> *(self._eval(a) for a in node.args), **dict(self._eval(k) for k in node.keywords) ^^^^^^^^^^^^^ File "D:\AI Generation\Software\ComfyUI_windows_portable\python_embeded\Lib\site-packages\simpleeval.py", line 436, in _eval raise FeatureNotAvailable( simpleeval.FeatureNotAvailable: Sorry, GeneratorExp is not available in this evaluator - Assistant
The error you're encountering specifically stems from the fact that the
simpleevallibrary which is used by ComfyUI'sEvaluate Stringsnode does not support generator expressions. In your case, the parttoken for token in ...is a generator expression, whichsimpleevalcannot handle. That's why you're getting the error:FeatureNotAvailable: Sorry, GeneratorExp is not available in this evaluator.To resolve this issue, you need to rewrite the python expression without using generator expressions. You can achieve similar functionality using list comprehensions or explicit loops, which
simpleevalshould handle correctly.Here is how you can rewrite the expression using list comprehension:
Instead of:
- User
It appears list comprehension is also not supported.
- Assistant