mirror of
https://github.com/comfyanonymous/ComfyUI.git
synced 2026-04-26 02:12:31 +08:00
Print more tensor values in the preview any node. (#13544)
This commit is contained in:
parent
47ccecaee0
commit
c5d9edacd0
@ -1,5 +1,6 @@
|
|||||||
import json
|
import json
|
||||||
from comfy.comfy_types.node_typing import IO
|
from comfy.comfy_types.node_typing import IO
|
||||||
|
import torch
|
||||||
|
|
||||||
# Preview Any - original implement from
|
# Preview Any - original implement from
|
||||||
# https://github.com/rgthree/rgthree-comfy/blob/main/py/display_any.py
|
# https://github.com/rgthree/rgthree-comfy/blob/main/py/display_any.py
|
||||||
@ -19,6 +20,7 @@ class PreviewAny():
|
|||||||
SEARCH_ALIASES = ["show output", "inspect", "debug", "print value", "show text"]
|
SEARCH_ALIASES = ["show output", "inspect", "debug", "print value", "show text"]
|
||||||
|
|
||||||
def main(self, source=None):
|
def main(self, source=None):
|
||||||
|
torch.set_printoptions(edgeitems=6)
|
||||||
value = 'None'
|
value = 'None'
|
||||||
if isinstance(source, str):
|
if isinstance(source, str):
|
||||||
value = source
|
value = source
|
||||||
@ -33,6 +35,7 @@ class PreviewAny():
|
|||||||
except Exception:
|
except Exception:
|
||||||
value = 'source exists, but could not be serialized.'
|
value = 'source exists, but could not be serialized.'
|
||||||
|
|
||||||
|
torch.set_printoptions()
|
||||||
return {"ui": {"text": (value,)}, "result": (value,)}
|
return {"ui": {"text": (value,)}, "result": (value,)}
|
||||||
|
|
||||||
NODE_CLASS_MAPPINGS = {
|
NODE_CLASS_MAPPINGS = {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user