JSON Shot Splitter
Slice a shot manifest into per-shot prompts without touching code
- shot_1
- shot_2
- shot_3
- shot_4
- shot_5
- shot_6
- shot_7
- shot_8
- shot_9
- shot_10
- shot_11
- shot_12
- shot_13
- shot_14
- shot_15
- shot_16
- shot_17
- shot_18
- shot_19
- shot_20
Here's a workflow that comes up a lot once you have an LLM planning your videos: the model returns one big JSON blob describing every shot in a sequence, and you need to turn that into individual prompts, one per sampler node. That's exactly what JSON Shot Splitter does - and it's the unsung workhorse of the pack's N8N story.
It takes a JSON string and a shot_count, reads a shot_manifest object out of it (a dict with shot_1, shot_2, ... keys), and splits each entry into its own output socket: shot_1 through shot_20. If an entry is already a string it passes through untouched; if it's an object or array it's serialized to pretty-printed JSON so you can still read it.
The inputs that matter
- json_string - the manifest JSON. It's a forced input (
forceInput), meaning you'll typically wire it from an LLM node or an N8N response rather than typing it, which is the right call - pasting a big manifest by hand is miserable. - shot_count - 1 to 20, default 2. This controls how many manifest entries get split out. A neat detail: the pack's JS extension syncs the visible output sockets to this value, so at
shot_count: 3you see three sockets, not twenty. The extra outputs still exist in the schema and just come back empty.
Outputs: shot_1 … shot_20 (all STRING).
Installing
The usual:
cd ComfyUI/custom_nodes
git clone https://github.com/studiodeep-ai/comfyui-studiodeep StudioDeep
pip install -r StudioDeep/requirements.txt
or search "StudioDeep" in ComfyUI Manager, then restart. No keys, no models.
Troubleshooting
- "Invalid JSON string" - the input isn't valid JSON. If it's coming from an LLM, watch for markdown fences or trailing prose; those break
json.loads. - Empty outputs with valid JSON - your JSON has no
shot_manifestkey (the node looks specifically forshot_manifest.shot_N), or the keys are named differently. Rename the keys in whatever produces the JSON and the node will find them. - A shot comes back as JSON instead of text - that's by design for object entries. If you wanted the raw string, the upstream JSON needs the shot as a string in the first place.
The honest take: it's a small, opinionated node with a specific contract (shot_manifest), and it's clearly built to sit downstream of an n8n workflow that produces that shape. If you control the workflow, this makes the LLM-to-multiple-samplers hop a one-wire affair; if your JSON has a different structure, you'll be reformatting it first.
Inputs (2)
| Name | Type | Default | Description |
|---|---|---|---|
| json_string | STRING | — | |
| shot_count | INT | 21–20 | — |
Outputs (20)
| Name | Type | Description |
|---|---|---|
| shot_1 | STRING | — |
| shot_2 | STRING | — |
| shot_3 | STRING | — |
| shot_4 | STRING | — |
| shot_5 | STRING | — |
| shot_6 | STRING | — |
| shot_7 | STRING | — |
| shot_8 | STRING | — |
| shot_9 | STRING | — |
| shot_10 | STRING | — |
| shot_11 | STRING | — |
| shot_12 | STRING | — |
| shot_13 | STRING | — |
| shot_14 | STRING | — |
| shot_15 | STRING | — |
| shot_16 | STRING | — |
| shot_17 | STRING | — |
| shot_18 | STRING | — |
| shot_19 | STRING | — |
| shot_20 | STRING | — |