Nodes/ComfyUI-ZFRNodes/JSON Frame Extractor
ComfyUI Node

JSON Frame Extractor

See what your story JSON actually contains — the debugging node

By zfrsgtcu·Created 3 months ago·Updated 2 months ago· 31
JSON Frame Extractor
  • json_input
  • text_to_image_prompts
  • image_to_image_prompts
  • text_to_image_count
  • image_to_image_count
  • total_frames
  • text_to_image_preview
  • image_to_image_preview

JSON Frame Extractor is a debugging node, and it's honest about it. You paste a story/frame JSON into it and it parses the thing apart: which frames are text-to-image, which are image-to-image, how many of each, and the prompts themselves - all as separate outputs you can inspect before you spend GPU time rendering.

It's the "trust but verify" step in the pack's LLM pipeline. When an LLM generates your story JSON, you usually want to see what it actually produced before feeding it into Story Frame Generator. The extractor sits in between: LLM output → this node → peek at the previews → Story Frame Generator. If the LLM emitted garbage, you find out here, cheap, instead of after a twelve-frame render.

Outputs

  • text_to_image_prompts, image_to_image_prompts - STRING lists of the prompts for each type.
  • text_to_image_count, image_to_image_count, total_frames - the counts.
  • text_to_image_preview, image_to_image_preview - every prompt in one numbered block with a count header, as a single string.

The input is a single json_input of wildcard type (*), so it accepts whatever the previous node hands you.

The one gotcha (and it'll bite you)

The README is unusually explicit here, because it's a classic ComfyUI trap: the *_prompts list outputs get iterated by ComfyUI when you wire them into a non-list node, so it can look like only the last prompt comes through. For debugging, don't fight that - use the *_preview outputs instead and connect them to a Show Text node. You get the full numbered breakdown in one readable block, and the preview strings grow dynamically with however many frames the JSON contains, with no fixed limit. Wire the previews up first, then worry about the counts.

Install

Part of ComfyUI-ZFRNodes. Via ComfyUI Manager (search "ComfyUI-ZFRNodes") or:

cd /path/to/ComfyUI/custom_nodes
git clone https://github.com/zfrsgtcu/ComfyUI-ZFRNodes.git

Restart ComfyUI fully after installing (the pack's frontend needs registering). Requirements are just numpy, torch, and Pillow - this node is pure parsing, no models, no downloads, no API. It's a utility, not a generator: pair it with a Show Text node and it'll save you from queueing a story that was never going to work.

Categoryzfr-nodes

Inputs (1)

NameTypeDefaultDescription
json_input*

Outputs (7)

NameTypeDescription
text_to_image_promptsSTRING
image_to_image_promptsSTRING
text_to_image_countINT
image_to_image_countINT
total_framesINT
text_to_image_previewSTRING
image_to_image_previewSTRING