Nodes/Comfyui-Toolbox/Test Json Preview
ComfyUI Node

Test Json Preview

The wildcard-to-JSON adapter hiding behind a test node's name

By zcfrank1st·Created 3 years ago·Updated 2 years ago· 7
Test Json Preview
  • anything
  • JSON

The name is a little misleading - despite "Preview" sitting right there in the title, this node doesn't preview anything itself. It has no display, no widget, nothing that renders on the canvas. What it actually does is simpler and, honestly, more useful: it takes any input at all and hands back a properly JSON-typed output. Given its category (test, not toolbox like its two siblings), this reads like the node the author used internally to exercise the real preview widget while building the pack - but nothing about it is fake or disabled, and it's the only "anything in, JSON out" adapter this pack ships.

That makes it the connective tissue for the rest of Comfyui-Toolbox. PreviewJson and SaveJson both insist on a strictly-typed JSON input, and plenty of nodes in other packs only ever output STRING, INT, a dict wrapped as something else, or ComfyUI's * wildcard type. TestJsonPreview is what bridges that gap: wire whatever you've got into anything, and out comes a JSON-typed value you can actually plug into PreviewJson or SaveJson.

How it works

There's exactly one input, anything, and it's optional with type * - ComfyUI's wildcard, meaning it'll accept a wire from essentially any output socket regardless of type. It has one output, named JSON and typed JSON. Under the hood there's presumably some serialization happening to turn whatever you handed it into a JSON-compatible structure, but the README doesn't document what that conversion does with something like an IMAGE or MODEL tensor - so treat this as reliable for things that are already dict-, list-, string-, or number-shaped, and don't assume it'll do anything sensible or documented with a raw tensor type.

One mechanical thing worth knowing: this node is not flagged as an output node (is_output_node is false), unlike its two siblings. That matters because ComfyUI prunes any branch of the graph that doesn't eventually reach an output node - so if you drop TestJsonPreview on the canvas and leave its JSON output unconnected, it simply won't run. It has to feed into something, typically PreviewJson or SaveJson.

The inputs and outputs that matter

  • anything (optional, type *) - wire in whatever value you want converted. Any output socket will connect here.
  • JSON (output, type JSON) - the converted value, ready to plug into PreviewJson, SaveJson, or any other node in this pack (or elsewhere) that expects the JSON type specifically.

That's the entire node - one wire in, one wire out.

How to install it

Search Comfyui-Toolbox in ComfyUI Manager, or clone it directly:

cd ComfyUI/custom_nodes
git clone https://github.com/zcfrank1st/Comfyui-Toolbox.git

Restart ComfyUI afterward. There's no requirements.txt and no models involved - same lightweight install as the rest of the pack, since all three nodes ship together in one repo.

Common issues & troubleshooting

It runs but nothing seems to happen. That's expected - this node has no display of its own. If you want to actually see the result, its output needs to go into PreviewJson. Confusing it for a viewer because of the "Preview" in its name is the single most likely reason someone lands here wondering what it does.

It never executes. Because it isn't marked as an output node, ComfyUI will silently skip it if its JSON output isn't wired into anything downstream. Make sure it feeds PreviewJson, SaveJson, or some other node that eventually reaches an output - a dangling TestJsonPreview just doesn't run, with no error to tell you why.

Feeding it an IMAGE or MODEL does something weird (or nothing useful). The pack doesn't document what the anything → JSON conversion does with non-JSON-shaped types like tensors. It's built for values that are already reasonably JSON-like - text, numbers, dicts, lists - not for converting a latent or a checkpoint into a JSON dump. If you need to inspect a tensor-shaped value, this isn't the tool; look for a shape/debug node meant for that type instead.

Search doesn't find it in Manager. Its category is test, not toolbox, so it may not group with the other two nodes visually once installed. Search by the exact class name, TestJsonPreview, if the pack's general listing doesn't surface it the way you expect.

Categorytest

Inputs (1)

NameTypeDefaultDescription
anythingopt*

Outputs (1)

NameTypeDescription
JSONJSON