π BV Prompt AST Debug
See the actual tree your tagged prompt became β JSON, prettified
- ast
- ast_json
BV Prompt AST Debug is the "what did my prompt actually become?" node. You wire an ast into it and it dumps the whole tree as JSON into a scrollable, read-only output field on the node itself. It's a debugging tool, full stop - the diagnostic you reach for when BV Prompt Encode isn't parsing the way you expect, or when a Category Switch silently emptied a section and you want to see why.
If you've ever used a regex debugger to figure out why your prompt transform ate half the sentence, you know exactly why this exists. The pack's whole pitch is "AST-based prompt tooling (no fragile string parsing)," and Debug is the instrument panel for that claim: you can see the doc / block / span / text / comment nodes the parser produced, verify your categories landed where you think they did, and check that comments are being kept as separate nodes instead of leaking into text.
How it works
The backend serializes the AST to JSON and returns it two ways at once: as the ast_json STRING output and as the content of the node's own debug_output field, which the README describes as a read-only, scrollable text box - safe even for large ASTs, since it doesn't try to render the tree as widgets.
Inputs:
ast(requiredBV_AST) - the tree to inspect, typically from BV Prompt Encode or Category Switch.pretty(BOOLEAN, default true) - pretty-print with indentation, versus compact single-line JSON.indent(INT, default 2, range 0β8) - indentation width when pretty is on.sort_keys(BOOLEAN, default false) - alphabetize JSON keys; handy when diffing two ASTs.
Output: ast_json (STRING) - the serialized tree. It's an output node, so its primary job is the on-canvas display, but the string output means you could tee it into a save-node if you ever want to archive prompt structures.
Wiring it
BV Prompt Encode (ast) β BV Prompt AST Debug
That's it. Add it alongside your normal pipeline as a debug tap - it won't disturb anything upstream, and you can delete it once you trust the parse. It's a great companion to Category Switch: pipe the switch's ast into Debug and eyeball whether the prune did what you asked.
Install & gotchas
Pack standard: ComfyUI Manager β BV Node Pack, or clone https://github.com/BlackVortexAI/bv_nodepack into custom_nodes, restart. No models, no dependencies.
Gotchas are minor. The debug_output field is read-only by design - you can't edit the JSON in place and expect it to feed back into the graph (it won't; the ast input is the only thing that drives it). If serialization somehow fails (a malformed AST from an older workflow), it degrades gracefully to an error string in the output rather than crashing your run. And because it's an output node, ComfyUI will treat it as a graph endpoint - harmless, but know that's why it shows as a terminal node. For the rest, it's the most boring, most useful node in the AST family.
Inputs (4)
| Name | Type | Default | Description |
|---|---|---|---|
| ast | BV_AST | β | |
| prettyopt | BOOLEAN | true | β |
| indentopt | INT | 20β8 | β |
| sort_keysopt | BOOLEAN | false | β |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| ast_json | STRING | β |