Nodes/Prompt Helpers/Debug JSON Prompt
ComfyUI Node

Debug JSON Prompt

The final prompt text your CLIP encoder actually reads

By Pauan·Created 8 months ago·Updated 5 months ago· 3
Debug JSON Prompt
  • json_prompt
  • CHUNKS
  • MERGED

Debug JSON Prompt is the second half of the Prompt Helpers debugging pair. Where Debug JSON shows you the structure of a processed prompt, this node shows you the text - the actual string that gets handed to the CLIP text encoder, weights and all. If you've ever stared at a JSON prompt and wondered what it really boils down to, this is the node that tells you.

It takes one json_prompt input (a JSON_PROMPT - the type Debug JSON emits on its POSITIVE and NEGATIVE outputs) and serializes it back into prompt text using the exact same serializer the pack uses at encode time. What you see here is what gets encoded. No translation layer, no guessing.

Outputs

  • CHUNKS (STRING) - a JSON-formatted list of strings, one per chunk. In this pack a "chunk" is one region's worth of prompt - the BREAK-separated sections from Parse Lines, or each region: block. This is the output you want when you care about where tags land.
  • MERGED (STRING) - all chunks joined into a single flat string. Handy for a quick eyeball, or for checking total prompt length.

Both outputs are plain strings, so you can pipe them into any text-display node in ComfyUI to read them on the canvas.

Why you'd care

The killer use case is the 75-token boundary that CLIP-era checkpoints still enforce. The README sells BREAK precisely so you can split a prompt into multiple chunks and blow past 75 tokens - but if you're running SDXL-lineage checkpoints (Illustrious, NoobAI, Pony) and your face tags keep drifting, checking CHUNKS tells you whether your BREAK actually created separate chunks or whether the whole thing collapsed into one. You're debugging the tokenization, not vibing.

The other thing it exposes is weight arithmetic. This pack multiplies outer and inner weights and formats the result as (tag:1.2). Debug JSON Prompt shows you those final numbers, so a weight that came out at 0.9 when you meant 1.8 becomes visible instead of mysterious.

One honest caveat: this whole machinery - weights, BREAK, chunking - is CLIP-era tech. On LLM-encoded models (Flux 2 Klein, Z-Image, Anima), the encoder discards weights and there's no chunk boundary to break against. If you're on one of those, Debug JSON Prompt will still show you text, but that text is a suggestion to an LLM rather than a strict token budget.

Installing it

It ships with the Prompt Helpers pack. In ComfyUI Manager search "Prompt Helpers" (Pauan/comfyui-prompt-helpers), install, restart. Manual:

cd ComfyUI/custom_nodes
git clone https://github.com/Pauan/comfyui-prompt-helpers

Restart ComfyUI. No models to download, no heavy dependencies - the pack needs PyYAML and desktop-notifier (for EZ Notify) and ComfyUI 0.8.0+.

The standard diagnostic flow: EZ Prompt output → Debug JSON → POSITIVE/NEGATIVE → Debug JSON Prompt → text display. It's three extra nodes while debugging, deleted when you're done.

Categoryprompt_helpers/prompt

Inputs (1)

NameTypeDefaultDescription
json_promptJSON_PROMPT

Outputs (2)

NameTypeDescription
CHUNKSSTRINGList of strings, one string per chunk
MERGEDSTRINGMerges all of the chunks into a single string