Comfy-Org / Comfy-Org/ComfyUI

[Q] Trying to get return values in ui and console

Open
#1,475 1 comment 0 reactions 0 assignees View on GitHub
User Support
Dominant language
Python
Stars
133k
Forks
15.7k
Avg merge
1d 7h
Merged PRs (30d)
158

Description

i started using comfy ui, but im trying to do something basic not sd related, im having trouble showing a simple return value in the ui.
I already checked different examples but i dont get the output part...
```python
class Add:
@classmethod
def INPUT_TYPES(cls):
return {
"required": {
"a": ("FLOAT", {"default": 1.0}),
"b": ("FLOAT", {"default": 1.0}),
}
}

RETURN_TYPES = ("STRING",)
FUNCTION = "calc"
OUTPUT_NODE = True
OUTPUT_IS_LIST = (True,)

CATEGORY = "math"

def calc(self, a, b):
c =str( a + b)

return ( c,)

```

i dont want to manually print the return values in the classes above.
in the server im trying to see the return value:

```python
@routes.post("/prompt")
async def post_prompt(request):
print("got prompt")
resp_code = 200
out_string = ""
json_data = await request.json()
json_data = self.trigger_on_prompt(json_data)

pp(json_data)
```

im trying to see text return values inside the nodes. i tried a ShowText node no success.
can someone please point me to what im doing wrong...

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.