Simple Terminal #130
-
Hi @comfyanonymous 👋 I am trying to make a simple terminal node it is working but I am getting error is it possible to run node independent from subprocess import getoutput
class Terminal:
def __init__(self):
pass
@classmethod
def INPUT_TYPES(s):
return {"required": {"image": ("IMAGE",), "text": ("STRING", {"multiline": True})}}
RETURN_TYPES = ("IMAGE",)
FUNCTION = "execute"
def execute(self, image, text):
out = getoutput(f"{text}")
print(out)
return (image, )
CATEGORY = "Tools"
NODE_CLASS_MAPPINGS = {
"Terminal": Terminal
} got prompt
Name: torch
Version: 1.13.1+cu116
Summary: Tensors and Dynamic neural networks in Python with strong GPU acceleration
Home-page: https://pytorch.org/
Author: PyTorch Team
Author-email: [packages@pytorch.org](mailto:packages@pytorch.org)
License: BSD-3
Location: /usr/local/lib/python3.9/dist-packages
Requires: typing-extensions
Required-by: accelerate, fastai, open-clip-torch, pytorch-lightning, timm, torchaudio, torchdiffeq, torchmetrics, torchsde, torchtext, torchvision, triton, xformers
Traceback (most recent call last):
File "/content/ComfyUI/execution.py", line 174, in execute
executed += recursive_execute(self.server, prompt, self.outputs, x, extra_data)
File "/content/ComfyUI/execution.py", line 54, in recursive_execute
executed += recursive_execute(server, prompt, outputs, input_unique_id, extra_data)
File "/content/ComfyUI/execution.py", line 64, in recursive_execute
if "ui" in outputs[unique_id] and server.client_id is not None:
File "/usr/local/lib/python3.9/dist-packages/torch/_tensor.py", line 985, in __contains__
raise RuntimeError(
RuntimeError: Tensor.__contains__ only supports Tensor or scalar, but you passed in a <class 'str'>. |
Beta Was this translation helpful? Give feedback.
Answered by
m957ymj75urz
Mar 17, 2023
Replies: 2 comments 8 replies
-
|
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
camenduru
-
We need to be able to output text and other data back to the node. Having to output to console is such an annoyance. I've accidently closed out Comfy twice now bringing it up and minimizing constantly |
Beta Was this translation helpful? Give feedback.
7 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
return (image, )
maybe ?